• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Advanced Anti Bot System

And also... if the player is being killed, he could wait 30 minutos, dont answer and pum, teleported to the jail... saved :S
 
Damn... Can't edit... I have an idea... make a counter on it, if the player kill X monsters, then the antibot system will start, or check if the stamina is going down, the antibot system will work... Did you get it?

PD: X = 50 monsters o what ever, but the players shouln't know how many monsters you have to kill and also shouln't know that it works like that.
 
how bout credits, you just modified my antibot script I can tell by the variables.
 
this script dont work correctly when it jail u after certain time it wont tp u back to temple, and it always gives wrong awnser with tfs 0.3~ its !antibot 40 and on tfs 0.2~ its !antibot "40.
But it still dont work.
Code:
10:08 Anti Bot System: Hello, Belthazoro! You have 1 minute(s) to answer how much is 4 + 3. To answer say: !antibot "number.
10:08 Anti Bot System: Example: 20+20 = 40, then you would say !antibot "40.
10:09 Anti Bot System: Wrong answer!
10:09 Anti Bot System: You had already got 1 wrong answers! The limit is 3.
10:09 Anti Bot System: Right answer, thank you for answering.

If u see this he asked me how much is 4+3
i awnserd !antibot "7 caus i use 0.2
and it said wrong so i awnserd
!antibot "3 and it said good awnser so the best would be to change the question to like what nummber is this? then u can awnser with !antibot "nummber example.

i edited the script and it works perfect now only make ur jail pz and dont make it nologoutzone caus it dont auto tp so when his time is up he can relog and he will auto get tp in temple. the nummer he will get is from 1 till 999.
On TFS 0.3 say !antibot 20 and on TFS 0.2 say !antibot "20
and it schuld work perfect.

Code:
-- configs
local mintoanswer = 1 -- minutes to answer anti bot system
local delayAntiBot = 30 -- minutes of delay of delayAntiBot
local maxgroupid = 3 -- groupid higher than this don't have antiBotSystem Activated
local prisionpos = {x=32196,y=32260,z=7} -- if don't answer, go to this pos
local prisionminutes = 30 -- time inside the prision
local templepos = {x=32369, y=32241, z=7} -- after the prisionminutes, back to this position (temple is recommended)
-- end configs

-- local variables
local storages = {first_num = 20123, second_num = 20124, result = 20125, answer = 20126, prisioned = 20127, prisiontime = 20128, wrong_answers = 20129}
-- end local variables


function onLogin(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (prisioned == 1) then
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (timenow >= prisiontime) then
setPlayerStorageValue(cid,storages.prisiontime,0)
setPlayerStorageValue(cid,storages.prisioned,0)
doTeleportThing(cid, templepos)
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
doTeleportThing(cid, prisionpos)
end
end


if (delayAntiBot <= mintoanswer) then
debugPrint("Error! Anti Bot System debugs: variable delayAntiBot need to be higher than mintoanswer.")
else
if (getPlayerGroupId(cid) <= maxgroupid) then
antiBotEvent = addEvent(antiBot,1000,{cid=cid})
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "People with group ID higher than ".. maxgroupid .." don't have this system.")
end
end
return TRUE
end

function onLogout(cid)
stopEvent(prisionEvent)
stopEvent(antiBotEvent)
stopEvent(checkAnswerEvent)


setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
return TRUE
end

function antiBot(parameters)
local cid = parameters.cid

local playerpos = getCreaturePosition(cid)
local playername = getPlayerName(cid)
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
if (prisioned ~= 1) then
local first_num = math.random(1,9)
local second_num = math.random(1,999)
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)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Anti Bot System: Hello, "..playername.."! You have ".. mintoanswer .." minute(s) to answer what nummber this is >>> (".. second_num .."). To answer say: !antibot \"number.")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Anti Bot System: Example: 20, Anti Bot System: Hello, Belthazor! You have 1 minute(s) to answer what nummber this is >>> (130). To answer say: !antibot \"130..")
checkAnswerEvent = addEvent(checkAnswer,mintoanswer*60*1000,{cid=cid})
end
antiBotEvent = addEvent(antiBot,delayAntiBot*60*1000,{cid=cid})
end

function checkAnswer(parameters)
local cid = parameters.cid
local first_num, second_num, result, answer, prisioned = getPlayerStorageValue(cid,storages.first_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.result), getPlayerStorageValue(cid,storages.answer), getPlayerStorageValue(cid,storages.prisioned)
local wrong_answers = getPlayerStorageValue(cid,storages.wrong_answers)
if (wrong_answers > 3) then
doTeleportThing(cid, prisionpos)
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,1)
setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s) because answered many wrong times.")
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
else
if (answer ~= 1 and prisioned ~= 1 and result > 0) then
doTeleportThing(cid, prisionpos)
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,1)
setPlayerStorageValue(cid,storages.wrong_answers,0)
setPlayerStorageValue(cid,storages.prisiontime,os.time()+(prisionminutes*60))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Time limit! You had been prisioned for ".. prisionminutes .." minute(s).")
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
else
setPlayerStorageValue(cid,storages.first_num,0)
setPlayerStorageValue(cid,storages.second_num,0)
setPlayerStorageValue(cid,storages.result,0)
setPlayerStorageValue(cid,storages.answer,0)
setPlayerStorageValue(cid,storages.prisioned,0)
setPlayerStorageValue(cid,storages.wrong_answers,0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Anti Bot System: You are ok, but in some minutes you are going to be asked again.")
end
end
end

function checkprisioned(parameters)
local cid = parameters.cid
local prisioned = getPlayerStorageValue(cid,storages.prisioned)
local prisiontime = getPlayerStorageValue(cid,storages.prisiontime)
local timenow = os.time()
if (prisioned == 1) then
if (timenow >= prisiontime) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "You had completed your time here in the prision! You may now relog to go to the city.")
else
prisionEvent = addEvent(checkprisioned,1000,{cid=cid})
end
end
end

Scren Shot
picj.jpg

Hope this helps u
With this script i have problem:
[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
(luaGetCreatureStorage) Creature not found

[Error - CreatureScript Interface]
In a timer event called from:
data/creaturescripts/scripts/antibot.lua:onLogin
Description:
data/creaturescripts/scripts/antibot.lua:82: attempt to compare number with boolean
stack traceback:
data/creaturescripts/scripts/antibot.lua:82: in function <data/creaturescripts/scripts/antibot.lua:78>

lines 78-82:
function checkAnswer(parameters)
local cid = parameters.cid
local first_num, second_num, result, answer, prisioned = getPlayerStorageValue(cid,storages.first_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.second_num), getPlayerStorageValue(cid,storages.result), getPlayerStorageValue(cid,storages.answer), getPlayerStorageValue(cid,storages.prisioned)
local wrong_answers = getPlayerStorageValue(cid,storages.wrong_answers)
if (wrong_answers > 3) then
I use 0.3.6pl1
 
to make the anti bot more anti bottish, make a check if answer written within 0.5 sec then log "playername wrote correct antibot within 0.5 seconds" in a txt document.

In a while the text document will be filled, and if a certain playername tends to have written 100x times correct answer within 0.5 sec then he is definitely using a bot. Unless he sticks his eyeballs to the chat 24/7 prepared to solve antibot code before he even can spell !antibot "number
 
to make the anti bot more anti bottish, make a check if answer written within 0.5 sec then log "playername wrote correct antibot within 0.5 seconds" in a txt document.

In a while the text document will be filled, and if a certain playername tends to have written 100x times correct answer within 0.5 sec then he is definitely using a bot. Unless he sticks his eyeballs to the chat 24/7 prepared to solve antibot code before he even can spell !antibot "number

Or make table like:
Code:
local strings = {
	[1] = "one"
}

etc.

Then:
How much is ".. strings[math.random(#strings)] .." + bla bla, then player have to write answer as integer :D
 
Great script :) Thanks !

How change script that antibot system msg your character in new chat called "Anti bot" (possible to open it if not opened already?) ?
It'll be better because this channel wont be spammed by 'Using one from..." and hits :) ?

Thanks in advice :)
 
Doesn´t work for redskulls :S
Very well written but has many errors in the console,
if someone is good enough to make it work right in TFS 3.6 gonna be great!
 
Last edited:
heh

Code:
[24/05/2010 18:12:09] [Error - CreatureScript Interface] 
[24/05/2010 18:12:09] In a timer event called from: 
[24/05/2010 18:12:09] data/creaturescripts/scripts/antibot.lua:onLogin
[24/05/2010 18:12:09] Description: 
[24/05/2010 18:12:09] (luaGetThingPosition) Thing not found
Code:
[24/05/2010 18:12:09] [Error - CreatureScript Interface] 
[24/05/2010 18:12:09] In a timer event called from: 
[24/05/2010 18:12:09] data/creaturescripts/scripts/antibot.lua:onLogin
[24/05/2010 18:12:09] Description: 
[24/05/2010 18:12:09] (luaDoCreatureSetStorage) Creature not found
Code:
[24/05/2010 18:12:09] [Error - CreatureScript Interface] 
[24/05/2010 18:12:09] In a timer event called from: 
[24/05/2010 18:12:09] data/creaturescripts/scripts/antibot.lua:onLogin
[24/05/2010 18:12:09] Description: 
[24/05/2010 18:12:09] data/creaturescripts/scripts/antibot.lua:71: attempt to concatenate local 'playername' (a boolean value)
[24/05/2010 18:12:09] stack traceback:
[24/05/2010 18:12:09] 	data/creaturescripts/scripts/antibot.lua:71: in function <data/creaturescripts/scripts/antibot.lua:57>

WHO can help me?
 
lua script error: [creaturescript interface]
in a timer event called from:
Data/creaturescripts/scripts/anti-bot.luanlogin

luagetcreatureposition(). Creature not found

lua script error: [creaturescript interface]
in a timer event called from:
Data/creaturescripts/scripts/anti-bot.luanlogin

attempt to index a number value
stack traceback:
[c]: In function 'gettilepzinfo'
data/creaturescripts/scripts/anti-bot.lua:61: In function <data/creature
scripts/scripts/anti-bot.lua:57>

lua script error: [creaturescript interface]
in a timer event called from:
Data/creaturescripts/scripts/anti-bot.luanlogin

luagetcreatureposition(). Creature not found

lua script error: [creaturescript interface]
in a timer event called from:
Data/creaturescripts/scripts/anti-bot.luanlogin

attempt to index a number value
stack traceback:
[c]: In function 'gettilepzinfo'
data/creaturescripts/scripts/anti-bot.lua:61: In function <data/creature
scripts/scripts/anti-bot.lua:57>

3.6 --- help me?
 
worst problem on bot system is, in a PVP, player can be kicked hAHAHAHAH
thats sux xD

but nice script :D
i'll try to use !
 
Back
Top