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

TalkAction AntiBot System

Onizuka

Member
Joined
Jul 5, 2008
Messages
2,291
Reaction score
14
Before i post anything, i'd like to give Credits to the people who made this script.

@Credits: Karpio - Tibia.net.pl

Also if there is a problem with the script being posted here, please contact me via pm, ( don't need any noob-fight between me and another member's. )

My friend showed me it few minutes ago and it works amazing. Didn't ask him how he got it so can't name the person who made the script.

Works fine on tfs 3.6pl1

LUA:
local config = {
code = 999,
ptime = 998, -- player time storage
ttime = 997, -- target time storage
nick = false,
afk = false, -- if you use afk system set it to: true
afks = 996 -- storage of your afk system
}
local function randomCode()
    return math.random(1000, 9999)
end
local function czas(timeDiff)
    local dateFormat = { 
        {"day", timeDiff / 60 / 60 / 24},
        {"hour", timeDiff / 60 / 60 % 24},
        {"minute", timeDiff / 60 % 60},
        {"second", timeDiff % 60}
    }
    local out = {}
    for k, t in ipairs(dateFormat) do
        local v = math.floor(t[2])
        if(v > 60) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or ' and ') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        elseif(v > 0) then
            table.insert(out, (k < #dateFormat and (#out > 0 and ', ' or '') or '') .. v .. ' ' .. t[1] .. (v ~= 1 and 's' or ''))
        end
    end
    return table.concat(out)
end  
local function check(cid, target)
    local code = randomCode()
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You check "..getCreatureName(target)..".")
    doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "[AntiBot]: "..(config.nick == true and getCreatureName(cid) or "Someone").." check you. You must write /check "..code.." if you don't want be banished. You have only 6 minutes.")
    setPlayerStorageValue(target, config.code, code)
    setPlayerStorageValue(target, config.ttime, os.time() + (3 * 60 * 60))
    setPlayerStorageValue(cid, config.ptime, os.time() + (3 * 60 * 60))
    addEvent(function()
        if(isPlayer(target) == false) then
            return false
        elseif(getPlayerStorageValue(target, config.code) == 0) then
            return false
        end
        doPlayerSendTextMessage(target, MESSAGE_STATUS_WARNING, "[AntiBot]: You only have 1 minute. Please write /check "..getPlayerStorageValue(target, config.code)..".")
        addEvent(function()
            if(isPlayer(target) == false) then
                return false
            elseif(getPlayerStorageValue(target, config.code) == 0) then
                return false
            end
            doAddAccountBanishment(getPlayerAccountId(target), target, os.time() + 36 * 3600, 12, 2, 'Banished by AntiBot System', 0)
            doRemoveCreature(target)
        end, 60 * 1000, {target = target, config = config})
    end, 5 * 60 * 1000, {target = target, config = config, cid = cid})
end
function onSay(cid, words, param, channel)
    if(param == "") then
        return doPlayerPopupFYI(cid, "Welcome to AntiBot Information.\nMini tutorial:\n/check nick - if you want check player with name nick\n/check code - if someone check you\n\nYou can check next player "..((getPlayerStorageValue(cid, config.ptime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ptime) - os.time()) or "now")..".\nYou can check "..((getPlayerStorageValue(cid, config.ttime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ttime) - os.time()) or "now")..".")
    elseif(isNumber(param) == true) then
        if(getPlayerStorageValue(cid, config.code) < 1) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: If you want check code, you must be checked by other player.")
        elseif(getPlayerStorageValue(cid, config.code) ~= tonumber(param)) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Invalid code.")
        end
        setPlayerStorageValue(cid, config.code, 0)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Code is correct.")
        return true
    else
        if(getPlayerByNameWildcard(param) == nil) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: Target not found.")
        elseif(getPlayerByNameWildcard(param) == tonumber(cid)) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check yourself.")
        elseif(getTileInfo(getCreaturePosition(cid)).protection == true) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check players if you are in protection zone.")
        elseif(getTileInfo(getCreaturePosition(getPlayerByNameWildcard(param))).protection == true) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this players, because "..(getPlayerSex(getPlayerByNameWildcard(param)) == 0 and "she" or "he").." is in protection zone.")
        elseif(config.afk and getPlayerStorageValue(cid, config.afks) > 0) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check players if you are afk.")
        elseif(config.afk and getPlayerStorageValue(getPlayerByNameWildcard(param), config.afks) > 0) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this players, because "..(getPlayerSex(getPlayerByNameWildcard(param)) == 0 and "she" or "he").." is afk.")
        elseif(getPlayerStorageValue(cid, config.ptime) > os.time()) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You must wait before checking next player.")
        elseif(getPlayerStorageValue(getPlayerByNameWildcard(param), config.ttime) > os.time()) then
            return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "[AntiBot]: You can not check this player.")
        end
        check(cid, getPlayerByNameWildcard(param))        
    end
return true
end

LUA:
<talkaction words="/check" event="script" value="antibot.lua"/>


Here you change the time for banishment.

Code:
doAddAccountBanishment(getPlayerAccountId(target), target, os.time() + 36 * 3600, 12, 2, 'Banished by AntiBot System', 0)
The 36 is the hours.

The script is quite simple.

Type /check to check info about the system.
Type /check nick to check a botter, he has 15 minutes to type or he get's a ban for 2 days.
You can't check you'r self, Also while in pz you can't use it.
From the code it seems like 1 player can be reported each 6 hours.

Credits: Unknown, sorry. I'll ask my friend later who the credits belong to. For now it's unknown.
If any errors please post. Works fine on tfs 3.6pl1

Regards,
Anco.

@
44146858.jpg





wwwkn.jpg



P.S If someone has posted this before, then I'am truly sorry for posting it again and i will remove asap.
 
Last edited:
Gratz, System Anty-Boterski (;-Tibia 8.54 - Tibia.net.pl

This script comes from Tibia.net.pl, wrote him Karpio has released him with his consent, I

If your friend gave it to you delete very important line.

PHP:
return doPlayerPopupFYI(cid, "Welcome in AntiBot Information.\nScript author: Karpio\nScript Version: 1.1\n\nMini tutorial:\n/check nick - if you want check player with name nick\n/check code - if someone check you\n\nYou can check next player "..((getPlayerStorageValue(cid, config.ptime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ptime) - os.time()) or "now")..".\nYou can be check "..((getPlayerStorageValue(cid, config.ttime) - os.time()) > 0 and "after "..czas(getPlayerStorageValue(cid, config.ttime) - os.time()) or "now")..".")

PHP:
doAddAccountBanishment(getPlayerAccountId(target), target, os.time() + 48 * 3600, 12, 2, 'Banished by AntiBot System by Karpio', 0)
 
Last edited:
I posted i got the script as it is, and didn't know who did create it.
 
Hmm weird.. I tested on a character and it worked right it told him.

"16:43 [AntiBot]: Someone check you. You must write /check 6128 if you don't want be banished. You have only 6 minutes."

Yet when he wrote /check 6128 he even tried /6128 it still banned him.

any suggestions?
 
I have one bug (TFS 0.31):

Code:
[28/03/2010 14:21:14] data/talkactions/scripts/antibot.lua:50: attempt to call global 'doAddAccountBanishment' (a nil value)
[28/03/2010 14:21:14] stack traceback:
[28/03/2010 14:21:14] 	data/talkactions/scripts/antibot.lua:50: in function <data/talkactions/scripts/antibot.lua:44>

Please help. Acc of player don't have banishment.
 
Somebody know how to do players can't check characters if he/she is in no-log out zone ?
 
Back
Top