Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE muclient>
- <!-- Saved on sobota, listopad 09, 2013, 9:39 -->
- <!-- MuClient version 4.89 -->
- <!-- Plugin "HourDouble" generated by Plugin Wizard -->
- <muclient>
- <plugin
- name="HourDouble"
- author="Divlia"
- id="f6db3901f93ddacfa45549f1"
- language="Lua"
- purpose="Predicts an hour double"
- date_written="2013-11-09 09:37:31"
- requires="4.73"
- version="1.0"
- save_state="y"
- >
- </plugin>
- <!-- Get our standard constants -->
- <include name="constants.lua"/>
- <!-- Triggers -->
- <triggers>
- <trigger
- enabled="n"
- group="gamestat"
- send_to="12"
- sequence="100"
- match="eog"
- omit_from_output="y"
- >
- <send>
- EnableTriggerGroup ("gamestat", 0)
- </send>
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="------------- AARDWOLF MUD ACTIVITY MONITOR ---------"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="-------------------------------------------------------"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match=" ------------ -----------"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match=" Since Reboot Since Added"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="'Since added' shows totals since 29th August 1997."
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="New Players : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Deletions : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Levels Gained : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Player Deaths : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Number of Wars : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Warfare Deaths : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Combat Maze Kills: *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Number of Logins : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Most Online : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Notes Posted : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Quests Taken : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Quests Completed : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Quests Failed : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Total QP Given : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Campaigns Done : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Campaigns Failed : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="^Mob\sDeaths\s+\:\s+([0-9,]+)\s+([0-9,]+)$"
- name="MobDeaths"
- omit_from_log="y"
- script="predict"
- regexp="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Triv Mobs Killed : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Total Auctions : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Auctions Sold : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Auctions Unsold : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="Marriages : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="New Nobles : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="New Superheroes : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- group="gamestat"
- match="New Remorts : *"
- omit_from_output="y"
- sequence="100"
- >
- </trigger>
- </triggers>
- <!-- Aliases -->
- <aliases>
- <alias
- match="hourdbl"
- enabled="y"
- send_to="12"
- sequence="100"
- >
- <send>
- EnableTriggerGroup ("gamestat", 1)
- SendNoEcho("gamestat 5")
- Send ("echo eog")
- </send>
- </alias>
- <alias
- match="hourdbl set"
- enabled="y"
- send_to="12"
- sequence="100"
- script="set"
- >
- </alias>
- <alias
- match="hourdbl gt"
- enabled="y"
- send_to="12"
- sequence="100"
- script="gt"
- >
- </alias>
- <alias
- match="hourdbl short"
- enabled="y"
- send_to="12"
- sequence="100"
- script="short"
- >
- </alias>
- <alias
- match="hourdbl spamm *"
- enabled="y"
- send_to="12"
- sequence="100"
- script="spamm"
- >
- </alias>
- </aliases>
- <!-- Timers -->
- <timers>
- <timer
- name="tim_init_plugin"
- script="init_plugin"
- enabled="y"
- second="1">
- </timer>
- </timers>
- <!-- Script -->
- <script>
- <![CDATA[
- local smobs = "0"
- local stime = 0
- local init_called = 0
- function spamm (name, line, wildcards)
- SetVariable ("mins", wildcards[1])
- if GetVariable ("mins") == "" then
- SetVariable ("mins", "0")
- end
- if (tonumber(GetVariable ("mins")) < 0) or (tonumber(GetVariable ("mins")) > 59) then
- SetVariable ("mins", "0")
- ColourNote("darkorange", "", "Mins are 0-59.")
- end
- ColourNote("darkorange", "", "Spamming every x mins (type 'hourdbl spamm <mins>' to set) "..GetVariable ("mins"))
- CreateTimer()
- end
- function gt()
- if GetVariable ("gt") == "0" then
- SetVariable ("gt", "1")
- ColourNote("darkorange", "", "Reporting on gt? (type 'hourdbl gt' to toggle) YES")
- else
- SetVariable ("gt", "0")
- ColourNote("darkorange", "", "Reporting on gt? (type 'hourdbl gt' to toggle) NO")
- end
- end
- function short()
- if GetVariable ("short") == "0" then
- SetVariable ("short", "1")
- ColourNote("darkorange", "", "Short version? (type 'hourdbl short' to toggle) YES")
- else
- SetVariable ("short", "0")
- ColourNote("darkorange", "", "Short version? (type 'hourdbl short' to toggle) NO")
- end
- end
- function set()
- if GetVariable ("gt") == "1" then
- ColourNote("darkorange", "", "Reporting on gt? (type 'hourdbl gt' to toggle) YES")
- else
- ColourNote("darkorange", "", "Reporting on gt? (type 'hourdbl gt' to toggle) NO")
- end
- if GetVariable ("short") == "1" then
- ColourNote("darkorange", "", "Short version? (type 'hourdbl short' to toggle) YES")
- else
- ColourNote("darkorange", "", "Short version? (type 'hourdbl short' to toggle) NO")
- end
- ColourNote("darkorange", "", "Spamming every x mins (type 'hourdbl spamm <mins>' to set) "..GetVariable ("mins"))
- end
- function init_plugin()
- if init_called == 0 then
- Execute("sendgmcp request char")
- local localchar = char_status
- if (localchar ~= nil and tonumber(localchar.state) == 3) then
- init_called = 1
- EnableTimer("tim_init_plugin", false)
- Execute("hourdbl")
- end
- end
- end
- function OnPluginBroadcast (msg, id, name, text)
- if text == "char.status" then
- res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char.status")
- luastmt = "gmcpdatacharstatus = " .. gmcparg
- assert (loadstring (luastmt or "")) ()
- char_status = gmcpdatacharstatus
- end
- end
- function predict (name, line, wildcards)
- wildcards[1] = wildcards[2]:gsub(",", "")
- for w in string.gfind (wildcards[1], "%w+") do
- cmobs = w
- break
- end
- if smobs == "0" then
- smobs = cmobs
- stime = os.time ()
- if GetVariable ("mins") ~= "0" then
- CreateTimer()
- end
- else
- time_duration = math.abs(os.difftime (stime, os.time ()))
- time_dd = (math.floor(math.abs(time_duration/86400)))
- time_hh = (math.floor(math.abs((time_duration/3600)-(time_dd*24))))
- time_mm = (math.floor(math.abs((time_duration/60)-(time_dd*1440)-(time_hh*60))))
- time_mmfull = (math.floor(math.abs((time_duration/60))))
- time_ss = time_duration-(time_mmfull*60)
- rate = (tonumber(cmobs)-tonumber(smobs)) / time_duration
- mobsleft = math.ceil(cmobs / 1000000)*1000000 - cmobs
- timeleft = math.ceil(mobsleft / rate)
- timel_dd = (math.floor(math.abs(timeleft/86400)))
- timel_hh = (math.floor(math.abs((timeleft/3600)-(timel_dd*24))))
- timel_mm = (math.floor(math.abs((timeleft/60)-(timel_dd*1440)-(timel_hh*60))))
- timel_mmfull = (math.floor(math.abs((timeleft/60))))
- timel_ss = timeleft-(timel_mmfull*60)
- stimeleft = ""
- if timel_dd ~= 0 then
- stimeleft = stimeleft.." "..timel_dd.." days"
- end
- if timel_hh ~= 0 then
- stimeleft = stimeleft.." "..timel_hh.." hours"
- end
- if timel_mm ~= 0 then
- stimeleft = stimeleft.." "..timel_mm.." minutes"
- end
- if timel_ss ~= 0 then
- stimeleft = stimeleft.." "..timel_ss.." seconds"
- end
- if GetVariable ("short") == "0" then
- timepassed = ""
- if time_dd ~= 0 then
- timepassed = timepassed..time_dd.." days "
- end
- if time_hh ~= 0 then
- timepassed = timepassed..time_hh.." hours "
- end
- if time_mm ~= 0 then
- timepassed = timepassed..time_mm.." minutes "
- end
- if time_ss ~= 0 then
- timepassed = timepassed..time_ss.." seconds "
- end
- msg = "In "..timepassed.."we killed "..tonumber(cmobs)-tonumber(smobs).." monsters with a rate of "..string.format("%.2f", rate).." per second. To reach an hour double we still need to kill "..
- string.format("%i", mobsleft).." monsters and it will take us"..stimeleft.."."
- else
- msg = "An hour double will occur in"..stimeleft.."."
- end
- if GetVariable ("gt") == "0" then
- ColourNote("darkorange", "", msg)
- else
- SendNoEcho("gt @G"..msg)
- end
- end
- end
- function OnPluginInstall ()
- ColourNote("darkorange", "", "HourDouble installed. Type 'hourdbl' to predict or 'hourdbl set' for options.")
- if GetVariable ("short") == nil then
- SetVariable ("short", "1")
- end
- if GetVariable ("gt") == nil then
- SetVariable ("gt", "0")
- end
- if GetVariable ("mins") == nil then
- SetVariable ("mins", "0")
- end
- end
- function timerfunc()
- Execute("hourdbl")
- end
- function CreateTimer()
- DeleteTimer("hourdbltimer")
- if (tonumber(GetVariable ("mins")) > 0) or (tonumber(GetVariable ("mins")) <= 59) then
- AddTimer("hourdbltimer", 0, tonumber(GetVariable ("mins")), 0, "", timer_flag.Enabled, "timerfunc")
- end
- end
- ]]>
- </script>
- </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement