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
Bajed
Novice


Joined: 15 Aug 2004
Posts: 33

PostPosted: Sat Aug 21, 2004 12:02 pm   

Complicated Trigger Question
 
OK, First I have an alias... it looks like this:

Code:
Name: aff
Value: ...
@AffectsCheck = 1
@GrandTime = 0
@MystTime = 0
@HasteTime = 0
affects


Then I have 3 triggers, otherwise known as "time set" triggers:

Code:

Pattern:   SPL: ~(%s(%d)hr~) grand sanctuary       -20 to ARMORsets GRANDSANC$
Value: #VAR GrandTime %1

Pattern:   SPL: ~(%s(%d)hr~) haste                 sets HASTE$
Value: #VAR HasteTime %1

Pattern:   SPL: ~(%s(%d)hr~) healing myst          -1 to ARMOR$
Value: #VAR MystTime %1


and finally, I have a trigger that fires whenever my prompt is received:

Code:

Pattern: ^(%d)H (%d)M (%d)V >
Value: ...
#VAR AffectsOutput ""
#IF (@AffectsCheck=0) {#ABORT 1}
@AffectsCheck = 0
#IF (@GrandTime>=1) {#VAR AffectsOutput %concat( @AffectsOutput, "\cGGrand Sanctuary \cehas\cR @GrandTime \cetick~(s~) left.  ")} {#VAR AffectsOutput %concat( @AffectsOutput, "\cGGrand Sanctuary \ceis off.  ")}
#IF (@MystTime>=1) {#VAR AffectsOutput %concat( @AffectsOutput, "\cBHealing Myst \cehas\cR @MystTime \cetick~(s~) left.  ")} {#VAR AffectsOutput %concat( @AffectsOutput, "\cBHealing Myst \ceis off.  ")}
#IF (@HasteTime>=1) {#VAR AffectsOutput %concat( @AffectsOutput, "\cRHaste \cehas\cR @HasteTime \cetick~(s~) left.  ")} {#VAR AffectsOutput %concat( @AffectsOutput, "\cRHaste \ceis off.  ")}
say %trim( @AffectsOutput)
#UNVAR AffectsOutput


So basically, what this does when I type "aff" is fires the alias first, which zero's out all the Time variables, and sets AffectsCheck to 1 for later. Then it sends the "Affects" command to my MUD which in turn outputs results like:

Code:

4714H 1042M 643V >   SPL: ( 15hr) metalskin             -40 to ARMOR
  SPL: (  1hr) thornflesh            -1 to CHA
  SPL: (  1hr) thornflesh            -1 to DEX
  SPL: (  1hr) thornflesh            +8 to DAMROLL
  SPL: (  3hr) electric shield       sets ELECSHIELD
  SPL: ( 10hr) healing myst          -1 to ARMOR
  SPL: ( 13hr) protection from evil  sets PROT-EVIL
  SPL: (277hr) seeker                +6 to HITROLL
  SPL: (  1hr) haste                 sets HASTE
  SPL: ( 12hr) all around sight      sets ALLAROUNDSIGHT

4714H 1042M 648V >


So, when this is received, each of the 3 check triggers fire if that line is found - each of those work fine and properly store the %dhr part into the relative variables.

Then, a new prompt is recieved and since @AffectsCheck is set to 1, it concats a few strings depending on what Time variables got set, and outputs the result.


NOW, the problem is... on occasion, the prompt trigger seems to fire off the "say" command as seen above BEFORE one or two of the "time set" triggers fire, making the output display incorrect data. Ie. it seems to be firing triggers in the incorrect order for some reason, even tho the lines are sent to the client from the mud server in the order I expect them.

What this does, is on occasion (it happens most often with HASTE)... I get this:

Code:

4714H 1042M 643V >   SPL: ( 15hr) metalskin             -40 to ARMOR
  SPL: (  1hr) thornflesh            -1 to CHA
  SPL: (  1hr) thornflesh            -1 to DEX
  SPL: (  1hr) thornflesh            +8 to DAMROLL
  SPL: (  3hr) electric shield       sets ELECSHIELD
  SPL: ( 10hr) healing myst          -1 to ARMOR
  SPL: ( 13hr) protection from evil  sets PROT-EVIL
  SPL: (277hr) seeker                +6 to HITROLL
  SPL: (  1hr) haste                 sets HASTE
  SPL: ( 12hr) all around sight      sets ALLAROUNDSIGHT

4714H 1042M 648V > You say, in a jolly voice, 'Grand Sanctuary is off.  Healing Myst has 10 tick(s) left.  Haste is off.'


Even tho haste is actually 1... and it happens with any value for them as well, (1, 2, 3, 4, etc)...

Also, although it does happen more often with haste, it happens for others as well.

If I add a "#SHOW test" to the "time set" trigger for haste, I get this:

Code:

4714H 1042M 771V >   SPL: (  5hr) haste                 sets HASTE
  SPL: (  8hr) widowmaker            +15 to ARMOR
  SPL: (  8hr) widowmaker            +3 to DAMROLL
  SPL: (  8hr) widowmaker            +3 to HITROLL
  SPL: (  6hr) thornflesh            -1 to CHA
  SPL: (  6hr) thornflesh            -1 to DEX
  SPL: (  6hr) thornflesh            +8 to DAMROLL
  SPL: (  3hr) regen                 sets REGEN
  SPL: (  9hr) metalskin             -40 to ARMOR
  SPL: (  4hr) healing myst          -1 to ARMOR
  SPL: (  7hr) protection from evil  sets PROT-EVIL
  SPL: (271hr) seeker                +6 to HITROLL
  SPL: (  6hr) all around sight      sets ALLAROUNDSIGHT

4714H 1042M 771V > You say, in a jolly voice, 'Grand Sanctuary is off.  Healing Myst has 4 tick(s) left.  Haste is off.'
test
4714H 1042M 771V >


... informing me that the "time set" trigger for HASTE gets fired WAY after the prompt trigger... for some reason which I cannot determine!


Sorry if this was long winded, I hope I didn't make it more confusing then it really is - I just wanted to make the problem understood the best I could. And as always, any help would be appreciated.

-Bajed
Reply with quote
Bajed
Novice


Joined: 15 Aug 2004
Posts: 33

PostPosted: Sat Aug 21, 2004 12:04 pm   
 
Oh btw, I use zMud 7.04 if that's relavent to this problem :-)
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Aug 21, 2004 2:15 pm   
 
I've only glanced at your script, but a huge glaring error is how you're trying to define variables. The syntax for setting, e.g. the variable @test to "testing" is:
Quote:

test = "testing"
or
#VAR test {testing}

Because you're using the @ character when trying to set variables, it's not going to work. Remove @ from every line that sets a variable and try it again.
_________________
.geniusclown
Reply with quote
Bajed
Novice


Joined: 15 Aug 2004
Posts: 33

PostPosted: Sat Aug 21, 2004 5:36 pm   
 
Alright, I changed any variable assignments to not include the @. And tried one at a time getting the 3 spells I check for and running hte alias after each. This is what I get:

Code:

3949H 949M 771V >   SPL: ( 11hr) all around sight      sets ALLAROUNDSIGHT
  SPL: ( 31hr) invisibility          -40 to ARMORsets INVIS
  SPL: ( 14hr) fly                   sets FLY
  SPL: (260hr) seeker                +6 to HITROLL
  SPL: ( 64hr) detect invisibility   sets DET-INVIS
  SPL: ( 21hr) protection from evil  sets PROT-EVIL
  SPL: (  4hr) thornflesh            +8 to DAMROLL
  SPL: (  4hr) thornflesh            -1 to DEX
  SPL: (  4hr) thornflesh            -1 to CHA

3949H 949M 771V > Bajed says, in a jolly voice, 'Grand Sanctuary is off.  Healing Myst is off.  Haste is off.'

4177H 1042M 771V >
Malaphus stares at you and utters the words, 'tgrubm gibqheabral'.
A hazy green sphere momentarily solidifies around you.

4177H 1042M 771V >   SPL: (  5hr) grand sanctuary       -20 to ARMORsets GRANDSANC
  SPL: ( 21hr) metalskin             -40 to ARMOR
  SPL: (  2hr) thornflesh            -1 to CHA
  SPL: (  2hr) thornflesh            -1 to DEX
  SPL: (  2hr) thornflesh            +8 to DAMROLL
  SPL: ( 19hr) protection from evil  sets PROT-EVIL
  SPL: ( 62hr) detect invisibility   sets DET-INVIS
  SPL: (258hr) seeker                +6 to HITROLL
  SPL: ( 12hr) fly                   sets FLY
  SPL: (  9hr) all around sight      sets ALLAROUNDSIGHT

4177H 1042M 771V > Bajed says, in a jolly voice, 'Grand Sanctuary has 5 tick(s) left.  Healing Myst is off.  Haste is off.'

4177H 1042M 771V >
Malaphus stares at you and utters the words, 'poirubt wlgh'.
You are surrounded by a blue myst.

4177H 1042M 771V >   SPL: ( 20hr) healing myst          -1 to ARMOR
  SPL: (  5hr) grand sanctuary       -20 to ARMORsets GRANDSANC
  SPL: ( 21hr) metalskin             -40 to ARMOR
  SPL: (  2hr) thornflesh            -1 to CHA
  SPL: (  2hr) thornflesh            -1 to DEX
  SPL: (  2hr) thornflesh            +8 to DAMROLL
  SPL: ( 19hr) protection from evil  sets PROT-EVIL
  SPL: ( 62hr) detect invisibility   sets DET-INVIS
  SPL: (258hr) seeker                +6 to HITROLL
  SPL: ( 12hr) fly                   sets FLY
  SPL: (  9hr) all around sight      sets ALLAROUNDSIGHT

4177H 1042M 771V > Bajed says, in a jolly voice, 'Grand Sanctuary has 5 tick(s) left.  Healing Myst has 20 tick(s) left.  Haste is off.'

4177H 1042M 728V > You quaff a Vial of Ichor.
Your target is unaffected by the spell.
Your blood starts to race, and a blood red mist distorts your vision!
You start to move very quickly.

4177H 1042M 728V >
A Lawgiver has arrived.

4177H 1042M 728V >   SPL: (  5hr) haste                 sets HASTE
  SPL: (  8hr) widowmaker            +15 to ARMOR
  SPL: (  8hr) widowmaker            +3 to DAMROLL
  SPL: (  8hr) widowmaker            +3 to HITROLL
  SPL: ( 20hr) healing myst          -1 to ARMOR
  SPL: (  5hr) grand sanctuary       -20 to ARMORsets GRANDSANC
  SPL: ( 21hr) metalskin             -40 to ARMOR
  SPL: (  2hr) thornflesh            -1 to CHA
  SPL: (  2hr) thornflesh            -1 to DEX
  SPL: (  2hr) thornflesh            +8 to DAMROLL
  SPL: ( 19hr) protection from evil  sets PROT-EVIL
  SPL: ( 62hr) detect invisibility   sets DET-INVIS
  SPL: (258hr) seeker                +6 to HITROLL
  SPL: ( 12hr) fly                   sets FLY
  SPL: (  9hr) all around sight      sets ALLAROUNDSIGHT

4177H 1042M 728V > Bajed says, in a jolly voice, 'Grand Sanctuary is off.  Healing Myst is off.  Haste is off.'


I have no clue why, but first I acquired grand sanc, and the script worked as you can see... I then acquired healing myst and the script again worked fine. I then acquired haste and everything stops working. The "time trigger" for haste is the exact same as grand and myst, except it stores the value into @HasteTime instead of @GrandTime/@MystTime.

Arg so frustrating.
Reply with quote
Bajed
Novice


Joined: 15 Aug 2004
Posts: 33

PostPosted: Sat Aug 21, 2004 5:41 pm   
 
Hmmm... Actually, right after my last post I got to playing around with the prompt trigger's options and uncheked "Newline" and instead checked "Prompt" and it seems to be working like a charm now... not sure exactly why, could anybody explain reasoning?
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Aug 21, 2004 5:52 pm   
 
This is just a guess, but I'm thinking that it's because your MUD doesn't send a carriage return when it gives your prompt, which is what the "newline" option looks for.
_________________
.geniusclown
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