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
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Wed Apr 04, 2007 3:49 am   

strange trigger bug
 
Any idea why my died trigger isn't working all the time? some times it works... sometimes it doesn't... i have tried a fiddling a bunch with it.


Quote:
> You leave the Fair behind you, heading for the main road.

You are now hunted by the loud hawker.
Golden Road at the crossroads (north, south, east and west)
An impoverished beggar.
Auto Battle Status = In Combat
n
ice hawker
s
You walk north down the muddy road.

Upon a muddy road (east and south)
A loud hawker.
> Freezing rain and sleet drizzle down upon the loud hawker. (8 damage)
The loud hawker died.
Your being disappears back to wherever it came from.
You receive 2474 experience points.
n
get all from corpse
put all in bag
s
> You leave the Fair behind you, heading for the main road.

Golden Road at the crossroads (north, south, east and west)
An impoverished beggar.



Code:
#CLASS {Statistics}
#ALIAS RoundCounter {RoundCount=%eval( @RoundCount+1)}
#VARIABLE DamageTaken {} {}
#VARIABLE DamageGiven {618} {}
#VARIABLE RoundCount {10} {1}
#VARIABLE NumHits {} {}
#VARIABLE NumMyMisses {} {}
#VARIABLE NumMobMisses {} {}
#VARIABLE DeadMob {The wealthy kren}
#VARIABLE TotalDamageGiven {} {}
#VARIABLE EndTime {} {}
#VARIABLE StartTime {85423} {}
#VARIABLE TotalTime {} {}
#TRIGGER {~((%d) damage~)} {
  DamageGiven=%eval( @DamageGiven+%1)
  #WINDOW Statistics %ansi( green, bold)Round = @RoundCount
  #WINDOW Statistics %ansi( green, bold)DamageGiven = @DamageGiven
  } "" {notrig|line=2}
#TRIGGER {You receive (%d) experience points.} {
  EndTime=%eval( (%time( hh)*3600)+(%time( nn)*60)+(%time( ss)))
  TotalTime=%format( 2, %eval( (@EndTime-@StartTime)/60.0))
  #WINDOW Statistics %ansi( red, bold)*** Summary *********************
  #WINDOW Statistics %ansi( red, bold)DeadMob = @DeadMob
  #WINDOW Statistics %ansi( red, bold)Round = @RoundCount
  #WINDOW Statistics %ansi( red, bold)DamageGiven = @DamageGiven
  #WINDOW Statistics %ansi( red, bold)AvgDamageGiven = %eval( @DamageGiven/ @RoundCount)
  #WINDOW Statistics %ansi( red, bold)ExpKill %ansi( cyan, bold)%1
  #WINDOW Statistics %ansi( red, bold)TotalTime @totalTime Mins
  #WINDOW Statistics %ansi( red, bold)ExpPerMin %format( 2, %eval( %1 /@TotalTime))
  #WINDOW Statistics %ansi( red, bold)********************* Summary ***
  #RESET Statistics
  }
#TRIGGER {^(*) died.*} {DeadMob=%1} "" {prompt|notrig}
#CLASS 0
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Apr 04, 2007 9:36 pm   
 
perhaps it's all the spaces between the functions' opening parentheses and their first arguments?
_________________
EDIT: I didn't like my old signature
Reply with quote
Josiah.Bruns
Apprentice


Joined: 04 Mar 2007
Posts: 103

PostPosted: Sun Apr 08, 2007 4:19 am   
 
what functions?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Apr 08, 2007 4:24 am   
 
The %ansi functions, the %eval functions, and the %time functions, at a glance.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Apr 08, 2007 5:47 am   
 
Bah, my bad. Thought this was a CMud question (CMud doesn't let you have them, but doesn't take them out of imported settings).

Another thing might be that ZMud special characters are appearing in the critter name, which because of the ^ would cause the trigger to not match at all.

If it's only partially matching, then you probably only need double-quotes around the %1.
_________________
EDIT: I didn't like my old signature
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