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

Problems with talkactions !frags and !bless

wickedd

Member
Joined
Oct 14, 2011
Messages
251
Solutions
1
Reaction score
23
Location
US
srry not bless

this is my frags lua
LUA:
local config = {
	useFragHandler = getBooleanFromString(getConfigValue('useFragHandler')),
	advancedFragList = getBooleanFromString(getConfigValue('advancedFragList'))
}

function onSay(cid, words, param, channel)
	if(not config.useFragHandler) then
		return false
	end

	local time = os.time()
	local times = {today = (time - 86400), week = (time - (7 * 86400))}

	local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
	if(result:getID() ~= -1) then
		repeat
			local content = {
				name = result:getDataString("name"),
				level = result:getDataInt("level"),
				date = result:getDataInt("date")
			}
			if(content.date > times.today) then
				table.insert(contents.day, content)
			elseif(content.date > times.week) then
				table.insert(contents.week, content)
			else
				table.insert(contents.month, content)
			end
		until not result:next()
		result:free()
	end

	local size = {
		day = table.maxn(contents.day),
		week = table.maxn(contents.week),
		month = table.maxn(contents.month)
	}
	if(config.advancedFragList) then
		local result = "Frags  today(6 kills is red, 10 is black): " .. size.day .. "."
		if(size.day > 0) then
			for _, content in ipairs(contents.day) do
				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
			end

			result = result .. "\n"
		end

		result = result .. "\nFrags this week(30 red, 50 black): " .. (size.day + size.week) .. "."
		if(size.week > 0) then
			for _, content in ipairs(contents.week) do
				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
			end

			result = result .. "\n"
		end

		result = result .. "\nFrags this month(100 red, 200 black): " .. (size.day + size.week + size.month) .. "."
		if(size.month > 0) then
			for _, content in ipairs(contents.month) do
				result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
			end

			result = result .. "\n"
		end

		local skullEnd = getPlayerSkullEnd(cid)
		if(skullEnd > 0) then
			result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
		end

		doPlayerPopupFYI(cid, result)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today (6 kills to red), " .. (size.day + size.week) .. " this week (30 kills to red) and " .. (size.day + size.week + size.month) .. " this month (100 kills.")
		if(size.day > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
		end

		local skullEnd = getPlayerSkullEnd(cid)
		if(skullEnd > 0) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
		end
	end

	return true
end
but it wont work, ive tried many different things but cant get it
my serv says
LUA:
Lua Script Error : [Test Interface]
data/talkactions/scripts/frags.lua
data/talkactions/scripts/frags.lua:2: attempt to call global 'getConfigValue' (a nil value)
stack traceback:
       [C]: in function 'getConfigValue'
       data/talkactions/scripts/frags.lua:2: in main chunk
Warning: [Event::checkScript] Can not load script. /scripts/frags.lua
Halllpp plxx
 
welll i got the newest rme opened my 8.6 n imported it into my current map file

ill need .dll files for the functions too?

can you help me add those 2 functions to my lib? the getTalkActionlist and the getPlayerSkull~
 
try my way of updating the map whatever client you want.

Did you add data/lib and the files in it from TFS?

And post a list of your .dll files
 
not sure what u want me to do with the map.. u said to go to properties the map version is 0.6.1
and yes i did ad lib and its files

iconv.dll
libmysql.dll
libxml2.dll
lua51.dll
sqlite.dll
zlib1.dll
 
you should just re-download TFS and use the datapack and map you have from the hold and import it to the new TFS, fail-proof ^_^

Anyways, if the map is 8.6, download RME 8.6 and tibiaclient 8.6 then load the map on 8.6 and then go to map > properties and set the map to whatever version you want it to be. Loading it in 9.6 directly wont work properly.
 
Sooooo your saying i should re download the one im working with now n use the datapack from my 8.6 one? and i loaded it with the new map editor n saved it into my reg map n it works fine except for that one part i showed you
 
i cant get it to record the kills:/ i got the actual command to work a box comes up showing u ur kills but its always 0
 
Last edited:
Back
Top