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

GlobalEvent [Potar] Fully automatic 100% anti-bot system (Lib/Creature/Talk/Glob).

Potar

SocialWorld
Senator
Joined
Mar 1, 2009
Messages
1,664
Reaction score
125
Location
Warsaw, Poland
avatar32312_6.gif

Hello, I want to show you one of my job, this is fully automatic anti-bot system.

Features:

- System will check all hunting players... (every xxx minutes).
- Only check players if level is more than... (you can set level)
- Only check if the player killed monster 1 minute ago... (you can set time to check after kill the monster)
- Asks a simple question like "Please write your code...".
- Teleporting player (who is using cave bot atm, and didnt respond).
- If player has been checked by bot system 3 or more times, then start doing ban for XXX hours for all future checks on player.
- You can set a SPECIAL storage if player have it then he won't be checked (like premium features to SMS Shop).

I will add some photos within some days.

I've added a lot of comments to function.

Files:

Creaturescripts:

In XML :

Code:
<event type="kill" name="antibot" event="script" value="antibot.lua"/>

In login.lua :

Code:
registerCreatureEvent(cid, "antibot")

And make a file antibot.lua :

Code:
--[[
    Anti Bot System by Potar
    ver.: 1.00 (2012-12-24)
    contact.: View Profile: Potar - OtLand
    file.: Creaturescripts
]]--

function onKill(cid, target, lastHit)
        if isPlayer(target) or isSummon(target) then return true end   
            AB_SYSTEM_set(cid, AB_SYSTEM_KILLSTORAGE, os.time())
    return true
end

Talkactions:

In XML :

Code:
<talkaction log="yes" words="!antibot" event="script" value="antibot.lua"/>

And make a file antibot.lua :

Code:
--[[
    Anti Bot System by Potar
    ver.: 1.00 (2012-12-24)
    contact.: View Profile: Potar - OtLand
    file.: Talkaction
]]--


function onSay(cid, words, param, channel)
if AB_SYSTEM_get(cid,AB_SYSTEM_CAN_USE_TALKACTION) >= 1 then
    if(param == '') then
        AB_SYSTEM_send_player_white_text(cid, "Invalid param, just say !antibot "..AB_SYSTEM_get(cid,AB_SYSTEM_USER_RANDOM_NUMBER)..".")
        return true
    end
    if param == ''..AB_SYSTEM_get(cid,AB_SYSTEM_USER_RANDOM_NUMBER)..'' then
        AB_SYSTEM_set(cid, AB_SYSTEM_CAN_USE_TALKACTION, 0)
        AB_SYSTEM_set(cid, AB_SYSTEM_USER_RANDOM_NUMBER, 0)
        AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_RESPOND_WRONG, 0)
        AB_SYSTEM_send_player_white_text(cid, "Thank you for the correct answer.")
    else
        local player = getPlayerGUIDByName(cid)
        local account = getAccountIdByName(cid)
        local how = AB_SYSTEM_get(cid,AB_SYSTEM_TIMES_ALREADY_CAUGHT)
        local how2 = AB_SYSTEM_get(cid,AB_SYSTEM_TIMES_RESPOND_WRONG)
        local how3 = how2 + 1
        AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_RESPOND_WRONG, how3)
        local how5 = AB_SYSTEM_get(cid,AB_SYSTEM_TIMES_RESPOND_WRONG)
        AB_SYSTEM_send_player_white_text(cid, "Wrong secure code, your secure code is "..AB_SYSTEM_get(cid,AB_SYSTEM_USER_RANDOM_NUMBER).." that was your "..how3.." time of "..AB_SYSTEM_TIMES_WRONG.." wrong answers.")
        if how5 == 3 then
            AB_SYSTEM_set(cid, AB_SYSTEM_CAN_USE_TALKACTION, 0)
            AB_SYSTEM_set(cid, AB_SYSTEM_USER_RANDOM_NUMBER, 0)
            AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_RESPOND_WRONG, 0)
                if  how <= 0 then
                    AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 1)
                    doTeleportThing(cid, AB_SYSTEM_TELEPORT_TO)
                    AB_SYSTEM_send_player_white_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                elseif how == 1 then
                    AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 2)
                    doTeleportThing(cid, AB_SYSTEM_TELEPORT_TO)
                    AB_SYSTEM_send_player_white_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                elseif how >= 2 then
                    doTeleportThing(cid, AB_SYSTEM_TELEPORT_TO)
                    AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 0)
                    doAddAccountBanishment(account, player, AB_SYSTEM_BAN_LENGHT * 3600 + os.time(),12, ACTION_BANISHMENT, "Anti-Bot System")
                    doRemoveCreature(cid)
                end
        end
    end
else
AB_SYSTEM_send_player_white_text(cid, "The AntiBot system is not already avaiable for you.")
end
    return true
end

Lib:

Make a file 177-AntiBot.lua :

Code:
--[[
    Anti Bot System by Potar
    ver.: 1.00 (2012-12-24)
    contact.: View Profile: Potar - OtLand
    file.: LIB
]]--


AB_SYSTEM_CHECK_WHEN = 60 -- seconds, after kill monster --done
AB_SYSTEM_CHECK_LVL = 200 -- lvl player to check --done
AB_SYSTEM_TIME_AFTER_TP = 90 --(If player does not respond correctly after 1.5 minutes)
AB_SYSTEM_TIMES_WRONG = 3 --(If player does not respond correctly after 3 times)
AB_SYSTEM_TELEPORT_TO = {x = 659, y = 652, z = 7}
AB_SYSTEM_BAN_LENGHT = 12 --hours time before 3 time
AB_SYSTEM_TEXT_AFTER_TP = "You have beed moved to the place of botters and you recived warning keep playing but stop botting!"
AB_SYSTEM_BASE = 77000 -- this storage must be free, from 77000 to 77006 --done
AB_SYSTEM_KILLSTORAGE = AB_SYSTEM_BASE + 1 --done
AB_SYSTEM_TIMES_RESPOND_WRONG = AB_SYSTEM_BASE + 2
AB_SYSTEM_TIMES_ALREADY_CAUGHT = AB_SYSTEM_BASE + 3
AB_SYSTEM_IGNOREUSERS = AB_SYSTEM_BASE + 4 --done
AB_SYSTEM_CAN_USE_TALKACTION = AB_SYSTEM_BASE + 5 --done
AB_SYSTEM_USER_RANDOM_NUMBER = AB_SYSTEM_BASE + 6 --done

function AB_SYSTEM_get(cid, a_storage)
    return getPlayerStorageValue(cid, a_storage)
end

function AB_SYSTEM_set(cid, b_storage, b_value)
    setPlayerStorageValue(cid, b_storage, b_value)
end

function AB_SYSTEM_send_player_white_text(cid, text)
    doPlayerSendTextMessage(cid, 18, text)
end

function AB_SYSTEM_send_player_red_text(cid, text)
    doPlayerSendTextMessage(cid, 22, text)
end

function isOnline(player)
    local rows = db.getResult("SELECT `online` FROM `players` WHERE `id` = " .. player .. ";")
    local on = rows:getDataInt("online")
        if on ~= 0 then
            return TRUE
        else
            return FALSE
        end
end

function isSummon(cid)
    return getCreatureMaster(cid) ~= nil
end

Globalevent:

In XML :

Code:
<globalevent name="antibot" interval="1800000" event="script" value="antibot.lua"/>

And make a file antibot.lua :

Code:
--[[
    Anti Bot System by Potar
    ver.: 1.00 (2012-12-24)
    contact.: View Profile: Potar - OtLand
    file.: Globalevent
   
    Globalevent.xml :  <globalevent name="antibot" interval="1800000" event="script" value="antibot.lua"/>
    Interval: 1800000 = 1000 * 60 * 30 (30 minutes)
   
    On line 26 you can exchange message to player.
    On line 45, you can exchange last "1" to player ID who has banned the player, for example if your player ID is 2 just set it to 2.
]]--


function onThink(interval, lastExecution)
    for _, name in ipairs(getOnlinePlayers()) do
        local cid = getPlayerByName(name)
        local player = getPlayerGUIDByName(name)
        local account = getAccountIdByName(name)
        local value1 = AB_SYSTEM_get(cid,AB_SYSTEM_KILLSTORAGE)
        local value2 = AB_SYSTEM_CHECK_WHEN
        local value3 = value1 + value2
        if isPlayer(cid) and value3 >= os.time() and getPlayerLevel(cid) >= AB_SYSTEM_CHECK_LVL and AB_SYSTEM_get(cid,AB_SYSTEM_IGNOREUSERS) <= 0 and AB_SYSTEM_get(cid,AB_SYSTEM_CAN_USE_TALKACTION) <= 0 then
            AB_SYSTEM_set(cid, AB_SYSTEM_CAN_USE_TALKACTION, 1)
            AB_SYSTEM_set(cid, AB_SYSTEM_USER_RANDOM_NUMBER, math.random(10000,99999)) -- random number!
            AB_SYSTEM_send_player_white_text(cid, "[Anti Bot System] You have "..AB_SYSTEM_TIME_AFTER_TP.." seconds to say: !antibot "..AB_SYSTEM_get(cid,AB_SYSTEM_USER_RANDOM_NUMBER).." or you will be teleported, but if it is your "..AB_SYSTEM_TIMES_WRONG.." time you will be bannded.")
        --System   
        addEvent(function ()
        if isOnline(player) == TRUE then
            if AB_SYSTEM_get(cid,AB_SYSTEM_CAN_USE_TALKACTION) >= 1 then
                local how = AB_SYSTEM_get(cid,AB_SYSTEM_TIMES_ALREADY_CAUGHT)
                AB_SYSTEM_set(cid, AB_SYSTEM_CAN_USE_TALKACTION, 0)
                AB_SYSTEM_set(cid, AB_SYSTEM_USER_RANDOM_NUMBER, 0)
       
                if  how <= 0 then
                    AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 1)
                    doTeleportThing(cid, AB_SYSTEM_TELEPORT_TO)
                    AB_SYSTEM_send_player_white_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                elseif how == 1 then
                    AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 2)
                    doTeleportThing(cid, AB_SYSTEM_TELEPORT_TO)
                    AB_SYSTEM_send_player_white_text(cid, AB_SYSTEM_TEXT_AFTER_TP)
                elseif how >= 2 then
                    doTeleportThing(cid, AB_SYSTEM_TELEPORT_TO)
                    AB_SYSTEM_set(cid, AB_SYSTEM_TIMES_ALREADY_CAUGHT, 0)
                    doAddAccountBanishment(account, player, AB_SYSTEM_BAN_LENGHT * 3600 + os.time(),12, ACTION_BANISHMENT, "Anti-Bot System")
                    doRemoveCreature(cid)
                end
            end
        end
        end,AB_SYSTEM_TIME_AFTER_TP * 1000)
        --EndSystem
        end
    end
return true
end

This code was sold to one member (Extrodus) but he didn't pay the total amount.

Respect my work, and if you like it just give me REPUTATION points.
 
Last edited:
would be nice if you put a system of "report" the player, and place another system of punishment, punishment 1º: lose 7 levels , punishment 2º: lose 15 levels ... and show how punishment for a consultation on the website.
 
Would you happen to know if it works for TFS 0.2?

Kind Regards,
Eldin.
 
Tested on 0.4 rev 3XXX and 5XXX...

Try to change this function for different one.

Or tell me your rev.
 
it's pretty easy to skip by bots(at least some people says that), but I think it's mentioned in all threads with anti bot systems.
Not sure if orange text such as monsters voice is detected by bots too, but I saw scripts which can copy anti-bot text, therefore it bothers only non-botters, doesn't help at all
system is nice itself, though

Edit:
after searching in polish forums I managed to find elfbot script:
auto 500 foreach 'newmessages' $trainmsg {if [$trainmsg.isredtext] {if [$trainmsg.content ? 'Please type'] {say [$token.'$trainmsg.content'.3}}}
I've never used a bot so I'm not sure if this one works, maybe it helps you, idk
 
Last edited:
So you think there is possible to skip this system by BOT?

Bot can copy and paste (write / send) the random code to chat ?

I never met with a similar bot.


But if it's true i can really easy exchange some functions, for example code will be shows in ORANGE type ^_^.
 
I noticed the information about the player account is not getting registered in de database, the ban is sent, but as long the "value" line is blank, the player is not really banned. Any solutions? maybe the
doAddAccountBanishment(account, player, AB_SYSTEM_BAN_LENGHT * 3600 + os.time(), "Anti-Bot System", 1)
should be revised??

Im using the last rev 0.3


Edit:
it's pretty easy to skip by bots(at least some people says that), but I think it's mentioned in all threads with anti bot systems.
Not sure if orange text such as monsters voice is detected by bots too, but I saw scripts which can copy anti-bot text, therefore it bothers only non-botters, doesn't help at all
system is nice itself, though

Edit:
after searching in polish forums I managed to find elfbot script:
auto 500 foreach 'newmessages' $trainmsg {if [$trainmsg.isredtext] {if [$trainmsg.content ? 'Please type'] {say [$token.'$trainmsg.content'.3}}}
I've never used a bot so I'm not sure if this one works, maybe it helps you, idk

Elf bot does not work for 8.6+ ots, bt im using a 9.8x. I think it will help a lot o ppl, if we can manage to get the script working! But ty for this piece of advice!!

- - - Updated - - -

cmon guys help me!
 
Last edited:
would be nice if you put a system of "report" the player, and place another system of punishment, punishment 1º: lose 7 levels , punishment 2º: lose 15 levels ... and show how punishment for a consultation on the website.
 
This is the official released of this script that does not require any improvements, you can add additional services for yourself.
 
It does not show me the information,I don't have any errors ;/

PS: TFS 0.3.6pl
 
Try to change the number value in:

Lua:
function AB_SYSTEM_send_player_white_text(cid, text)
	doPlayerSendTextMessage(cid, 18, text) 
end
 
I change on, and dosen't work ;/
Code:
function AB_SYSTEM_send_player_white_text(cid, text)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, text)
end
 
function AB_SYSTEM_send_player_red_text(cid, text)
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, text)
end

Ciekawe ;/
 
Back
Top