Fippex
Mapper
i hoep you fix it
[09/08/2009 22:37:45] Lua Script Error: [CreatureScript Interface]
[09/08/2009 22:37:45] buffer
[09/08/2009 22:37:45] [string "loadBuffer"]:4: attempt to call method 'insert' (a nil value)
Lua Script Error: [CreatureScript Interface]
buffer
[string "loadBuffer"]:4: attempt to index field 'storages' (a nil value)
God Power has logged out.
God Power has logged in.
Lua Script Error: [CreatureScript Interface]
buffer
[string "loadBuffer"]:4: attempt to call method 'insert' (a nil value)
Lua Script Error: [CreatureScript Interface]
buffer
[string "loadBuffer"]:4: attempt to call method 'insert' (a nil value)
Error for me:
PHP:Lua Script Error: [CreatureScript Interface] buffer [string "loadBuffer"]:4: attempt to index field 'storages' (a nil value) God Power has logged out. God Power has logged in. Lua Script Error: [CreatureScript Interface] buffer [string "loadBuffer"]:4: attempt to call method 'insert' (a nil value) Lua Script Error: [CreatureScript Interface] buffer [string "loadBuffer"]:4: attempt to call method 'insert' (a nil value)
<?xml version="1.0" encoding="UTF-8"?>
<mod name="BotShield" version="3.1" author="Syntax" contact="[email protected]" enabled="yes">
<description>
This mod will enable mid-level bot prevention in your server.
</description>
<channel id="13" active="no" name="BotShield"/>
<config name="botshield_config"><![CDATA[
config = {
botonstorage = 56456,
channel = 13, -- what channel is BotShield on. (Make sure matches line 7 above)
accepted = "Accepted.", --what channel says when player passes test
correctish = "Correct, too many attempts though, you may relog to prevent punishment if you aren't AFK.", --message if correct after too many tries
mintoanswer = 15, -- minutes to answer anti bot system....needs to be lower than delayAntiBot
delayAntiBot = 60, -- minutes of delay of delayAntiBot....needs to be higher than mintoanswer
toomany = "NOTICE: Failed! Too many attempts.", --failed too many attempts message
timedout = "NOTICE: Failed! Time limit has been reached.", --failed time limit message
failedmsg = " BotShield Alert!\n You received a notation for suspicious behavior.\n If you have complaints please report on our forum.",
storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, wrong_answers = 20129}
}
]]></config>
<talkaction words="2;3;4;5;6;7;8;9;10" event="buffer"><![CDATA[
domodlib('botshield_config')
if (answer ~= 1 and result > 0) then
doPlayerSendToChannel(cid, cid, 7, words, config.channel, time)
if (words == result) then
if (getPlayerStorageValue(cid,config.storages.wrong_answers) <= 3) then
doPlayerSendToChannel(cid, cid, 15, config.accepted, config.channel, time)
setPlayerStorageValue(cid,config.storages.wrong_answers,0)
setPlayerStorageValue(cid,config.storages.answer,1)
setPlayerStorageValue(cid,config.storages.first_num,0)
setPlayerStorageValue(cid,config.storages.second_num,0)
setPlayerStorageValue(cid,config.storages.result,0)
else
doPlayerSendToChannel(cid, cid, 8, config.correctish, config.channel, time)
end
else
wrong_answers_now = getPlayerStorageValue(cid,config.storages.wrong_answers)
setPlayerStorageValue(cid,config.storages.wrong_answers,wrong_answers_now+1)
doPlayerSendToChannel(cid, cid, 8, "Incorrect. ".. getPlayerStorageValue(cid,config.storages.wrong_answers).."/3 failed attempts.", config.channel, time)
end
end
]]></talkaction>
<event type="joinchannel" name="AntiBotJoin" event="buffer"><![CDATA[
domodlib('botshield_config')
if(channelId == config.channel) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "BotShield = ON")
doSendAnimatedText(getCreaturePosition(cid), "+stamina", 210)
setPlayerStamina(cid, 999999)
setPlayerStorageValue(cid,config.botonstorage,1)
_result = true
end
function checkAnswer(parameters)
local cid = parameters.cid
if (wrong_answers > 3) then
setPlayerStorageValue(cid,config.storages.wrong_answers,0)
setPlayerStorageValue(cid,config.storages.first_num,0)
setPlayerStorageValue(cid,config.storages.second_num,0)
setPlayerStorageValue(cid,config.storages.result,0)
setPlayerStorageValue(cid,config.storages.answer,0)
doAddNotation(getPlayerAccountId(cid), 3, 4, BotShield, auto)
doPlayerSendToChannel(cid, cid, 17, config.toomany, config.channel, time)
doPlayerPopupFYI(cid, config.failedmsg)
elseif (answer ~= 1 and result > 0) then
setPlayerStorageValue(cid,config.storages.first_num,0)
setPlayerStorageValue(cid,config.storages.second_num,0)
setPlayerStorageValue(cid,config.storages.result,0)
setPlayerStorageValue(cid,config.storages.answer,0)
setPlayerStorageValue(cid,config.storages.wrong_answers,0)
doPlayerSendToChannel(cid, cid, 17, config.timedout, config.channel, time)
doAddNotation(getPlayerAccountId(cid), 3, 4, "BotShield", auto)
doPlayerPopupFYI(cid, config.failedmsg)
else
setPlayerStorageValue(cid,config.storages.first_num,0)
setPlayerStorageValue(cid,config.storages.second_num,0)
setPlayerStorageValue(cid,config.storages.result,0)
setPlayerStorageValue(cid,config.storages.answer,0)
setPlayerStorageValue(cid,config.storages.wrong_answers,0)
end
end
]]></event>
<event type="login" name="AntiBotLogin" event="buffer"><![CDATA[
registerCreatureEvent(cid, "AntiBotJoin")
registerCreatureEvent(cid, "AntiBotLeave")
registerCreatureEvent(cid, "AntiBotLogout")
_result = true
]]></event>
<event type="logout" name="AntiBotLogout" event="buffer"><![CDATA[
stopEvent(checkAnswerEvent)
setPlayerStorageValue(cid,config.botonstorage,0)
setPlayerStorageValue(cid,config.storages.second_num,0)
setPlayerStorageValue(cid,config.storages.result,0)
setPlayerStorageValue(cid,config.storages.answer,0)
setPlayerStorageValue(cid,config.storages.wrong_answers,0)
_result = true
]]></event>
<event type="leavechannel" name="AntiBotLeave" event="buffer"><![CDATA[
domodlib('botshield_config')
if(channelId == config.channel) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "BotShield = OFF")
doSendAnimatedText(getCreaturePosition(cid), "-stamina", 205)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You won't receive anymore equations, if you left any unanswered they are still active.")
setPlayerStamina(cid, 0)
setPlayerStorageValue(cid,config.botonstorage,0)
end
_result = true
]]></event>
<globalevent name="BotShield" interval="60" event="buffer"><![CDATA[
domodlib('botshield_config')
function onThink(interval, lastExecution, thinkInterval)
for _, pid in ipairs(getPlayersOnline()) do
if(getPlayerStorageValue(cid, config.botonstorage) > 0) then
local playerpos = getCreaturePosition(cid)
local playername = getPlayerName(cid)
if (getTilePzInfo(playerpos) == FALSE) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
local first_num = math.random(1,5)
local second_num = math.random(1,5)
local result = first_num+second_num
setPlayerStorageValue(cid,storages.first_num,first_num)
setPlayerStorageValue(cid,storages.second_num,second_num)
setPlayerStorageValue(cid,storages.result,result)
doPlayerSendToChannel(cid, cid, 8,"NOTICE: ".. first_num .." + ".. second_num .."= ? You have ".. config.mintoanswer .." minute(s).", 6, time)
checkAnswerEvent = addEvent(checkAnswer, config.mintoanswer*60*1000,{cid=cid})
end
end
end
_result = true
end
]]></globalevent>
</mod>
[10/08/2009 21:53:39] Lua Script Error: [CreatureScript Interface]
[10/08/2009 21:53:39] buffer
[10/08/2009 21:53:39] [string "loadBuffer"]:4: attempt to index field 'storages' (a nil value)
[10/08/2009 21:53:39] GOD Wiwilonga has logged out.
[10/08/2009 21:53:39] Mic Aberracion has logged in.
[10/08/2009 21:53:40] Lua Script Error: [CreatureScript Interface]
[10/08/2009 21:53:40] buffer
[10/08/2009 21:53:40] [string "loadBuffer"]:4: attempt to index field 'storages' (a nil value)
[10/08/2009 21:53:40] Mic Aberracion has logged out.
[10/08/2009 21:53:40] GOD Wiwilonga has logged in.
[10/08/2009 21:53:51] Lua Script Error: [CreatureScript Interface]
[10/08/2009 21:53:51] buffer
[10/08/2009 21:53:51] [string "loadBuffer"]:4: attempt to call method 'insert' (a nil value)
hey man you have many errors !
ipairs need to be pairs (i think S: )
and
Code:[10/08/2009 21:53:39] Lua Script Error: [CreatureScript Interface] [10/08/2009 21:53:39] buffer [10/08/2009 21:53:39] [string "loadBuffer"]:4: attempt to index field 'storages' (a nil value) [10/08/2009 21:53:39] GOD Wiwilonga has logged out. [10/08/2009 21:53:39] Mic Aberracion has logged in. [10/08/2009 21:53:40] Lua Script Error: [CreatureScript Interface] [10/08/2009 21:53:40] buffer [10/08/2009 21:53:40] [string "loadBuffer"]:4: attempt to index field 'storages' (a nil value) [10/08/2009 21:53:40] Mic Aberracion has logged out. [10/08/2009 21:53:40] GOD Wiwilonga has logged in. [10/08/2009 21:53:51] Lua Script Error: [CreatureScript Interface] [10/08/2009 21:53:51] buffer [10/08/2009 21:53:51] [string "loadBuffer"]:4: attempt to call method 'insert' (a nil value)
also you can't say 1 to 10 like. EX:
player 1 says: how old are you?
player 2 says: 1,2,3,4,5,6,7,8,9 or 10 -> it will be sended to the channel
:S