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

Antibot for 0.4

Elgenady

Veteran OT User
Joined
Aug 5, 2011
Messages
1,637
Solutions
35
Reaction score
351
this system work on 0.4
first go to creaturescript make file name antibot.lua
Code:
local key = 125

function onKill(cid, target)
if isMonster(target) and getPlayerLevel(cid) >= 250 and getCreatureMaxHealth(target) >= 500 and getCreatureMaster(target) == nil and getPlayerStorageValue(cid, 126) == -1 then
local n = math.max(0, getCreatureStorage(cid, key)) + 1
setPlayerStorageValue(cid, key, n)
if n >= 901 then
local add, a, b, r = math.random(2) == 1
if add then
a, b = math.random(20), math.random(20)
else
a = math.random(5, 25)
b = math.random(a-1)
end
doPlayerPopupFYI(cid, "Please answer this question within 5 minutes to avoid being dead and lost more exp: " .. a .. (add and "+" or "-") .. b .. " = ?\nExample 1+1: !answer 2")
setPlayerStorageValue(cid, 126, ',' .. a .. (add and "+" or "-") .. b)
setPlayerStorageValue(cid, 127, add and a+b or a-b)
setPlayerStorageValue(cid, 128, os.time() + 300)
end
end
return true
end

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

in login
registerCreatureEvent(cid, "Antibot")


now go to globalevent and make file name antibot.lua
Code:
local tp = {
         {x =xxxx , y = xxxx, z = x},
         {x = xxxx, y = xxxx, z = x}, --- where anti afk monster
         {x =xxxx, y = xxxx, z = x}
            }
     
function onThink()
    for _, cid in ipairs(getPlayersOnline()) do
        local t = getCreatureStorage(cid, 128)
        if t ~= -1 then
            if os.time() >= t then
                for i = 125, 128 do
                    doCreatureSetStorage(cid, i)
                end
                --[[
                doBroadcastMessage(getCreatureName(cid) .. ' has been banned for 2 days for afk botting.')
                doAddAccountBanishment(getPlayerAccountId(cid), getPlayerGUID(cid), os.time() + 2 * 86400, 12, 2, 'Banished by Antibot System', 0)
                doRemoveCreature(cid)
                ]]
                doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 200)
                doTeleportThing(cid, tp[math.random(#tp)])
            else
                 doSendAnimatedText(getThingPos(cid), tostring(getCreatureStorage(cid, 126)):sub(2) ..' = ?', COLOR_RED, cid)
                --[[local my = getThingPos(cid)
                for _, p in ipairs(getArea(my, 1, 1)) do
                    if doComparePositions(my, p) == false then
                        doSendMagicEffect(p, 31)
                    end
                end
                ]]
            end
        end
    end
    return true
end

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

in globalevents/scripts/start add
Code:
db.executeQuery('DELETE FROM player_storage WHERE `key` IN(126,127,128)')

now go to talkaction and make file name antibot.lua
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 6000)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 4)

function onSay(cid, words, param, channel)
    local a = getCreatureStorage(cid, 127)
    if a == -1 then
        return true
    end

    if param == '' or tonumber(param) == nil then
        doCreatureSay(cid, 'Invalid answer.', TALKTYPE_ORANGE_1, false, cid)
    elseif hasCondition(cid, CONDITION_EXHAUST, 4) then
        doPlayerSendCancel(cid, 'Please wait before answering again.')
    elseif tonumber(param) ~= a then
        doAddCondition(cid, exhaust)
        doCreatureSay(cid, 'Incorrect answer.', TALKTYPE_ORANGE_1, false, cid)
    else
        for i = 125, 128 do
            setPlayerStorageValue(cid, i)
        end
        doCreatureSay(cid, 'Thank you for not afking!', TALKTYPE_ORANGE_1, false, cid)
    end
    return true
end

in talkaction.xml
Code:
<talkaction words="!answer" event="script" value="antibot.lua"/>

this system 100% like masiyah .se
for fast test change this in creaturescript
if n >= 901 then for if n >= 10 then
this mean bot will check the player when kill 10 monster only
like if this post help you
 
Last edited:
Back
Top