PDA

View Full Version : Kill counter & reset script



elowam122
02-27-2016, 08:37 AM
Hello guys!

I am looking for script which count killed monsters, going to x label when counter of y creature reach z number (f.e. 100) and clean counter after all.

At all, is it possible to do?

Great thanks for any help.
King Regards!
Cheers!

softbzero
02-27-2016, 09:46 AM
if (labelName == "Count") then
local killed_creatures = Self.GetCreatureKills("Wiggler")
if killed_creatures >= 10 then
Walker.Goto("Out")
else
Walker.Goto("Start")
end
end

Hetcolt
02-27-2016, 11:39 AM
if (labelName == "Count") then
local killed_creatures = Self.GetCreatureKills("Wiggler")
if killed_creatures >= 10 then
Walker.Goto("Out")
else
Walker.Goto("Start")
end
end

I think the reet Creature kills is missing on yours


registerEventListener(WALKER_SELECTLABEL, "onLabel")

local monster = "Ghastly Dragon" -- monster name
local kills = 500 -- kills for task

function onLabel(label)
if(label == "CheckTask") then
print('Checking Ghastly Dragon kills')
wait(2*1000)
if (Self.GetCreatureKills(monster)>=kills) then
print('task finished')
Walker.Goto("Report")
Self.ResetCreatureKills(monster)
else
print('not finished')
wait(2*1000)
Walker.Goto("Checker")
end
end
end

Fatality
02-27-2016, 01:55 PM
registerEventListener(WALKER_SELECTLABEL, "onLabel")

local monster = "Ghastly Dragon" -- monster name
local kills = 500 -- kills for task

function onLabel(label)
if(label == "CheckTask") then
print('Checking Ghastly Dragon kills')
wait(2*1000)
if (Self.GetCreatureKills(monster)>=kills) then
print('task finished')
Walker.Goto("Report")
Self.ResetCreatureKills(monster)
else
print('not finished')
wait(2*1000)
Walker.Goto("Checker")
end
end
end

Why the random waits? And why 2*1000 not just 2000?

qexybot
02-27-2016, 10:44 PM
It is impossible to do to check if I am killed, and added to the counter?

Hetcolt
02-28-2016, 01:40 AM
I put random waits to see green messages appearing. Without its to fast and I only can read it in Server Log.
2*1000 or 2000 does it make any difference ?

Hetcolt
02-28-2016, 01:43 AM
It is impossible to do to check if I am killed, and added to the counter?

I didnt find any script that reads Questlog yet. If you find pls post it xD. For that case I start script from 0 kills and you can be sure it will count correctly.