Advertisement
Guest User

Untitled

a guest
Feb 28th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 5.69 KB | None | 0 0
  1. This XML file does not appear to have any style information associated with it. The document tree is shown below.
  2. <muclient>
  3. <plugin name="Auto_Quaff" author="Abelinc" id="91db3f0b6bb87464ca75f5c7" language="Lua" purpose="Quaffs potions if in battle and health falls below preset limit" date_written="2010-02-26" requires="4.00" version="1.01" save_state="y">
  4. <description trim="y">
  5. <![CDATA[
  6. Install this plugin to automatically quaff a potion when your health falls below a preset limit. autoquaff --> Displays the current values of variables autoquaff bag <bagname> --> Sets what container to get potions from autoquaff potion <potname> --> Sets what potion to quaff autoquaff percent # --> Sets what percent you must fall below to quaff autoquaff count # --> Sets how many consecutive rounds the plugin will quaff before skipping a round autoquaff on/off --> Turns the actions of the plugin on or off
  7. ]]>
  8. </description>
  9. </plugin>
  10. <!--   configure quaffing limits  -->
  11. <aliases>
  12. <alias name="autoquaff" script="autoquaff_settings" match="^autoquaff ?(percent|count|potion|bag|on|off|help)?( [a-z0-9]+)?" enabled="y" regexp="y" ignore_case="y" sequence="100"></alias>
  13. </aliases>
  14. <script>
  15. <![CDATA[
  16. require "checkplugin" function OnPluginBroadcast (msg, id, name, text) if msg == 1 and id == "8a710e0783b431c06d61a54c" then
  17. -- get all variables
  18. stats = GetPluginVariableList("8a710e0783b431c06d61a54c")
  19. do_autoquaff () end
  20. -- stats changed end function do_autoquaff () if (os.time () - autoquaff_lastfired) > 3
  21. then if autoquaff_enable == "yes"
  22. then if stats.position ~= "4" then autoquaff_currcount = 0
  23. end
  24. if stats.position == "4" then if tonumber (stats.hp_percent) < tonumber (autoquaff_percent)
  25. then if tonumber (autoquaff_currcount) < tonumber (autoquaff_count) then
  26. Send ("g" .. autoquaff_potion .. autoquaff_bag) Send ("quaff" .. autoquaff_potion) autoquaff_currcount = autoquaff_currcount + 1 ColourNote ("yellow", "", "Ack! We're dying! Quaff! Quaff! currcount is now " .. autoquaff_currcount) autoquaff_lastfired = os.time ()
  27. else autoquaff_currcount = 0 ColourNote ("yellow", "", "We already quaffed to much, so didn't fire. We set currcount to" .. autoquaff_currcount) autoquaff_lastfired = os.time ()
  28. end
  29. else
  30. -- ColourNote ("yellow", "", "We've got plenty of health. No need to fire") autoquaff_currcount = 0
  31. end
  32. end
  33. end
  34. end
  35. end
  36.  
  37. -- do_autoquaff function autoquaff_settings (name, line, wildcards)
  38. if wildcards [1] == "" then autoquaff_tellme () elseif wildcards [1] == "on" then autoquaff_enable = "yes" ColourNote ("yellow", "", "Autoquaff plugin enabled.")
  39. elseif wildcards [1] == "off" then autoquaff_enable = "no" ColourNote ("yellow", "", "Autoquaff plugin disabled.") elseif wildcards [1] == "help" then autoquaff_help ()
  40. else if wildcards [2] == false then ColourNote ("yellow", "", "You need to provide a value.") end if wildcards [1] == "potion" then autoquaff_potion = wildcards [2]
  41. elseif wildcards [1] == "bag" then autoquaff_bag = wildcards [2]
  42. elseif tonumber (wildcards [2]) > 99 then ColourNote ("yellow", "", "Try a smaller value.")
  43. else if wildcards [1] == "percent" then autoquaff_percent = tonumber (wildcards [2]) ColourNote ("yellow", "", "We just set autoquaff_percent to " .. autoquaff_percent)
  44. elseif wildcards [1] == "count" then autoquaff_count = tonumber (wildcards [2]) ColourNote ("yellow", "", "We just set autoquaff_count to " .. autoquaff_count)
  45. end
  46. end
  47. end
  48. end
  49.  
  50. -- autoquaff_settings function autoquaff_tellme (name, line, wildcards)
  51. ColourNote ("yellow", "", "autoquaff_percent is currently " .. autoquaff_percent)
  52. ColourNote ("yellow", "", "autoquaff_count is currently " .. autoquaff_count)
  53. ColourNote ("yellow", "", "autoquaff_potion is currently " .. autoquaff_potion)
  54. ColourNote ("yellow", "", "autoquaff_bag is currently " .. autoquaff_bag)
  55. ColourNote ("yellow", "", "autoquaff_enable is currently " .. autoquaff_enable)
  56. end
  57.  
  58. function autoquaff_help (name, line, wildcards)
  59. ColourNote ("teal", "", world.GetPluginInfo (world.GetPluginID (), 3))
  60. return true
  61. -- done
  62. end
  63.  
  64. -- autoquaff_help function OnPluginInstall () if GetVariable ("enabled") == "false"
  65. then ColourNote ("yellow", "", "Warning: Plugin " .. GetPluginName ().. " is currently disabled.") check (EnablePlugin(GetPluginID (), false)) return
  66. end
  67.  
  68. -- they didn't enable us last time OnPluginEnable ()
  69. -- do initialization stuff
  70. end
  71.  
  72. -- OnPluginInstall
  73. function OnPluginEnable () checkplugin ("8a710e0783b431c06d61a54c", "Stats_Detector.xml")
  74. if GetVariable ("autoquaff_count") == nil then
  75. SetVariable ("autoquaff_count", tonumber(1))
  76. end
  77.  
  78. autoquaff_count = GetVariable ("autoquaff_count")
  79. if GetVariable ("autoquaff_percent") == nil then
  80. SetVariable ("autoquaff_percent", tonumber(30))
  81. end
  82.  
  83. autoquaff_percent = GetVariable ("autoquaff_percent")
  84. if GetVariable ("autoquaff_potion") == nil then
  85. SetVariable ("autoquaff_potion", "jade")
  86. end autoquaff_potion = GetVariable ("autoquaff_potion") if GetVariable ("autoquaff_bag") == nil then
  87. SetVariable ("autoquaff_bag", "bag")
  88. end
  89.  
  90. autoquaff_bag = GetVariable ("autoquaff_bag") if GetVariable ("autoquaff_enable") == nil then
  91. SetVariable ("autoquaff_enable", "yes")
  92. end
  93.  
  94. autoquaff_enable = GetVariable ("autoquaff_enable") autoquaff_lastfired = os.time ()
  95. end
  96.  
  97. -- OnPluginEnable function OnPluginSaveState ()
  98. SetVariable ("enabled", tostring (GetPluginInfo (GetPluginID (), 17)))
  99. SetVariable ("autoquaff_percent", autoquaff_percent)
  100. SetVariable ("autoquaff_count", autoquaff_count)
  101. SetVariable ("autoquaff_potion", autoquaff_potion)
  102. SetVariable ("autoquaff_bag", autoquaff_bag)
  103. SetVariable ("autoquaff_enable", autoquaff_enable)
  104. end
  105.  
  106. -- OnPluginSaveState
  107. ]]>
  108. </script>
  109. </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement