Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
alaric
Novice


Joined: 13 Aug 2005
Posts: 32
Location: Cherry Point, NC

PostPosted: Sat Aug 13, 2005 3:34 pm   

Capturing info into buttons
 
How do you capture stuff off the MUD into buttons or panels for viewing? For example one thing I want to capture is the people that are in the room I walk into, and put into buttons for each person, that I can refresh by another button. Here is an example of the MUDs output when entering a room.

Quote:
In the midst of a dank and fetid marsh.
Dark and murky water combined with the slightly acrid stench of
decomposing plant matter serve to fill your senses. Decorating the surface
of the fluid are scattered clumps of algae, a few distinct oversized lily
pads, and wide swathes of duckweed. Jutting out of the primordial soup of
the marsh are the same twisting cypress arms that fill the rest of the area
as well as the odd group of drooping weeping willow limbs. Despite the
inhospitable look of the fens if examined closely movement can be seen below
the surface.
It's raining lightly, very hot, and breezy.
Obvious exits: n s w nw sw
(13) A scrumptious looking steak is here.
( 9) A y-shaped twig is here.
A stumpy male halfling is here, covered in fern debris.
A stumpy male halfling is here, covered in fern debris.



If someone could help me or at least point me in the right direction I would appreciate it. Thank you.


EDIT: I figured out how to make it capture the text and all with triggers and variables, however, now I run into the problem of getting it to make one button per item. It only pulls the first stumpy male halfling, and throws it into a button, but I can't figure out how to make it repeat itself and make additional buttons for each new line(mob or character) in the room. Any ideas? Thank you again.
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Sun Aug 14, 2005 3:39 am   
 
#BU test {Test Button} {look}

creates a new button, with an ID of "test", that sends the look command to the MUD when it is clicked

----------
What if you used a variable which counted the number of times you make buttons (reset when you hit 255 or something) and use it for the ID?

#BU @Mybuttoncounter {@MobNameICaptured} {kill @MobNameICaptured}

Doesn't solve a 1.mob 2.mob but it would make more buttons.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Aug 14, 2005 10:43 am   
 
The best way to do this is precreate all the buttons you need. Then use your triggers to simply populate a variable with all the data. I do this for spells on my character with the buttons all set in a right hand panel. This is my system, it may give you some ideas of how to do it.

#CLASS AbilityBar
#ALIAS AddAbility {#ADDKEY {Ability} {Count} {%eval(@Ability.Count+1)};#ADDKEY {Ability} {%concat("Name",@Ability.Count)} {%1};#ADDKEY {Ability} {%concat("Display",@Ability.Count)} {%2};#ADDKEY {Ability} {%concat("SVar",@Ability.Count)} {%3};#ADDKEY {Ability} {%concat("Command",@Ability.Count)} {%4}}
#FUNCTION CommandTypes {weave$if($ismember(`Name,`SVar),untie '`Name';#ADDITEM WeavePend {untie '`Name'},weave '`Name';#ADDITEM WeavePend {weave '`Name'})untie#FORALL {]Spells} {untie '$i';#ADDITEM WeavePend {untie '$i'}};aff}
#FUNCTION CommandFunction {%eval(%subchar(%replace(%replace(%replace(%replace(%db(@CommandTypes,%db(@Ability,%concat("Command",%1))),"`Name",%db(@Ability,%concat("Name",%1))),"`SVar",%concat("@",%db(@Ability,%concat("SVar",%1)))),"`TVar",%concat("@",%db(@Ability,%concat("TVar",%1)))),"`BTN",%concat("Bar",%1)),"$]","%@"))}
#FUNCTION DisplayFunction {%if(%if(%begins(%db(@Ability,%concat("Display",%1)),"Control"),%eval(@Ability.Count>=%1),%btnenable(Bar%1,@Ability.Count>=%1)),%eval(%subchar(%replace(%replace(%replace(%replace(%db(@DisplayTypes,%db(@Ability,%concat("Display",%1))),"`Name",%db(@Ability,%concat("Name",%1))),"`SVar",%concat("@",%db(@Ability,%concat("SVar",%1)))),"`TVar",%concat("@",%db(@Ability,%concat("TVar",%1)))),"`BTN",%concat("Bar",%1)),"$]","%@")),Unset)}
#FUNCTION DisplayTypes {NF`Name: $if($ismember(`Name,`SVar),On,Off)T`Name: `SVarControlWeaves`Name: $numitems(`SVar)$if($btnenable(`BTN,$numitems(`SVar)),,)}
#BUTTON "@DisplayFunction(1)" {#EXEC @CommandFunction(1)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar1} {2}
#BUTTON "@DisplayFunction(2)" {#EXEC @CommandFunction(2)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar2} {2}
#BUTTON "@DisplayFunction(3)" {#EXEC @CommandFunction(3)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar3} {2}
#BUTTON "@DisplayFunction(4)" {#EXEC @CommandFunction(4)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar4} {2}
#BUTTON "@DisplayFunction(5)" {#EXEC @CommandFunction(5)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar5} {2}
#BUTTON "@DisplayFunction(6)" {#EXEC @CommandFunction(6)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar6} {2}
#BUTTON "@DisplayFunction(7)" {#EXEC @CommandFunction(7)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar7} {2}
#BUTTON "@DisplayFunction(8)" {#EXEC @CommandFunction(8)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar8} {2}
#BUTTON "@DisplayFunction(9)" {#EXEC @CommandFunction(9)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar9} {2}
#BUTTON "@DisplayFunction(10)" {#EXEC @CommandFunction(10)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar10} {2}
#BUTTON "@DisplayFunction(11)" {#EXEC @CommandFunction(11)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar11} {2}
#BUTTON "@DisplayFunction(12)" {#EXEC @CommandFunction(12)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar12} {2}
#BUTTON "@DisplayFunction(13)" {#EXEC @CommandFunction(13)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar13} {2}
#BUTTON "@DisplayFunction(14)" {#EXEC @CommandFunction(14)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar14} {2}
#BUTTON "@DisplayFunction(15)" {#EXEC @CommandFunction(15)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar15} {2}
#BUTTON "@DisplayFunction(16)" {#EXEC @CommandFunction(16)} {} {} {} {} {} {Size} {100} {20} {} {} {} {} {} {} {} "" {} {} {Bar16} {2}
#CLASS 0

The variable that contains the data for the buttons is kept seperately for each character of the mud. This is one example.
#VAR Ability {Count16Name1ArmorDisplay1NFSVar1SpellsCommand1weaveName2BlessDisplay2NFSVar2SpellsCommand2weaveName3FrenzyDisplay3NFSVar3SpellsCommand3weaveName4ProtectionDisplay4NFSVar4SpellsCommand4weaveName5Water ShieldDisplay5NFSVar5SpellsCommand5weaveName6SanctuaryDisplay6NFSVar6SpellsCommand6weaveName7FireproofDisplay7NFSVar7SpellsCommand7weaveName8FortifyDisplay8NFSVar8SpellsCommand8weaveName9HasteDisplay9NFSVar9SpellsCommand9weaveName10PhaseDisplay10NFSVar10SpellsCommand10weaveName11StrengthDisplay11NFSVar11SpellsCommand11weaveName12Detect HiddenDisplay12NFSVar12SpellsCommand12weaveName13InfravisionDisplay13NFSVar13SpellsCommand13weaveName14InvisDisplay14NFSVar14SpellsCommand14weaveName15Detect InvisDisplay15NFSVar15SpellsCommand15weaveName16Untie AllDisplay16ControlWeavesSVar16SpellsCommand16untie}

You of course don't need to do anything this complex, but feel free to try using mine.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net