• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Website monsters kills counter

well the grid I have on homepage, but when I kill monsters in my Server, no kills were added to the grid:
There are not any monster kills today.
That appears.
 
This works great but since it resets every 15-20 mins or sumthing like that i dont find this useable but it's realy col thanks :)
 
Dont know what was wrong with me today.. :D By me it's working fine =)

Thank you very much :D
 
Is there any way to make this script not count summoned monsters (for example people kill a lot of demons on my server so fire elementals are #1 on the kill list because of all the FE's that demons summon)? Also, can anyone post a working version of the slawkens script? I messed with it for a while and couldn't get it to work. I'm not sure if its adding the monsters to the cache or if its just not writing it out to the DB.
 
Use this code if you don't want summons to count towards your kill statistics (such as player summons, demons summons (FE's), etc). Thank you to Slawkens for the small bit of help here.
Code:
function onKill(cid, target)
	if(isMonster(target) == TRUE) then
		if getCreatureMaster(target) == target then
			local name = getCreatureName(target)
			local monsterkills = db.getResult("SELECT mid, kills FROM vorgpl_monsterskills WHERE name = '" .. name .. "' LIMIT 1")

			if(monsterkills:getID() ~= -1) then
				db.executeQuery("UPDATE vorgpl_monsterskills SET kills = " .. (monsterkills:getDataInt("kills") + 1) .. " WHERE mid = " .. monsterkills:getDataInt("mid") .. " LIMIT 1")
			else
				db.executeQuery("INSERT INTO vorgpl_monsterskills (name, kills) VALUES ('" .. name .. "', 1)")
			end
		end
	end
	return TRUE
end
 
How do I make it to display only specified monsters? For example Orshabaals, Ferumbrases, Demodrases and some others i choose. Also, is it possible to display a killer?
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Works?
Code:
function onKill(cid, target)
    local allowed = { -- allowed pets, costs & level required
        ["cat"], ["dog"], , ["deer"] , ["pig"], ["parrot"], ["seagull"], ["chicken"], ["rabbit"], 
		["squirrel"], ["frog"], ["rat"], ["sheep"], ["wolf"], ["skeleton"], ["war wolf"], ["demon skeleton"]}

	if allowed[name] == getCreatureName(target) then 
		if(isMonster(target) == TRUE)then
			if getCreatureMaster(target) == target then
				local name = 
				local monsterkills = db.getResult("SELECT mid, kills FROM vorgpl_monsterskills WHERE name = '" .. name .. "' LIMIT 1")

				if(monsterkills:getID() ~= -1) then
					db.executeQuery("UPDATE vorgpl_monsterskills SET kills = " .. (monsterkills:getDataInt("kills") + 1) .. " WHERE mid = " .. monsterkills:getDataInt("mid") .. " LIMIT 1")
				else
					db.executeQuery("INSERT INTO vorgpl_monsterskills (name, kills) VALUES ('" .. name .. "', 1)")
				end
			end
		end

	end
	return TRUE
end
 
Back
Top