Advertisement
Tetrikitty

Untitled

Mar 14th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient [
  3. <!ENTITY afk_command "afk" >
  4. <!ENTITY timer_mins "4" >
  5. <!ENTITY timer_secs "30" >
  6. ]>
  7.  
  8. <!-- Saved on Saturday, October 08, 2005, 10:37 AM -->
  9. <!-- MuClient version 3.66 -->
  10.  
  11. <!-- Plugin "AFK_timer" generated by Plugin Wizard -->
  12.  
  13. <muclient>
  14. <plugin
  15. name="AFK_timer"
  16. author="Nick Gammon"
  17. id="4d167d47cac26fb36e161e48"
  18. language="Lua"
  19. purpose="Sends AFK to the MUD when 5 minutes elapse"
  20. date_written="2005-10-08 10:32:50"
  21. requires="3.52"
  22. version="1.0"
  23. >
  24. <description trim="y">
  25. <![CDATA[
  26. After the specified interval (default 5 minutes) elapse, sends "afk" to the MUD.
  27. ]]>
  28. </description>
  29.  
  30. </plugin>
  31.  
  32. <!-- Timers -->
  33.  
  34. <timers>
  35. <timer name="afk_timer"
  36. second="&timer_secs;"
  37. minute="&timer_mins;"
  38. send_to="12"
  39. enabled="y"
  40. >
  41. <send>
  42. ColourNote ("salmon", "", "You are now AFK.")
  43. WindowShow(GetPluginID (), true);
  44. EnableTimer ("afk_timer", 0)
  45. </send>
  46. </timer>
  47. </timers>
  48.  
  49. <!-- Script -->
  50.  
  51. <script>
  52. <![CDATA[
  53.  
  54. -- when they type something, reset AFK status
  55.  
  56. function OnPluginCommand (sText)
  57. FixTimer ()
  58. return true -- process the command
  59. end
  60.  
  61. -- when you connect to the MUD, presumably you are not AFK
  62.  
  63. function OnPluginConnect ()
  64. FixTimer ()
  65. end
  66.  
  67. -- shared routine to handle turning AFK off
  68.  
  69. function FixTimer ()
  70. WindowCreate(GetPluginID (), 0, 0, 500, 500, 12, 1, #000000);
  71. WindowFont(GetPluginID (), "font1", "Arial", 40, false, false, false, false, 1, 0);
  72. WindowText(GetPluginID (), "font1", "Idle", 0, 0, 0, 0, #FF9999, true);
  73. if GetTimerOption ("afk_timer", "enabled") == 0 then
  74. ColourNote ("salmon", "", "You are no longer idle.")
  75. end
  76.  
  77. -- turn timer back on
  78. EnableTimer ("afk_timer", 1)
  79.  
  80. -- make sure the full time interval elapses
  81. ResetTimer ("afk_timer")
  82.  
  83. WindowShow(GetPluginID (), false);
  84.  
  85. end
  86. ]]>
  87. </script>
  88.  
  89. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement