Thanks mate!
@Raphael
I think killCount.set isn't working correctly. I tried to add few kinds of pirates (since they all count to one task), so I tried
killCount.set(100, "Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")
then I wanted to check how the count and it returned 300, instead of 100
I would be very grateful if you check it out.
@Nimo, it's because it will assign 100 to each of them? So if you check 3 types of pirates it will show 3*100
Latest Scripts: Ultimate Dawnport FACC Spots Souleater Tunnels Useful Lua:
Yes, that's exactly what Mistgun said. When you doyou're saying that you've killed 100 of each pirate. When you dokillCount.set(100, "Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")you're getting the sum of all three pirates. Because 100 + 100 + 100 = 300, this is the expected behavior.killCount.get("Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")
I'll concede, however, that this might seem weird but there isn't much that can be done now.
so if i hunt on quaras scount w/ tasker... to me edit how many i've killed i setor i have to do 4 times it? one for each mobs on there?Code:killCount.set(0, "Quara Hydromancer Scout")
The following snippets are equivalent:
killCount.set(0, "Quara Hydromancer", "Quara Pincher", "Quara Constrictor", "Quara Mantassin")
killCount.set(0, "Quara Hydromancer")
killCount.set(0, "Quara Pincher")
killCount.set(0, "Quara Constrictor")
killCount.set(0, "Quara Mantassin")
Hello,
(Need to know): I use teamviewer to access my comp at home remotely, with my office comp/iphone.
Been playing around with a script i currently use and its working so.
Sometimes it misses to count hydras. For example: while i monitor the client it doesn't miss a count, like ever. But when i close down teamwiever from phone/officecomputer and start it 1-2h later it says like 175 hydras killed in HUD while quest log says 220..
But i have a hotkey for this to edit the kills but just curious what the problem is, fixable or i have to live with it?
I assume its counting it from server log? I have every status message checked in console.
Have yet to try it at home without teamviewer to see if its the same problem then.
here is the hud:
init start
-- local SCRIPT_VERSION = '1.1.1'
local Config = {
ShowAll = true,
Monsters = {"hydra"},
}
-- 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 @Lucas Terra 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
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
local HUD = {
Restart = -1,
Start = 1,
End = Config.MaxLines,
strStart = 1,
strEnd = 60,
strMax = 60,
Position = {$clientwin.left, $worldwin.bottom - ((#Config.Monsters + 1) * 14)},
Auxiliar = {0, 0},
ColumnWidth = {0, 0},
Moving = false,
Blue = {0.0, color(36, 68, 105, 20), 0.23, color(39, 73, 114, 20), 0.76, color(21, 39, 60, 20)},
Black = {0.0, color(75, 75, 75, 20), 0.23, color(45, 45, 45, 20), 0.76, color(19, 19, 19, 20)},
Orange = {0.0, color(145, 95, 0, 20), 0.23, color(158, 104, 0, 20), 0.76, color(84, 55, 0, 20)},
Green = {0.0, color(65, 96, 12, 20), 0.23, color(67, 99, 13, 20), 0.76, color(36, 52, 6, 20)},
Red = {0.0, color(90, 12, 15, 20), 0.23, color(98, 13, 17, 20), 0.76, color(52, 6, 9, 20)},
}
local tempPos = $chardb:getvalue('AWE.TH', 'POSITION')
if tempPos then
tempPos = tempPos:explode(":")
HUD.Position = {tonumber(tempPos[1]), tonumber(tempPos[2])}
end
filterinput(false, true, false, false) setfontstyle('Tahoma', 8, 75) setfillstyle('gradient', 'linear', 2, 0, 0, 0, 14) setfontstyle('Tahoma', 8, 50, 0xFFFFFF, 1, color(0, 0, 0, 50))
function inputevents(e)
if e.type == IEVENT_RMOUSEDOWN or e.type == IEVENT_MMOUSEDOWN then
HUD.Moving, HUD.Auxiliar = true, {$cursor.x - HUD.Position[1], $cursor.y - HUD.Position[2]}
elseif e.type == IEVENT_RMOUSEUP or e.type == IEVENT_MMOUSEUP then
HUD.Moving = false
elseif e.type == IEVENT_LMOUSEUP then
if e.elementid == HUD.Restart then
_TH__Killed, Time = {}, tosec(os.date("%X"))
end
end
end
local function displaytext(text, x, y, c)
addgradcolors(unpack(c))
local w, h = measurestring(text)
HUD.ColumnWidth[1], HUD.ColumnWidth[2] = math.max(HUD.ColumnWidth[1], w or 0), math.max(HUD.ColumnWidth[2], h or 0)
local t = drawroundrect(x, y, HUD.ColumnWidth[1] + 7, HUD.ColumnWidth[2], 2, 2)
drawtext(text, x + 2, y + math.floor(HUD.ColumnWidth[2] / 4) - 2.55)
return t
end
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
if HUD.Moving then
auto(10)
HUD.Position = {$cursor.x - HUD.Auxiliar[1], $cursor.y - HUD.Auxiliar[2]}
$chardb:setvalue('AWE.TH', 'POSITION', table.concat(HUD.Position, ':'))
end
local x, y = 0, 0
local x, y = 0, 0
drawtext('Behemoths killed: ', x, y, HUD.Blue)
x = x + 85
displaytext(killCount.get('behemoth'), x, y, HUD.Blue)
y = y + 16
drawtext('Hydras killed: ', x-85, y, HUD.Blue)
x = x + 75
displaytext(killCount.get('hydra'), x-75, y, HUD.Blue)
y = y + 20
setposition(unpack(HUD.Position))
It is not saving the numbers on DB. @Raphael
Last edited by Stephano; 11-16-2016 at 12:07 AM.