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
anthony
Newbie


Joined: 16 Dec 2003
Posts: 6

PostPosted: Tue Dec 16, 2003 10:50 pm   

Need help with some triggers
 
Greetings everyone, I'm having some problems writing a specific set of triggers for a two-fold purpose.

A. Take the this output from the mud:

Your group of 2 members consists of:
Travis v.good rested fighting N N N 1 0
Peter perfect rested resting N N N 0 1

And for every member in my group (up to 20) put them in the status window with their condition next to their name. (condition can be any one of the following: perfect v.good good fair bad v.bad awful dying)


B. Setup a priority queue from that output and put the person worst hurt into a variable, second worst hurt into a variable, etc. Where something like V1-V10 are variables containing my hurt comrades.

Any help would be appreciated, I've looked through alot of the spell casting threads, but can't find anything relevant.

Thanks in advance!

anthony
Reply with quote
anthony
Newbie


Joined: 16 Dec 2003
Posts: 6

PostPosted: Wed Dec 17, 2003 3:47 am   
 
That's a no go, alot of the syntax needed to be edited, missing braces and such.. but nothing pops up into the window :(
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Dec 17, 2003 4:37 am   
 
Try this. I made a slight mistake with the last line in the original script. I rechecked the number of braces, and it looked alright to me. So i don't know where you got those extra ones from.

#trigger {Your group of (%d) members consists of:} {#var GroupStatus {%null};#LOOP 1,20 {#var GroupPlayer<%i> {%null}};#LOOP 1,8 {#var Status<%i> {%null}}}

#TRIGGER {(%w) ({perfect|v.good|good|fair|bad|v.bad|awful|dying})} {#IF (%2 =~ "perfect") {#additem Status1 {%1 is Perfect.}};#IF (%2 =~ "v.good") {#additem Status2 {%1 is V.good}};#IF (%2 =~ "good") {#additem Status3 {%1 is Good}};#IF (%2 =~ "fair") {#additem Status4 {%1 is Fair}};#IF (%2 =~ "bad") {#additem Status5 {%1 is Bad}};#IF (%2 =~ "v.bad") {#additem Status6 {%1 is V.bad}};#IF (%2 =~ "awful") {#additem Status7 {%1 is Awful}};#IF (%2 =~ "dying") {#additem Status8 {%1 is Dying!!}};#LOOP 1,7 {#IF (%null(@status<%i>)) {} {#var GroupStatus {%concat(@GroupStatus,~|,@Status<%i>)}}};#ALARM +2 {#LOOP %numitems(@GroupStatus) {#var GroupPlayer<%i> {%item(@GroupStatus,<%i>)}};#STWIN {@GroupPlayer1 %CR @GroupPlayer2 %CR @GroupPlayer3 %CR @GroupPlayer4 %CR @GroupPlayer5 %CR @GroupPlayer6 %CR @GroupPlayer7 %CR @GroupPlayer8 %CR @GroupPlayer9 %CR @GroupPlayer10 %CR @GroupPlayer11 %CR @GroupPlayer12 %CR @GroupPlayer13 %CR @GroupPlayer14 %CR @GroupPlayer15 %CR @GroupPlayer16 %CR @GroupPlayer17 %CR @GroupPlayer18 %CR @GroupPlayer19 %CR @GroupPlayer20}}}
Reply with quote
anthony
Newbie


Joined: 16 Dec 2003
Posts: 6

PostPosted: Wed Dec 17, 2003 6:00 am   
 
I still couldn't seem to get it to work, so I made some modifications to yours, Thanks for the help!

Here is what I ended up with for the trigger:

#trigger {^%s(%w)%s({perfect|v.good|good|fair|bad|v.bad|awful|dying})} {#IF (%2 =~ "perfect") {#additem GStatus {%1 is Perfect}};#IF (%2 =~ "v.good") {#additem GStatus {%1 is V.Good}};#IF (%2 =~ "good") {#additem GStatus {%1 is ood}};#IF (%2 =~ "fair") {#additem GStatus {%1 is Fair}};#IF (%2 =~ "bad") {#additem GStatus {%1 is Bad}};#IF (%2 =~ "v.bad") {#additem GStatus {%1 is V.Bad}};#IF (%2 =~ "awful") {#additem GStatus {%1 is Awful}};#IF (%2 =~ "dying") {#additem GStatus {%1 is Dying!}};#STWIN {%replace( @GStatus, "|", %CR)}}

Now to implement the priority thing Smile
Reply with quote
anthony
Newbie


Joined: 16 Dec 2003
Posts: 6

PostPosted: Wed Dec 17, 2003 7:25 am   
 
For some reason, v.good and v.bad do not work.. any ideas why?

Thanks again.
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Dec 17, 2003 7:37 am   
 
In your IF statements, put doublequotes around the
%2, and remove the ~. So, it'll look something like this: #IF ("%2" = "perfect") {#additem GStatus {%1 is Perfect}}
Reply with quote
anthony
Newbie


Joined: 16 Dec 2003
Posts: 6

PostPosted: Wed Dec 17, 2003 8:30 am   
 
Awesome, thanks!
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Wed Dec 17, 2003 11:31 am   
 
Here we go. FINALLY got it working, at least on my zmud. Try this one Anthony. It sorts priority, too.

#TRIGGER {Your group of (%d) members consists of:} {#var GroupStatus {%null};#LOOP 1,20 {#var GroupPlayer<%i> {%null}};#LOOP 1,8 {#var Status<%i> {%null}}}

#trigger {(%w) ({perfect|v.good|good|fair|bad|v.bad|awful|dying})} {#IF ("%2" = "perfect") {#additem Status1 {%1 is Perfect.}};#IF ("%2" = "v.good") {#additem Status2 {%1 is V.good}};#IF ("%2" = "good") {#additem Status3 {%1 is Good}};#IF ("%2" = "fair") {#additem Status4 {%1 is Fair}};#IF ("%2" = "bad") {#additem Status5 {%1 is Bad}};#IF ("%2" = "v.bad") {#additem Status6 {%1 is V.bad}};#IF ("%2" = "awful") {#additem Status7 {%1 is Awful}};#IF ("%2" = "dying") {#additem Status8 {%1 is Dying!!}};#ALARM +2 {#IF (%null(@status8)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status8)}};#IF (%null(@status7)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status7)}};#IF (%null(@status6)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status6)}};#IF (%null(@status5)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status5)}};#IF (%null(@status4)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status4)}};#IF (%null(@status3)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status3)}};#IF (%null(@status2)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status2)}};#IF (%null(@status1)) {} {#var GroupStatus {%concat(@GroupStatus,|,@Status1)}};#delnitem groupstatus 1;#LOOP %numitems(@GroupStatus) {#var GroupPlayer<%i> {%item(@GroupStatus,<%i>)}};#STWIN { @GroupPlayer1 %CR @GroupPlayer2 %CR @GroupPlayer3 %CR @GroupPlayer4 %CR @GroupPlayer5 %CR @GroupPlayer6 %CR @GroupPlayer7 %CR @GroupPlayer8 %CR @GroupPlayer9 %CR @GroupPlayer10 %CR @GroupPlayer11 %CR @GroupPlayer12 %CR @GroupPlayer13 %CR @GroupPlayer14 %CR @GroupPlayer15 %CR @GroupPlayer16 %CR @GroupPlayer17 %CR @GroupPlayer18 %CR @GroupPlayer19 %CR @GroupPlayer20}}
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