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
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Fri Feb 25, 2005 4:11 am   

zmud trigs
 
hey! this is my first post here... i currently use zmud to play isengard and i have autosplit trigs i wrote for when i get gold, sell items etc, however i was curious if there was a way to make this trigger so that it is not static... for example; when you type "party" it says People in your group: tom, dick, harry. Well i was wondering if you could help me figure out how it will recognize an infinite amount of group members with that command, thanks in advance for any help!
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Fri Feb 25, 2005 5:03 am   
 
If that's an exact quote from your mud, and it's always like that, it'd be pretty easy to put those in a variable, if that's what you're asking (correct me if I'm wrong). There was a very similar thing in another thread recently.

#TRIGGER {People in your group: (*).$} {#VAR group %replace("%1", ", ", "|")}

You can modifiy the trigger pattern for exactly what your mud outputs, if that's not an exact quote from the mud.
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Fri Mar 04, 2005 8:41 pm   
 
People in your group: Joe, Bob

ok, that is exact text from my mud... lemme try to explain a bit better what im looking for; i want to be able to type "party" (shows the above text, who is in my group) and have it set each person in my group as a group member, ie. joe would be 'groupmember1' and bob would be 'groupmember2'. i want this trigger to be for an infinite amount of people in my group, so that i dont have to manually make a variable for each groupmember up to a certain amount. so no matter how many people are listed after "People in your group:" it would automatically make each person in the list a different group member for splitting gold
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Fri Mar 04, 2005 9:00 pm   
 
do you want to capture the groupmember names?
or just to count how many there are a make a variable for them?
what are you going to assign to the variables?
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Sat Mar 05, 2005 1:21 am   
 
i want to capture the names, and assign them a variable, and if possible count them as well, in order to make my autosplit triggers give them gold
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Sat Mar 05, 2005 3:47 am   
 
If you just want the names, etc, for autosplitting, you can do that with putting them into one variable, like I did above. Then you make an alias:


#TRIGGER {People in your group: (*).$} {#VAR group %replace("%1", ", ", "|")}
#ALIAS split {#FORALL @group {give %eval(%1/(%numitems(@group)+1)) coins %i}}

Then just do "split xxx" to split xxx coins between all of your group members. The +1 right after %numitems is in there to keep an equal amount for yourself; I'm assuming that you are not included in the group members listed. If the list of group members includes your name, just get rid of the +1 there.

Then, you could integrate this into a trigger, if you want it to automatically split any coins you get:

#TRIGGER {You get (%d) coins.} {split %1}

You'd have to change the triggering text to fit your mud's syntax. Hope I'm understanding you right and this helps :)
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
minish1
Beginner


Joined: 24 Feb 2005
Posts: 23

PostPosted: Mon Apr 11, 2005 7:00 am   
 
ok not getting any responses in the other one... HELP! hehe ok, these triggers worked GREAT, until my mud changed the output for the 'party' command... so now, instead of just listing the other people in my group, it now shows this if im leading the group: People in your group: You(leader), Harry. Or, if im not leading the group: Harry(leader), Minish. me being minish in the equation here... so obviously, this poses some problems with my autosplit trigs... any help here would be great!
Reply with quote
Spansh2
Beginner


Joined: 11 Apr 2005
Posts: 10

PostPosted: Mon Apr 11, 2005 7:40 am   
 
#TRIGGER {People in your group: (*).$} {#VAR group %replace("%1", ", ", "|")}
#ALIAS split {#FORALL @group {#IF (!%regex(%1,"^You")) {give %eval(%1/(%numitems(@group)+1)) coins %i}}}

that'll remove You from the list, you'll need to write a regex for removing (Leader) from %1 if it's there, something like

%regex(%1,"^(\w+)(?:Leader)?")

which would make

#ALIAS split {#FORALL @group {#IF (!%regex(%1,"^You"))) {%regex(%1,"^(\w+)(?:Leader)?");give %eval(%1/(%numitems(@group)+1)) coins %i}}}

it "should" work, you may need to escape some things, I haven't tested it, I'm sure someone will pop in and fix if I did.
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