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

Lua Using Antibot system and error in console

mRefaat

Marketing and Coding
Joined
Jan 18, 2014
Messages
959
Solutions
3
Reaction score
201
Location
Egypt
Hello,

I am using Antibot system and sometimes I find this error
Code:
[3:11:51.977] [Error - GlobalEvent Interface]
[3:11:51.977] In a timer event called from:
[3:11:51.987] data/globalevents/scripts/antibot.lua:onThink
[3:11:51.997] Description:
[3:11:52.007] (LuaInterface::luaGetCreatureStorage) Creature not found

[3:11:52.017] [Error - GlobalEvent Interface]
[3:11:52.022] In a timer event called from:
[3:11:52.027] data/globalevents/scripts/antibot.lua:onThink
[3:11:52.027] Description:
[3:11:52.037] data/globalevents/scripts/antibot.lua:30: attempt to compare number with boolean
[3:11:52.047] stack traceback:
[3:11:52.047]   data/globalevents/scripts/antibot.lua:30: in function <data/globalevents/scripts/antibot.lua:28>

and this is the antibot system by @Potar GlobalEvent - [Potar] Fully automatic 100% anti-bot system (Lib/Creature/Talk/Glob). (https://otland.net/threads/potar-fully-automatic-100-anti-bot-system-lib-creature-talk-glob.181047/)

using tfs 0.3.7 rev 5969
 
Try changing your data\globalevents\scripts\antibot.lua to this one
LUA:
--[[

    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) and 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
 
Last edited:
Back
Top