• 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!

[lua] check this ! rep ++++

God Nixez

Member
Joined
Sep 20, 2009
Messages
413
Reaction score
18
Hello otlanders i wanna a script that does the above

Every 30 sec [i can set the time] the script does check player-items and check how much count does he have from diffrent id's like gold and plat gold and crystal coins and it check again after 30 sec or w.e i set and does the compare if he gain like more than 100 crystal coins [i can set that] gives me a report how to send the report idk and where to send also idk xD i have message system u can use that to send me a message with the report check what you can do REp ++++

<_<
 
LUA:
local gain = 1000000
local log = getDataDir() .. '/logs/money.txt'

local money, s = {
	[2148] = 1,
	[2152] = 100,
	[2160] = 10000,
}, ''
for k, v in pairs(money) do
	s = s .. (s == '' and '' or ',') .. k
end

function onThink(interval)
	local gm, f = {}, {}
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerGroupId(cid) < 4 then
			local now, last, p = getPlayerMoney(cid), math.max(0, getCreatureStorage(cid, 5))
			if now - last >= gain then
				p = true
			else
				doPlayerSave(cid)
				local q = db.getResult('SELECT itemtype,SUM(count) AS n FROM player_depotitems WHERE player_id='..getPlayerGUID(cid)..' AND itemtype IN('..s..') GROUP BY itemtype')
				if q:getID() ~= -1 then
					repeat
						now = now + q:getDataInt('n') * money[q:getDataInt('itemtype')]
					until not q:next()
					q:free()
					if now - last >= gain then
						p = true
					end
				end
			end
			if p then
				table.insert(f, {getCreatureName(cid), last, now})
			end
			if now == 0 then
				doCreatureSetStorage(cid, 5)
			else
				doCreatureSetStorage(cid, 5, now)
			end
		else
			table.insert(gm, cid)
		end
	end
	for i = 1, #f do
		for j = 1, #gm do
			doPlayerSendTextMessage(gm[j], MESSAGE_STATUS_WARNING, 'Player "' .. f[i][1] .. '" gained more than ' .. gain .. ' gold in last ' .. interval .. ' seconds (from ' .. f[i][2] .. ' to ' .. f[i][3] .. ')')
		end
		if log then
			doWriteLogFile(log, 'Player "' .. f[i][1] .. '" gained more than ' .. gain .. ' gold in last ' .. interval .. ' seconds (from ' .. f[i][2] .. ' to ' .. f[i][3] .. ')')
		end
	end
	return true
end
 
[23/03/2011 14:37:27] Player "Herenoob" gained more than 1000000 gold in last 30 seconds (from 0 to 2000000)
i love ya !

Cyko rox they said ! rePPEd ++
 
LUA:
local gain = 1000000
local log = getDataDir() .. '/logs/money.txt'

local money, s = {
	[2148] = 1,
	[2152] = 100,
	[2160] = 10000,
}, ''
for k, v in pairs(money) do
	s = s .. (s == '' and '' or ',') .. k
end

function onThink(interval)
	local gm, f = {}, {}
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerGroupId(cid) < 4 then
			local now, last, p = getPlayerMoney(cid), math.max(0, getCreatureStorage(cid, 5))
			if now - last >= gain then
				p = true
			else
				doPlayerSave(cid)
				local q = db.getResult('SELECT itemtype,SUM(count) AS n FROM player_depotitems WHERE player_id='..getPlayerGUID(cid)..' AND itemtype IN('..s..') GROUP BY itemtype')
				if q:getID() ~= -1 then
					repeat
						now = now + q:getDataInt('n') * money[q:getDataInt('itemtype')]
					until not q:next()
					q:free()
					if now - last >= gain then
						p = true
					end
				end
			end
			if p then
				table.insert(f, {getCreatureName(cid), last, now})
			end
			if now == 0 then
				doCreatureSetStorage(cid, 5)
			else
				doCreatureSetStorage(cid, 5, now)
			end
		else
			table.insert(gm, cid)
		end
	end
	for i = 1, #f do
		for j = 1, #gm do
			doPlayerSendTextMessage(gm[j], MESSAGE_STATUS_WARNING, 'Player "' .. f[i][1] .. '" gained more than ' .. gain .. ' gold in last ' .. interval .. ' seconds (from ' .. f[i][2] .. ' to ' .. f[i][3] .. ')')
		end
		if log then
			doWriteLogFile(log, 'Player "' .. f[i][1] .. '" gained more than ' .. gain .. ' gold in last ' .. interval .. ' seconds (from ' .. f[i][2] .. ' to ' .. f[i][3] .. ')')
		end
	end
	return true
end

A not established value will be ..?
Since I've seen that local p doesn't have a reference(or however you say it :e)
Nice script, really niceee
 
Back
Top