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

[Talkaction] Bug Report [CLOSED]

LucasFerraz

Systems Analyst
Joined
Jun 10, 2010
Messages
2,858
Reaction score
96
Location
Brazil
EDIT: CLOSED
http://otland.net/f81/better-way-report-bugs-147048/

-----------------------------------------------------


When player say: !reportbug
Will save his position in a .txt (/data/bugs.txt) and he will coment in this report.

After all the bugs.txt will show:


Player 1 [pos x pos y pos z]
coment: this stone is bugged.(example)
---------------------------------------
Player 2 [pos x pos y pos z]
coment: house door bugged(example)
---------------------------------------


Is this hard to do?
 
Last edited:
Lua:
function onSay(cid, words, param, channel)
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	else
		f:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] "..getPlayerName(cid).." reported a bug near [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."] and commented:"..param..".\n")
		f:close()
	end
return TRUE
end

!whatever, comment
 
Last edited:
Lua:
function onSay(cid, words, param, channel)
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	else
		f:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] "..getPlayerName(cid).." reported a bug near [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."] and commented:"..param..".")
		f:close
	end
return TRUE
end

!whatever, comment

not working. Error in line 9: function arguments expeted near 'end'
 
I tried this
Lua:
function onSay(cid, words, param, channel)
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	else
		f:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] "..getPlayerName(cid).." reported a bug near [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."] and commented:"..param..".")
		f:close
	end
return TRUE
end
 
I tried this
Lua:
function onSay(cid, words, param, channel)
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	else
		f:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] "..getPlayerName(cid).." reported a bug near [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."] and commented:"..param..".")
		f:close
	end
return TRUE
end
Did you create bugs.txt?
 
Working now BUT it's saving only the first player who use this command
Lua:
function onSay(cid, words, param, channel)
local a = "data/logs/bugs.txt"
local file = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
	else
		file:write("[" .. os.date("%d %B %Y %X ", os.time()) .. "] "..getPlayerName(cid).." reported a bug near [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."] and commented:"..param..".")
		file:close()
	end
return TRUE
end
 
Last edited:
I added delay, why don't works?
Lua:
function onSay(cid, words, param, channel)

local storage = 6707
local delaytime = 600
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

	elseif(exhaustion.get(cid, storage) == TRUE) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait " .. exhaustion.get(cid, storage) .. " seconds to report.")

	elseif (exhaustion.get(cid, storage) == FALSE) then
		f:write(""..getPlayerName(cid).." reported a bug at " .. os.date("%d %B %Y - %X ", os.time()) .."\n"..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
		f:close()
		exhaustion.set(cid, storage, delaytime)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
	end
return TRUE
end
 
Last edited:
Lua:
function onSay(cid, words, param, channel)
local storage = 6707
local delaytime = 600
local a = "data/logs/bugs.txt"
local f = io.open(a, "a+")
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end
local exhaust = exhaustion.get(cid, storage)
	if(not exhaust) then
		exhaustion.set(cid, storage, delaytime)
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your report has been received successfully!")
		f:write(""..getPlayerName(cid).." reported a bug at " .. os.date("%d %B %Y - %X ", os.time()) .."\n"..param.." [x="..getPlayerPosition(cid).x..", y="..getPlayerPosition(cid).y..", z="..getPlayerPosition(cid).z.."].\n\n----------------------------------------------------------\n")
		f:close()
	else
		doPlayerSendCancel(cid, "You are exhausted.")
	end
return TRUE
end
 
Back
Top