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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
surge321123
Beginner


Joined: 09 Jun 2011
Posts: 14

PostPosted: Mon Jun 13, 2011 3:42 am   

trouble with alarms evaluating information at the wrong time
 
OK I have a trigger for when a mob dies, it tracks the mob and tells you when it theoretically should have popped... Here is the code from zmud (I now use cmud and am trying to convert it)
pattern
^(%1) dies in fits of twitching agony.$
value
#if (!%ismember( %1, @excludeList) and %len( %1) < 25) {
#additem mobtrack %concat( %replace( %1, " ", ""), %time( "mmss"))
#var cur_mob %concat( %replace( %1, " ", ""), %time( "mmss"))
#echo @cur_mob died
#exec %concat( "#alarm """, @cur_mob, """ {+14:30} { #echo ", %1, " *respawned*; #delitem mobtrack ", %replace( %1, " ", ""), %time( "mmss"), "}")
}


for cmud here is my current attempt since the above is not liked by cmud AT ALL

#IF (!%ismember( %1, @excludeList) and %len( %1) < 25) {
#ADDITEM mobtrack %concat( %replace( %1, " ", ""), %time( "mmss"))
#VAR cur_mob %concat( %replace( %1, " ", ""), %time( "mmss"))
#PRINT @cur_mob "died"
#ALA @cur_mob {+1:30} {
#PRINT %concat( %replace( %1, " ", ""), %time( "mmss")) "*respawned*"
#DELITEM mobtrack %concat( %replace( %1, " ", ""), %time( "mmss"))
}
}

Now what this is doing is evaluating the information at the wrong time
Instead of passing the current value of %1 through and the current timestamp, it waits until the alarm fires and then simply prints the timestamp at that moment and there is no %1


what it should be doing is printing the mob and the time it was killed

ie. BigMeanMob0235 *respawned*

ANY ideas at all how to make it evaluate the %1 and time NOW as it sends it along in an alarm?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Mon Jun 13, 2011 7:56 am   
 
The only way to make it exapand is to imbed it in an #EXEC, but if you are using CMUD, you might be able to go another route.
#WAIT works properly now.
Will this work?

$mob=%concat(%replace(%1, " "), %time(mmss))
#PRINT $mob "died"
#WAIT 90000
#PRINT $mob "*respawned*"
_________________
Discord: Shalimarwildcat
Reply with quote
surge321123
Beginner


Joined: 09 Jun 2011
Posts: 14

PostPosted: Mon Jun 13, 2011 3:56 pm   
 
I suppose I can do it that way. I tried it out and it does work. The only real issue with that has to do with when a mob pops early, the alarm is removed. I have a very similar script written for something else that requires me to remove those alarms. So if anyone has any ideas how I can make this script work using alarms, I'd love any suggestions.

Shalimar, thanks for the input! I think I will use that for the mobtracker.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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