Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Disable Triggers with Plugin?

Disable Triggers with Plugin?

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Adamantplatypus   (9 posts)  Bio
Date Wed 08 Jun 2011 08:12 PM (UTC)

Amended on Wed 08 Jun 2011 08:21 PM (UTC) by Adamantplatypus

Message
My MUD has an hours code. Thusly, you are not allowed to use any triggers or scripts that keep you from disappearing into the void and disconnecting....if you're not phsycially at the computer and able to respond in a reasonable amount of time. Clarifying: It IS legal, IF you're at the keyboard and able to respond when the immortals ping you.

Since there are a lot of in-game reasons to idle while doing things in another window, I DO have a trigger for voiding, but I'm INCREDIBLY bad at forgetting to turn my triggers OFF if I'm going to leave the computer -which can get me denied (it sends 'look' or 'i' when I void).

I just downloaded the AFK plug in, which will mark me as afk after a certain time period. Is there any way to alter it so that it will disable my triggers when it kicks on, as well?

I'd also like it to be like 2 minutes before it fires, but I'm not sure how to alter the plugin - that's really no big deal, I don't expect anyone to do extra work for me, if they aren't inclined/want to.

Thanks for any help you can provide, even if there isn't a way to get it done. :)
Top

Posted by Candido   USA  (78 posts)  Bio
Date Reply #1 on Wed 08 Jun 2011 08:24 PM (UTC)
Message
This is a hack, but if you have a script prefix, let' say '/', you can do Execute([[/EnableGroup("keepalive", 0)]]). You can do similar with send to script aliases.

I wish you could do CallPlugin("", "x") to call functions in the main script, like you can do GetPluginVariable("","x") to get world variables, but sadly it's not the case.
Top

Posted by Adamantplatypus   (9 posts)  Bio
Date Reply #2 on Wed 08 Jun 2011 08:28 PM (UTC)
Message
Mmm! Yeah! *nods* Makes sense.

Or it might. Except I have no idea how to do any of that. Hahahah!
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #3 on Thu 09 Jun 2011 01:04 AM (UTC)

Amended on Thu 09 Jun 2011 01:05 AM (UTC) by Nick Gammon

Message
I'm not sure which AFK plugin you are referring to, but if it is the one called "AFK_timer" and if it has this in it:



<timers>
  <timer name="afk_timer" 
         second="&timer_secs;"  
         minute="&timer_mins;"  
         send_to="12"    
         enabled="y"
>
  <send>
    ColourNote ("salmon", "", "You are now AFK.")
    Send ("&afk_command;")
    EnableTimer ("afk_timer", 0)
  </send>
  </timer>
</timers>


Then you could add another line (in bold) to disable all triggers:



<timers>
  <timer name="afk_timer" 
         second="&timer_secs;"  
         minute="&timer_mins;"  
         send_to="12"    
         enabled="y"
>
  <send>
    ColourNote ("salmon", "", "You are now AFK.")
    Send ("&afk_command;")
    EnableTimer ("afk_timer", 0)
    SetOption("enable_triggers", 0)
  </send>
  </timer>
</timers>


And further down, when you type something, change this:


-- shared routine to handle turning AFK off

function FixTimer ()
  if GetTimerOption ("afk_timer", "enabled") == 0 then
    ColourNote ("salmon", "", "You are no longer AFK.")
  end

-- turn timer back on
  EnableTimer ("afk_timer", 1)

-- make sure the full time interval elapses
  ResetTimer ("afk_timer")

end


... to add this (in bold):


-- shared routine to handle turning AFK off

function FixTimer ()
  if GetTimerOption ("afk_timer", "enabled") == 0 then
    ColourNote ("salmon", "", "You are no longer AFK.")
  end

-- turn timer back on
  EnableTimer ("afk_timer", 1)

-- make sure the full time interval elapses
  ResetTimer ("afk_timer")

-- enable triggers
  SetOption("enable_triggers", 1)
end

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Thu 09 Jun 2011 01:06 AM (UTC)
Message
Adamantplatypus said:

I'd also like it to be like 2 minutes before it fires, but I'm not sure how to alter the plugin ...


Change these lines near the start:


  <!ENTITY timer_mins "5" > 
  <!ENTITY timer_secs "0" > 


(Change the 5 to 2, for example).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Adamantplatypus   (9 posts)  Bio
Date Reply #5 on Thu 09 Jun 2011 02:26 AM (UTC)

Amended on Thu 09 Jun 2011 03:08 AM (UTC) by Adamantplatypus

Message
EDIT: YAAY! I figured out my problem, I had to enable timers. DUH.

Thank you so much for your help, guys, especially Nick! I appreciate it!
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,541 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.