It'll show the amount of killed monsters selected on your screen and the totals.
Configuration
To configurate this script simply use the right mouse click, this will open a menu with all the options available.
Show All: Show all the monsters in a separated line.
Show Total Only: Show the total amount of monsters only.
Reset Monsters: This will set all monsters killed amount to 0. If you're using killCount by Raphael, it'll reset all the monsters on your database too.
Reset Timer: Restarts the timer.
Reset Both: Resets both timer and monsters.
Add Monster: This will ask for a monster name and will add its amount on the display.
Remove Monster: This will remove a monster name and its information from the display, this doesn't restart the count of the monster.
Scan Targeting: This will pick all the monsters from your targeting list and insert on the display. This will remove any custom monster you inserted with Add Monster option.
local tempPos = $chardb:getvalue('TaskHelper', 'Position')
if tempPos then
tempPos = tempPos:explode(":")
hud.pos = {tonumber(tempPos[1]), tonumber(tempPos[2])}
end
TaskHelper.Monsters = {}
if not $chardb:getvalue("TaskHelper", "Monsters") then
foreach settingsentry e 'Targeting/Creatures' do
local mname = get(e, 'Name')
table.insert(TaskHelper.Monsters, mname:lower())
end
table.sort(TaskHelper.Monsters)
$chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
else
TaskHelper.Monsters = $chardb:getvalue("TaskHelper", "Monsters"):totable()
end
function inputevents(e)
if e.type == IEVENT_MMOUSEDOWN then
hud.moving, hud.aux = true, {$cursor.x - hud.pos[1], $cursor.y - hud.pos[2]}
end
if e.type == IEVENT_MMOUSEUP then
hud.moving = false
$chardb:setvalue('TaskHelper', 'Position', table.concat(hud.pos, ':'))
end
if e.type == IEVENT_RMOUSEUP then
requestmenu(0)
requestmenuitem(tern(TaskHelper.ShowAll, "Show Total Only", "Show All"))
requestmenuitem("Reset Timer")
requestmenuitem("Reset Monsters")
requestmenuitem("Reset Both")
requestmenuitem("Add Monster")
requestmenuitem("Remove Monster")
requestmenuitem("Scan Targeting")
end
if e.type == IEVENT_REQUESTMENU then
if e.value1 == 0 then
if e.value2 == 'Show Total Only' or e.value2 == 'Show All' then
TaskHelper.ShowAll = not TaskHelper.ShowAll
end
if e.value2 == 'Reset Timer' or e.value2 == 'Reset Both' then
$chardb:setvalue("TaskHelper", "Timer", tosec(os.date("%X")))
end
if e.value2 == 'Reset Monsters' or e.value2 == 'Reset Both' then
for k, v in pairs(TaskHelper.Monsters) do
$chardb:setvalue('TH MonstersKilled', v, 0)
if killCount then
killCount.set(0, v)
end
end
end
if e.value2 == 'Scan Targeting' then
TaskHelper.Monsters = {}
foreach settingsentry e 'Targeting/Creatures' do
local mname = get(e, 'Name')
if not table.find(TaskHelper.Monsters, mname:lower()) then
table.insert(TaskHelper.Monsters, mname:lower())
end
end
table.sort(TaskHelper.Monsters)
$chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
end
if e.value2 == 'Add Monster' then
requesttext(1, 'Name the monster you want to add:')
end
if e.value2 == 'Remove Monster' then
requestmenu(2)
for _, v in pairs(TaskHelper.Monsters) do
requestmenuitem(v:capitalizeall())
end
end
end
if e.value1 == 2 then
local t = table.find(TaskHelper.Monsters, e.value2:lower())
if t then
table.remove(TaskHelper.Monsters, t)
$chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
end
end
end
if e.type == IEVENT_REQUESTTEXT then
if e.value1 == 1 then
if not table.find(TaskHelper.Monsters, e.value2:lower()) then
table.insert(TaskHelper.Monsters, e.value2:lower())
$chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
end
end
end
end
local tempTime = tosec(os.date("%X"))
if $chardb:getvalue("TaskHelper", "Timer") then
if tempTime - $chardb:getvalue("TaskHelper", "Timer") >= 293^2 then
$chardb:setvalue("TaskHelper", "Timer", tempTime)
end
else
$chardb:setvalue("TaskHelper", "Timer", tempTime)
end
if hud.moving then
auto(10)
hud.pos = {$cursor.x - hud.aux[1], $cursor.y - hud.aux[2]}
end
if killCount and killCount.lastRan <= 10000 then
foreach $chardb:sectionvalue sec 'TH MonstersKilled' do
$chardb:setvalue('TH MonstersKilled', sec.name, killCount.get(sec.name))
end
else
foreach newmessage m do
if m.type == MSG_INFO then
local monster = m.content:match("Loot of a?n? (.+): .-")
if monster then
monster = (monster:match("the (.+)") or monster):lower()
$chardb:setvalue('TH MonstersKilled', monster, ($chardb:getvalue('TH MonstersKilled', monster) or 0) + 1)
end
end
end
end
local Total, Line = 0, 0
local msg = "TASK HELPER"
local strwidth, strheight = measurestring(msg)
hud.width, hud.height = math.max(hud.width, strwidth or 0), math.max(hud.height, strheight or 0)
Yes, I recently asked Raphael to update his persistent so I can extract the information from it, I just haven't time to update my HUD aswell.
08-03-2014, 04:32 PM
Sajean
@Ragekemi what you need to make with implement in this persistent ?
I have make a little modified and working for me with my task counter.
08-03-2014, 04:32 PM
Ragekemi
Quote:
Originally Posted by Leonardo
Yes, I recently asked Raphael to update his persistent so I can extract the information from it, I just haven't time to update my HUD aswell.
Thank's alot, rep+ for that.
Quote:
Originally Posted by Sajean
@Ragekemi what you need to make with implement in this persistent ?
I have make a little modified and working for me with my task counter.
That:
Quote:
Originally Posted by Ragekemi
Next release: Farmine - Ghastly Dragons + Ethershreck Tasker
08-12-2014, 04:04 PM
tiagokg
12:59:32 error in Persistent script NewPersistentScript4:
["HUD.Restart = drawroundrect(x ..."]:NewPersistentScript4:84 attempt to perform arithmetic on global 'w' (a nil value)
What can I do to fix it ? thanks ;D
08-13-2014, 12:57 PM
Leonardo
Quote:
Originally Posted by tiagokg
12:59:32 error in Persistent script NewPersistentScript4:
["HUD.Restart = drawroundrect(x ..."]:NewPersistentScript4:84 attempt to perform arithmetic on global 'w' (a nil value)
What can I do to fix it ? thanks ;D
Put on the right place, HUD > New Hud not Scripter persistents.
The right click draggable function was substituted by a built-in menu with all the options described on the first post. To move the HUD use the middle mouse button.
The "Reset" button was substituted by the menu option "Reset Both", "Reset Timer" and "Reset Monsters".
This version consumes 4-5x less memory than the last version, so I really recommend to change.
Can be used with killCount by @Raphael, some functions of the HUD will also reset monsters in both HUD and killCount (read main post).
The right click draggable function was substituted by a built-in menu with all the options described on the first post. To move the HUD use the middle mouse button.
The "Reset" button was substituted by the menu option "Reset Both", "Reset Timer" and "Reset Monsters".
This version consumes 4-5x less memory than the last version, so I really recommend to change.
Can be used with killCount by @Raphael, some functions of the HUD will also reset monsters in both HUD and killCount (read main post).
Thanksssssssssss
error in HUD script TaskHelper:
["if killCount and killCount.lastRan <= 10..."]:TaskHelper:156 attempt to compare nil with number
Really no idea what i'm doing wrong, just replaced the old by the new one
08-17-2014, 05:47 PM
Raphael
Quote:
Originally Posted by Ragekemi
Thanksssssssssss
error in HUD script TaskHelper:
["if killCount and killCount.lastRan <= 10..."]:TaskHelper:156 attempt to compare nil with number
Really no idea what i'm doing wrong, just replaced the old by the new one