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
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon May 05, 2008 4:41 am   

Help with a trigger
 
You are now guarding Khaliz!


#trigger {You are now guarding (*)!} {#var guardtar %1;#echo {now guarding %1};gsay guarding %1}

You are no longer guarding Khaliz

#trigger {You are no longer guarding (*) {gsay no longer guarding @guardtar} {#clr @guardtar}

The second trigger gsays correctly but i have a status bar

Guarding: @guardtar Target: @Target Group: @Group

that i want to clear when guarding stops. I thought #clr would work but it doesn't seem so, and i've tried setting it as an alias too like:
#alias gd {guard %params}
, then:
#trigger {You are no longer guarding (*)} {gsay no longer guarding @guardtar} {gd " "}
but that doesn't seem to work either, any suggestions on how i can make it clear my status bar when I stop guarding?
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon May 05, 2008 4:50 am   
 
This seems to work, unless someone else has a solution thats better

#trigger {You are no longer guarding (*)} {#echo No longer guarding %1} {#var guardtar " "}
Reply with quote
shalimar
GURU


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

PostPosted: Mon May 05, 2008 6:44 am   
 
im not sure why you are defining the third parameter the way you are, thats supposed to be for the class name

#trigger {You are no longer guarding {@guardtar}} {gsay No longer guarding %pop(guardtar)}
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon May 05, 2008 2:13 pm   
 
Yes, the problem is that, unlike your first trigger, you separated the second line of your value into curly braces. You could use Shalimar's version, or fix your bug like so:

trigger {You are no longer guarding (*)} {#echo No longer guarding %1; #var guardtar ""}
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon May 05, 2008 3:05 pm   
 
Blimey, you guys know how to make a mountain out of a molehill. His problem's simply that he's using the #clr command in a way it wasn't intended to be used (read the docs, Ggoss). He just needs to replace it with #var guardtar "" or guardtar="" and it'll work fine. Finished script:

#trigger {You are now guarding (*)!} {#var guardtar %1;#echo {now guarding %1};gsay guarding %1}
#trigger {You are no longer guarding (*)} {gsay no longer guarding @guardtar;#var guardtar ""}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon May 05, 2008 3:17 pm   
 
I did notice the problem with #clr in his first post, but he fixed that in his second, which is what I was responding to. He still had the problem of putting part of his value string in a separate set of braces.
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon May 05, 2008 7:08 pm   
 
Ok another question, this is with #alarm it doesn't seem to be working right

I have an item that procs this when i say wish, i want it to wait 3 mins and say wish agian

The writhing serpent of miracles tightens around your arm and infuses you with magic.

so trigger should be

#trigger {The writhing serpent of miracles tightens around your arm and infuses you with magic.} {#alarm 3:00;say wish}

but it doesn't seem to be working. I used to use the #wait command, but that seems to be buggy from what i've read here.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon May 05, 2008 7:13 pm   
 
Once again, you've got the syntax all wrong.

Code:
#ALARM 3:00 {#SAY wish}
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon May 05, 2008 10:44 pm   
 
Yes sadly i suck at some triggers, but did notice that after a bit, but still alarm doesn't seem to be firing right. it doesn't seem to fire at all.

i now have the trigger
#alarm 3:00 {say wish}

i actually want to say wish not just say it for my viewing, the item triggers off say wish. Is there a bug with #alarm, because it doesnt seem to be firing at all, i want it to say wish every 3 mins. I've tried it as

#alarm 3:00 {say wish}
and
#alarm -3:00 {say wish}

should i be like
#alarm -0:03:00 {say wish}
Reply with quote
Ggoss
Apprentice


Joined: 01 Nov 2006
Posts: 114

PostPosted: Mon May 05, 2008 11:05 pm   
 
well the last trigger seems to fire every 3 mins now. odd i have to place it that way. But thanks to all that responded.
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Mon May 05, 2008 11:10 pm   
 
-3:00 means "when I've been connected for three minutes", which means it probably won't fire. 3:00 means "every three minutes". You probably mean +3:00, which means "once, in three minutes".

Okay, so I did a bit of testing on this. Seems you need to use *3:00 to mean "every three minutes". 3:00 on its own defaults to "every three hours", which isn't what you want. So you have two options:

#alarm +3:00 {once in three minutes}
#alarm *3:00 {every three minutes}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue May 06, 2008 11:54 am   
 
Weird. Doesn't seem that way in the help files.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue May 06, 2008 1:45 pm   
 
Here is my interpretation of the help files. By my reading:
3:00 means trigger once an hour at 3 minutes after the hour (the equivalent of *:03:00)

+3:00 means trigger once three minutes from now

-3:00 means trigger at 3 minutes after every hour according to the connection time (the equivalent of -*:03:00)

*3:00 means trigger every 3 minutes, when the mod time is 3 minutes. Note that it doesn't mean starting 3 minutes from now, but rather every 3 minutes by the clock, e.g. at XX:00:00, XX:03:00, XX:06:00, ...

The documentation could be improved a bit. But I think a careful reading makes it clear.
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