I've been using the following HUD and it is working perfectly.
Please remember to load Raphael's script BEFORE loading the HUD.
Printable View
Bro i can't add monsters with 2 names ex: Ancient scarab, the secont name (scarab) make a Error =/ see
error in Persistent script killcount:
["killCount.set = function(count,Mammoth,Ba..."]:killcount:18: ')' expected near 'scarab'
Yes you can. I've been using this with Pirates during weeks. Post your code.
Sir, you're not supposed to change THIS function. You should create ANOTHER script that calls it. Please look my HUD (some posts above) and THERE you'll set the creatures list.
Raphael's script saves every single monster you kil. From rats to Morga Orsha Demon. So, you don't need to change the code but read data from it.
Too many arguments on that gotolabel call. Please check our docs for more info: https://tibiawindbot.com/docs.html#functions-gotolabel
The code is correct, indeed.
The problem is that Raphael's script starts with 0 to every creature. It ignores the amount you already killed (as it isn't possible to read from questlog without opening it).
To work around this:
-open your questlog and write down how many creatures you've already killed;
-create a HOTKEY script and paste the following code
-- 100 = number of creatures you've already killed. Just change it.
killCount.set(100, 'Carniphila')
Remember to put this on as HOTKEY SCRIPT and NOT as PERSISTENT
one last question , is there any Hud or something that shows on the screen of my tibia the amount of monsters I've ever killed ?
Bro why dont work =( look
-- 100 = number of creatures you've already killed. Just change it.
killCount.set(400, 'Mutated Rat')
i use this hotkey to test and this action
if killCount.get("Mutated Rat") >= 400 then
gotolabel(0, "Task")
else
gotolabel('Pot')
end
so no go to the label =( help me plis bro =S
The function gotolabel has the following params:
gotolabel ( string labelname , optional string waypointsection)
So, you should use it as:
gotolabel('indo', 'Task')
What i need to make this work?, i added this action to scripter / persistent:
init start
-- local SCRIPT_VERSION = '1.1.1'
-- If set to true, will save kill count to $chardb so that it is persisted
-- throughout different sessions.
local saveToDB = true
-- DO NOT EDIT BELOW THIS LINE --
-- We don't want to override the object because that'd delete all data in
-- killCount.creatures
if killCount == nil then
killCount = {
creatures = {},
lastRan = $timems
}
killCount.set = function(count, ...)
local names = table.each({...}, string.lower)
for _, v in ipairs(names) do
killCount.creatures[v] = count
if killCount.saveToDB then
$chardb:setvalue('killCount', v, count)
end
end
end
killCount.add = function(addAmount, ...)
local names = table.each({...}, string.lower)
for _, v in ipairs(names) do
killCount.set(killCount.get(v) + addAmount, v)
end
end
killCount.reset = function(...)
killCount.set(0, ...)
end
killCount.get = function(...)
local names = table.each({...}, string.lower)
local count = 0
for _, v in ipairs(names) do
local cCount = killCount.creatures[v]
if cCount == nil then
cCount = 0
killCount.set(cCount, v)
end
count = count + cCount
end
return count
end
if saveToDB then
-- Thanks to [MENTION=1]Lucas Terra[/MENTION] for implementing database iterators for the
-- sole purpose of making this script better. Lucas, you rock!
foreach $chardb:sectionvalue v 'killCount' do
killCount.set(v.value, v.name)
end
end
end
-- We only set saveToDB now because else it would cause unnecessary updates
-- queried to the database when we first read it.
killCount.saveToDB = saveToDB
init end
auto(100)
foreach newmessage m do
if m.type == MSG_INFO then
local creature = m.content:match(REGEX_LOOT)
if creature then
killCount.add(1, creature)
end
end
end
-- You're welcome, Leonardo
killCount.lastRan = $timems
And added this action to leave from respawn to city:
if killCount.get('Hydra') >= 650 then
gotolabel("Leave", 'BackToCity')
end
And this to reset hydras after killing the boss, but didn't work, what am i missing? do i need to add something else?:
npctalk('hi', 'task', 'task', 'hydra', 'yes')
killCount.reset('Hydra')
Well i added this action at an "x" waypoint at my hunt waypoints and the char didn't leaved the cave, also when i was at dp before going to resp i added the action again as a checker to go to grizzly adams in case it needs to, and didn't work, my char had 680 hydras killed and didn't get the action i mean he didn't go to grizzly adams because it didn't recognized the 650 hydras
if killCount.get('Hydra') >= 650 then
gotolabel("Leave", 'BackToCity')
end
if killCount.get('Hydra') >= 650 then
gotolabel("Grizzly", 'ToHunt')
end
Hey,
I have a problem that i cant fix by my own. The thing is im hunting sea serpents in party(for better exp/shared) and because of it this counter doesnt work so good. I mean it is counting monsters killed by both characters so every char is going to grizzly when it get like 500+ sea serpents. Im not sure about it and first of all im just asking if that can be fixed.
Thanks for the answers.
@Raphael
It worked , thank you so much, btw, about medusas i need to write medusa or medusae? to reset killed monsters and to get their value?
@Raphael
I can add killcount.get to an action of force refill? or it must be as an action on waypoints?
if i have one killcount with undead dragon and ghastly dragons and 2 checkers of each task for 500 ghastly and other one in next action for 400 undeads it work?
also if bot report one task and get killCount.reset('ghastly dragon') then undead dragons will be in amount like before reset ghastly?