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
Shinsei
Newbie


Joined: 27 Apr 2019
Posts: 2

PostPosted: Sat Apr 27, 2019 4:55 pm   

Alarm Reset Issue
 
I'm attempting to get the following anti idle script to work, slightly adjusted from source:
http://forums.zuggsoft.com/forums/viewtopic.php?t=38537

<trigger type="Command Input" priority="3660" trigontrig="false" id="366">
<pattern>(*)</pattern>
<value>#VARIABLE afktimer %ctime
#MATH checktime (@afktimer+200)
#ALARM "antiafk" {+200} {
#IF (%ctime=@checktime) {
#SHOW %ansi(green)***********Anti Idle***********
look
}
} {AntiAFK}</value>
</trigger>

On execution, it creates the following Alarm:
<pattern>+200</pattern>
<value>#IF (%ctime=@checktime) {
#SHOW %ansi(green)***********Anti Idle***********
look
}</value>
</trigger>

The issue is, the alarm will work the first time but not any subsequent time. If I check the values of %ctime and @checktime, they're set to the correct values (%ctime is 200 less than @checktime immediately after execution). If I add #UNTRIGGER antiafk before the declaration of afktimer, it will work every time, but echos an informational message of "Trigger {antiafk} removed to the screen after each command is sent to the MUD.

It looks like the alarm doesn't get reset after each input unless I explicitly delete the alarm every time it captures input. Is there a way to force the refresh without having to delete/create the alarm each time, or do I just settle for the workaround and disable information messages in CMUD?
Reply with quote
shalimar
GURU


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

PostPosted: Sat Apr 27, 2019 8:51 pm   
 
The issue i am finding is that by the time it fires
%ctime > @checktime

I have to wonder why you are bothering with variables here at all though, unless they are being used elsewhere, you could simplify this to:

#ONINPUT {*} {#ALARM "antiAFK" +200 {#SHOW {%ansi(green)***********Anti Idle***********};look} {AntiAFK}}
_________________
Discord: Shalimarwildcat
Reply with quote
Shinsei
Newbie


Joined: 27 Apr 2019
Posts: 2

PostPosted: Sat Apr 27, 2019 9:05 pm   
 
Hmm, that is infinitely simpler and easier on processing time than the other version. I'm still wrapping my head around alarms for some reason.

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