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
Mike Z Red
Beginner


Joined: 11 Jun 2004
Posts: 11
Location: USA

PostPosted: Fri Jun 18, 2004 1:59 pm   

connect trigger?
 
I'm trying to set a trigger to fire one time, shortly after I connect (to setup windows each time, initialize functions/variables, etc.)

I've tried:
#ALARM -0:00:05 {#ECHO Fired at -0:00:05}
And I get "Fired at -0:00:05" in pretty cyan every 5 seconds.
So I tried
#ALARM -00:00:05 {#ECHO Fired at -00:00:05}
And I get "Fired at -00:00:05" in pretty cyan every 5 seconds.

I thought recurring triggers were setup like
#ALARM *:*:05 {#ECHO Firing every 5 secs, get used to seeing this text.}
and that times specified as -hh:mm:ss fired ONCE, when the connect time is hh:mm:ss.

Trying to debug, I figured I'd try something more than 5seconds, maybe it's just a fluke thing with such a small period. So I did
#ALARM -00:04:45 {#ECHO Fired at -00:04:45.}

At first it seemed to work, when my connect time said 0:04:45, I saw "Fired at -00:04:45" (again, in pretty cyan). I waited, and when my connect time said 0:09:30 (2 times 4:45), nothing happened.
Then the connect time rolled around to something like 0:11:15 and "Fired at -00:04:45" appeared in pretty cyan AGAIN.

Summarizing, 2 questions:
1- What am I doing wrong to create a trigger that only fires once, after being connected for a certain amount of time? (Don't want to delete the trigger, though.)

2- My primary goal is to approximate an 'On Connect()' event. Is there a better way than an #ALARM ?

Dunno if it's relevant, but I'm in zMUD 7.05

Thanks in advance.
Reply with quote
chris74269
Novice


Joined: 26 Mar 2003
Posts: 40

PostPosted: Fri Jun 18, 2004 2:58 pm   
 
personally, to do this i add whatever commands i want to do at login to my autologin with my password. however, to make a one time trigger you want to use #TEMP {pattern} {command}
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Fri Jun 18, 2004 3:15 pm   
 
If I'm understanding right, you want to initialize once after connecting, right? I'd just put the initialization in the alias "atconnect" (in the System class by default, I believe). If it has to happen 5 seconds after connecting or whatever, still set it up in the atconnect alias, but use "#ALA +5 {init strings}".

Using "#ALA -5 {command}" will fire every 5 seconds after connection, and that's intentional. If you insist on using an alarm like this, then give it a name, and disable it as the last command. i.e. "#ALA Init -5 {init strings;#T- Init}". With this method, you'll have to toss the command "#T+ Init" into either the alias atconnect or atdisconnect, so that it will be active next time you connect.
Reply with quote
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Fri Jun 18, 2004 3:17 pm   
 
And BTW, the pretty cyan color is the default for zMUD info messages. If you want to change it, either change that color in the Prefs, or set up another trigger to highlight that output a different color.
Reply with quote
Mike Z Red
Beginner


Joined: 11 Jun 2004
Posts: 11
Location: USA

PostPosted: Fri Jun 18, 2004 7:16 pm   
 
atconnect . . . beautiful!

Thanks, guys!
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