Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Message
| The plugin below helps you work out how much time it will take to level on Aardwolf. It uses the Stats Detector plugin described in this thread:
http://www.gammon.com.au/forum/?id=8776
That plugin lets us know who we have been fighting, and how much XP we need to level.
As an example of its output, after killing a mob, which yields experience, you see a line like this:
To level: 977 XP (18 m) 20 avg kills. (3,183 XP/hour)
later:
To level: 763 XP (7 m) 13 avg kills. (6,598 XP/hour)
then:
To level: 136 XP (3 m) 3 avg kills. (3,183 XP/hour)
It effectively estimates, from the time you took to kill the last 5 mobs and how much XP you got, how many more it will take to level, and how long that will take. Of course, you can throw the calculations out by stopping fighting, dying, fighting different level mobs, or fighting faster. However for normal "grinding" your way through a batch of mobs, it should be fairly accurate.
The XP/hour figure is intended to evaluate the "quality" of the area you are in. If you are getting low XP/hour you might consider moving to an area that gives better experience.
Options:
- Type "xp" to see a summary of what you have killed:
Killed: (A black manta ray) x2, (A bloody squid) x1, (A blue crab) x4, (A blue jellyfish) x2, (A cobia) x5, (A large mosquito) x1, (A red crab) x8, (A small mosquito) x2, (A tiny mosquito) x13, (A white jellyfish) x1, (A yellow trogon) x3, (An angry gorilla) x1, (Bluefish) x2, (Bone fish) x4, (Sand dollar) x2
51 mobs killed, 15 different mob types
To level: 977 XP (18 m) 20 avg kills. (3,183 XP/hour)
I can see from that what I have been doing recently, and how many of each I killed.
- Type "xp reset" to reset the timings from the last 5 mobs. You would usefully do this if you have been resting, or recalled for healing or selling things. Otherwise, the time calculations will be wrong because they will include rest time.
- Type "xp reset all" to reset all calculations, including lists of mobs. Do this to start again from scratch.
To use it, download the code below and save as Exp_gain.xml in the Aardwolf subdirectory below your Plugins directory. If you haven't used any Aardwolf plugins before you may need to make the Aardwolf directory.
Alternatively, RH click the link below and choose "Save Link As" (or "Save Linked File As") to save the linked file.
http://www.gammon.com.au/mushclient/plugins/Aardwolf/Exp_gain.xml
This plugin also uses the "stats detector" plugin, so you also need this file:
http://www.gammon.com.au/mushclient/plugins/Aardwolf/Stats_Detector.xml
The "Stats detector" plugin uses telnet negotation, so you also need this file:
http://www.gammon.com.au/mushclient/plugins/Aardwolf/telnet_options.lua
In a standard MUSHclient installation these three files should to into this directory:
C:\Program Files\MUSHclient\worlds\plugins\Aardwolf\
Configuration
Change the line below which reads:
local MAXAVERAGE = 5
... to some other figure, to have it calculate average experience and time over more or less mobs (for example, 10 might be a reasonable figure to use).
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, July 11, 2008, 5:43 PM -->
<!-- MuClient version 4.33 -->
<!-- Plugin "XP_gain" generated by Plugin Wizard -->
<muclient>
<plugin
name="Exp_gain"
author="Nick Gammon"
id="e34c9929c87f4f77c24d6687"
language="Lua"
purpose="Estimates time to level based on recent kills"
date_written="2008-07-11 17:41:42"
requires="4.33"
version="1.0"
>
<description trim="y">
<![CDATA[
xp - show names and counts of mobs we killed
xp reset - resets "recent kills" table, use when starting a new killing session
xp reset all - same as "xp reset" plus it removes the list of mobs killed
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="^You receive (\d+) experience points?\.$"
regexp="y"
script="mobdied"
sequence="100"
>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
script="xp_alias"
match="^xp( reset| reset all)?$"
enabled="y"
regexp="y"
sequence="100"
>
</alias>
</aliases>
<!-- Script -->
<script>
<![CDATA[
local MAXAVERAGE = 5 -- max to keep for averages
local xp_table = {}
local mobs = {} -- table of mobs killed
require "commas"
local function plural (count)
if count ~= 1 then
return "s"
else
return ""
end -- if
end -- function plural
function show_calcs ()
stats = GetPluginVariableList("8a710e0783b431c06d61a54c")
if not stats then return end
level = tonumber (stats.level)
xptogo = tonumber (stats.to_level)
local tablesize = #xp_table
-- work out average
local total = 0
for _, v in ipairs (xp_table) do
total = total + v.xpgain
end -- for loop
local av_xp = total / tablesize
if tablesize <= 1 then
return
end
local elapsed = xp_table [#xp_table].time - xp_table [1].time -- time it took to do those kills
kills = math.ceil (xptogo / av_xp)
local time_to_go = (xptogo / av_xp) * elapsed / (tablesize - 1)
local xp_per_hour = av_xp / elapsed * 60 * 60 * (tablesize - 1)
if xp_per_hour < 1 then
return
end -- if
ColourNote ("magenta", "",
string.format ("To level: %s XP (%s) %i avg kills. (%s XP/hour)",
commas (xptogo),
convert_time (time_to_go),
kills,
commas (string.format ("%i", xp_per_hour))
)) -- blue
end -- show_calcs
function mobdied (name, line, wildcards)
stats = GetPluginVariableList("8a710e0783b431c06d61a54c")
if not stats then return end
level = tonumber (stats.level)
xpgain = tonumber (wildcards [1])
xptogo = tonumber (stats.to_level) - xpgain
mob = stats.last_enemy
if not mob then return end
-- remember mob count
mobs [mob] = (mobs [mob] or 0) + 1
local kills = math.ceil (xptogo / xpgain) -- how many such kills that is
if xptogo <= 0 then
return
end -- if levelling right now!
if last_kill_time then
secs_since_last_kill = os.time () - last_kill_time
end -- not first kill
last_kill_time = os.time ()-- remember for next time
-- remember details
local thiskill = {
mob = mob,
xpgain = xpgain,
time = last_kill_time,
} -- end of thiskill table
if #xp_table >= MAXAVERAGE then
table.remove (xp_table, 1) -- remove oldest one
end -- of table full
table.insert (xp_table, thiskill) -- new item
show_calcs ()
end -- trigger: mobdied function
function xp_alias (name, line, wildcards)
msg = trim ( string.lower (wildcards [1] or ""))
if msg == "reset all" then
mobs = {}
Note ("XP gain mob history reset.")
end -- if reset all
if msg == "reset" or msg == "reset all" then
xp_table = {}
last_xp_amount = nil
Note ("XP gain calculations reset.")
return
end -- if reset
Tell ("Type ")
Hyperlink ("xp reset", "", "", "yellow", "")
Tell (" to reset calculations, ")
Hyperlink ("xp reset all", "", "", "yellow", "")
Note (" to reset everything.")
-- if any mobs killed, show name of mob and number killed, for each different type
if next (mobs) then
local t = {}
local total = 0
-- make list of mob names and number we killed
for k, v in pairs (mobs) do
table.insert (t, string.format ("(%s) x%i", k, v))
total = total + v
end -- for
-- alphabetic order
table.sort (t)
ColourNote ("Teal", "", "Killed: " .. table.concat (t, ", "))
Note (string.format ("%i mob%s killed, %i different mob type%s",
total, plural (total),
#t, plural (#t)))
else
Note ("No mobs killed.")
end -- something in mobs table
show_calcs ()
end -- xp_alias
]]>
</script>
</muclient>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|