Disable Triggers with Plugin?

Posted by Adamantplatypus on Wed 08 Jun 2011 08:12 PM — 6 posts, 23,202 views.

#0
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. :)
Amended on Wed 08 Jun 2011 08:21 PM by Adamantplatypus
USA #1
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.
#2
Mmm! Yeah! *nods* Makes sense.

Or it might. Except I have no idea how to do any of that. Hahahah!
Australia Forum Administrator #3
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
Amended on Thu 09 Jun 2011 01:05 AM by Nick Gammon
Australia Forum Administrator #4
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).
#5
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!