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 Thursday, January 19, 2012, 12:08 AM -->
- <!-- MuClient version 4.80 -->
- <!-- Plugin "StatReporter" generated by Plugin Wizard -->
- <muclient>
- <plugin
- name="StatReporter"
- author="Holliday"
- id="75d65a6a2747fe57f2ac2c46"
- language="Lua"
- purpose="Report stats from max."
- save_state="y"
- date_written="2012-01-19 00:06:14"
- requires="4.80"
- version="1.0"
- >
- <description trim="y">
- <![CDATA[
- repstat [channel]
- ]]>
- </description>
- </plugin>
- <!-- Get our standard constants -->
- <include name="constants.lua"/>
- <!-- Aliases -->
- <aliases>
- <alias
- match="repstat *"
- enabled="y"
- send_to="12"
- sequence="100"
- >
- <send>
- res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char") --- We just want the gmcp.char section.
- luastmt = "gmcpdata = " .. gmcparg --- Convert the serialized string back into a lua table.
- assert (loadstring (luastmt or "")) ()
- require "gmcphelper"
- local str = gmcpval("stats.str")
- local maxstr = gmcpval("maxstats.maxstr")
- local dex = gmcpval("stats.dex")
- local maxdex = gmcpval("maxstats.maxdex")
- local wis = gmcpval("stats.wis")
- local maxwis = gmcpval("maxstats.maxwis")
- local con = gmcpval("stats.con")
- local maxcon = gmcpval("maxstats.maxcon")
- local luck = gmcpval("stats.luck")
- local maxluck = gmcpval("maxstats.maxluck")
- local int = gmcpval("stats.int")
- local maxint = gmcpval("maxstats.maxint")
- local maxhp = gmcpval("maxstats.maxhp")
- local maxmana = gmcpval("maxstats.maxmana")
- local hr = gmcpval("stats.hr")
- local dr = gmcpval("stats.dr")
- local a = "@B"
- local b = "@Y"
- local c = "@w"
- SendNoEcho ("%1 " ..
- a .. "[" .. b .. "Str" .. a .. ": " .. b .. str .. a .."/" .. b .. maxstr .. a .. "] " ..
- a .. "[" .. b .. "Dex" .. a .. ": " .. b .. dex .. a .."/" .. b .. maxdex .. a .. "] " ..
- a .. "[" .. b .. "Con" .. a .. ": " .. b .. con .. a .."/" .. b .. maxcon .. a .. "] " ..
- a .. "[" .. b .. "Int" .. a .. ": " .. b .. int .. a .."/" .. b .. maxint .. a .. "] " ..
- a .. "[" .. b .. "Wis" .. a .. ": " .. b .. wis .. a .."/" .. b .. maxwis .. a .. "] " ..
- a .. "[" .. b .. "Luck" .. a .. ": " .. b .. luck .. a .."/" .. b .. maxluck .. a .. "] " ..
- a .. "HR: " .. b .. hr .. " " ..
- a .. "DR: " .. b .. dr .. " " ..
- a .. "HP: " .. b .. maxhp .. " " ..
- a .. "Mana: " .. b .. maxmana .. " " ..
- a .. "[" .. b .. "Totals" .. a .. ": " .. b .. (dex + str + wis + con + int + luck) .. a .."/" .. b .. (maxdex + maxstr + maxwis + maxcon + maxint + maxluck) .. a .. "] " ..
- "")
- </send>
- </alias>
- <alias
- match="frommax *"
- enabled="y"
- send_to="12"
- sequence="100"
- >
- <send>
- res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char") --- We just want the gmcp.char section.
- luastmt = "gmcpdata = " .. gmcparg --- Convert the serialized string back into a lua table.
- assert (loadstring (luastmt or "")) ()
- require "gmcphelper"
- local lvl = gmcpval("status.level")
- local tier = gmcpval("base.tier")
- local str = gmcpval("stats.str")
- local maxstr = gmcpval("maxstats.maxstr")
- local dex = gmcpval("stats.dex")
- local maxdex = gmcpval("maxstats.maxdex")
- local wis = gmcpval("stats.wis")
- local maxwis = gmcpval("maxstats.maxwis")
- local con = gmcpval("stats.con")
- local maxcon = gmcpval("maxstats.maxcon")
- local luck = gmcpval("stats.luck")
- local maxluck = gmcpval("maxstats.maxluck")
- local int = gmcpval("stats.int")
- local maxint = gmcpval("maxstats.maxint")
- local hr = gmcpval("stats.hr")
- local dr = gmcpval("stats.dr")
- local a = "@B"
- local b = "@Y"
- local c = "@w"
- local maxstats = calcMaxStats(lvl, tier)
- local difstr = maxstats - maxstr
- local difdex = maxstats - maxdex
- local difwis = maxstats - maxwis
- local difcon = maxstats - maxcon
- local difluck = maxstats - maxluck
- local difint = maxstats - maxint
- SendNoEcho ("%1 " ..
- a .. "[" .. b .. "Stats from Max " .. maxstats .. a .. "] " ..
- a .. "[" .. b .. "Str" .. a .. ": " .. b .. difstr .. a .. "] " ..
- a .. "[" .. b .. "Dex" .. a .. ": " .. b .. difdex .. a .. "] " ..
- a .. "[" .. b .. "Con" .. a .. ": " .. b .. difcon .. a .. "] " ..
- a .. "[" .. b .. "Int" .. a .. ": " .. b .. difint .. a .. "] " ..
- a .. "[" .. b .. "Wis" .. a .. ": " .. b .. difwis .. a .. "] " ..
- a .. "[" .. b .. "Luck" .. a .. ": " .. b .. difluck .. a .. "] " ..
- "")
- </send>
- </alias>
- <alias
- match="maxcost *"
- enabled="y"
- send_to="12"
- sequence="100"
- >
- <send>
- res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char") --- We just want the gmcp.char section.
- luastmt = "gmcpdata = " .. gmcparg --- Convert the serialized string back into a lua table.
- assert (loadstring (luastmt or "")) ()
- require "gmcphelper"
- local currentlevel = gmcpval("status.level")
- local currenttier = gmcpval("base.tier")
- local statsTotal = calcMaxStats(currentlevel, currenttier)
- local maxstr = gmcpval("maxstats.maxstr")
- local maxdex = gmcpval("maxstats.maxdex")
- local maxwis = gmcpval("maxstats.maxwis")
- local maxcon = gmcpval("maxstats.maxcon")
- local maxluck = gmcpval("maxstats.maxluck")
- local maxint = gmcpval("maxstats.maxint")
- local a = "@B"
- local b = "@Y"
- local c = "@w"
- local strCost = 0
- local dexCost = 0
- local wisCost = 0
- local intCost = 0
- local conCost = 0
- local luckCost = 0
- strCost = calcMaxCost(statsTotal, maxstr)
- dexCost = calcMaxCost(statsTotal, maxdex)
- wisCost = calcMaxCost(statsTotal, maxwis)
- intCost = calcMaxCost(statsTotal, maxint)
- conCost = calcMaxCost(statsTotal, maxcon)
- luckCost = calcMaxCost(statsTotal, maxluck)
- SendNoEcho ("%1 " ..
- a .. "[" .. b .. "Training cost for max " .. statsTotal .. a .. "] " ..
- a .. "[" .. b .. "Str" .. a .. ": " .. b .. strCost .. a .. "] " ..
- a .. "[" .. b .. "Dex" .. a .. ": " .. b .. dexCost .. a .. "] " ..
- a .. "[" .. b .. "Con" .. a .. ": " .. b .. conCost .. a .. "] " ..
- a .. "[" .. b .. "Int" .. a .. ": " .. b .. intCost .. a .. "] " ..
- a .. "[" .. b .. "Wis" .. a .. ": " .. b .. wisCost .. a .. "] " ..
- a .. "[" .. b .. "Luck" .. a .. ": " .. b .. luckCost .. a .. "] " ..
- "")
- </send>
- </alias>
- <alias
- match="vitalcost * *"
- enabled="y"
- send_to="12"
- sequence="100"
- >
- <send>
- res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char") --- We just want the gmcp.char section.
- luastmt = "gmcpdata = " .. gmcparg --- Convert the serialized string back into a lua table.
- assert (loadstring (luastmt or "")) ()
- require "gmcphelper"
- local curHP = gmcpval("maxstats.maxhp")
- local curMana = gmcpval("maxstats.maxmana")
- local curMoves = gmcpval("maxstats.maxmoves")
- local maxHMM = %2
- local a = "@B"
- local b = "@Y"
- local c = "@w"
- if (maxHMM > 81625) then
- maxHMM = 81625
- end
- HPCost = maxVital(maxHMM, curHP)
- MovesCost = maxVital(maxHMM, curMoves)
- ManaCost = maxVital(maxHMM, curMana)
- SendNoEcho ("%1 " ..
- a .. "[" .. b .. "Training cost for ".. c .. maxHMM .. b .. " vitals " .. a .. "] " ..
- a .. "[" .. b .. "HP" .. a .. ": " .. b .. HPCost .. a .. "] " ..
- a .. "[" .. b .. "Mana" .. a .. ": " .. b .. MovesCost .. a .. "] " ..
- a .. "[" .. b .. "Moves" .. a .. ": " .. b .. ManaCost .. a .. "] " ..
- "")
- </send>
- </alias>
- </aliases>
- <!-- Script -->
- <script>
- function OnPluginBroadcast (msg, id, name, text)
- if (id == '3e7dedbe37e44942dd46d264') then
- if (text == "char.stats" or text == "char.maxstats" or text == "char.vitals" or text == "char.worth" or text == "char.status") then
- res, gmcparg = CallPlugin("3e7dedbe37e44942dd46d264","gmcpval","char") --- We just want the gmcp.char section.
- luastmt = "gmcpdata = " .. gmcparg --- Convert the serialized string back into a lua table.
- assert (loadstring (luastmt or "")) ()
- end
- end
- end -- onpluginbroadcast
- function calcMaxStats (level, tier)
- local level = tonumber(level)
- local tier = tonumber(tier)
- local maxpossible = nil
- if (level <= 70 ) then
- maxpossible = (level + 25) + (tier * 2)
- elseif ((level > 70) and (level <= 155)) then
- maxpossible = 95 + ((level - 70) * 2) + (tier * 2)
- elseif ((level > 155) and (level <= 200)) then
- maxpossible = 265 + ((level - 155) * 3) + (tier * 2)
- elseif (level == 201) then
- maxpossible = 395
- end
- return maxpossible
- end -- calcMaxStats
- function calcMaxCost (maxpossible, current)
- local maxcost = 0
- local currentcount = tonumber(current)
- local possible = tonumber(maxpossible)
- local cost = 0
- if (possible == currentcount) then
- return maxcost
- end
- while (currentcount < possible) do
- if ((currentcount <= 70 ) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 1
- end
- if ((currentcount >= 71) and (currentcount <= 90)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 2
- end
- if ((currentcount >= 91) and (currentcount <= 130) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 3
- end
- if ((currentcount >= 131) and (currentcount <= 170) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 4
- end
- if ((currentcount >= 171) and (currentcount <= 200) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 6
- end
- if ((currentcount >= 201) and (currentcount <= 224) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 9
- end
- if ((currentcount >= 225) and (currentcount <= 250) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 11
- end
- if ((currentcount >= 251) and (currentcount <= 275) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 15
- end
- if ((currentcount >= 276) and (currentcount <= 290) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 17
- end
- if ((currentcount >= 291) and (currentcount <= 300) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 20
- end
- if ((currentcount >= 301) and (currentcount <= 325) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 25
- end
- if ((currentcount >= 326) and (currentcount <= 350) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 35
- end
- if ((currentcount >= 351) and (currentcount <= 375) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 50
- end
- if ((currentcount >= 376) and (currentcount <= 400) and (currentcount <= possible)) then
- currentcount = currentcount + 1
- maxcost = maxcost + 60
- end
- end
- return maxcost
- end -- calcMaxCost
- function maxVital (maxpossible, current)
- local maxcost = 0
- local currentcount = tonumber(current)
- local possible = tonumber(maxpossible)
- local cost = 0
- if (possible == currentcount) then
- return maxcost
- end
- while (currentcount < possible) do
- if ((currentcount <= 10000 ) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 2
- end
- if ((currentcount >= 10001) and (currentcount <= 14000)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 3
- end
- if ((currentcount >= 14001) and (currentcount <= 18000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 4
- end
- if ((currentcount >= 18001) and (currentcount <= 22000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 5
- end
- if ((currentcount >= 22001) and (currentcount <= 26000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 6
- end
- if ((currentcount >= 26001) and (currentcount <= 30000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 7
- end
- if ((currentcount >= 30001) and (currentcount <= 40000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 10
- end
- if ((currentcount >= 40001) and (currentcount <= 50000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 15
- end
- if ((currentcount >= 50001) and (currentcount <= 75000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 20
- end
- if ((currentcount >= 75001) and (currentcount <= 80000) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 25
- end
- if ((currentcount >= 80001) and (currentcount <= 99999) and (currentcount <= possible)) then
- currentcount = currentcount + 10
- maxcost = maxcost + 30
- end
- end
- return maxcost
- end -- maxVital
- </script>
- </muclient>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement