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

TalkAction Autoheal check to find botters, TFS 1.1

Marcus

User.postCount++;
Joined
Nov 14, 2015
Messages
1,074
Solutions
10
Reaction score
392
Location
Sweden
With this you can easily detect whoever use auto-heal in your server.
It will remove nearly all health for 0.3 seconds and then give it back.
Look closely and see if the player cast a healing spell or use potion/rune within a little "too short" time.

Tip, Test a player when he looks half-afk so you can be certain he wont heal by himself..
Etc bad idea testing him if he's attacking a demon, he might have a finger on healing and might react to the health change.
talkaction to run it:
/autoheal PLAYERNAME
etc: /autoheal Eternal Oblivion

Enjoy it, and get those damn botters!
talkactions.xml

PHP:
<talkaction words="/autoheal" separator=" " script="auto_heal.lua" />

auto_heal.lua
PHP:
function onSay(player, words, param)
    if player:getGroup():getId() < 3 then
        return true
    end

    local name = param

    local separatorPos = param:find(',')
    if separatorPos ~= nil then
        name = param:sub(0, separatorPos - 1)
    end
    if name ~= "" then
        target = Player(name)
        if target then
            target:addHealth(-(target:getHealth()-50))
            addEvent(autoHeal_healthback, 300, target.uid)
            player:sendTextMessage(22, target:getName() ..": health was removed.")
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Player not found")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "/autoheal PLAYERNAME")
    end
    return true
end


function autoHeal_healthback(cid)
    target = Player(cid)
    target:addHealth(target:getMaxHealth())
    return true
end
 
I made some corrections to your code
Code:
function autoHeal_healthback(cid)
    target = Player(cid)
    if target then -- always check for the player, monster or whatever
        target:addHealth(target:getMaxHealth())
    end
    -- not needed
    -- return true
end

function onSay(player, words, param)
    if player:getGroup():getId() < 3 then
        return true
    end

    -- local name = param

   -- local separatorPos = param:find(',')
    -- if separatorPos ~= nil then
        param = param param:sub(0, param:find(',') - 1)
        --name = param:sub(0, separatorPos - 1)
    --end
    -- if name ~= "" then
    if param ~= "" then
        target = Player(param)
        if target then
            target:addHealth(-(target:getHealth()-50))
            addEvent(autoHeal_healthback, 300, target:getId())
            --addEvent(autoHeal_healthback, 300, target.uid)
            player:sendTextMessage(22, param ..": health was removed.")
            --player:sendTextMessage(22, target:getName() ..": health was removed.")
        else
            -- this makes more sense
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, param .." not found")
            --player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Player not found")
        end
    --else
        -- why is this here?
        --player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "/autoheal PLAYERNAME")
    end
    return true
end

So it should look like this in the end.
Code:
function autoHeal_healthback(cid)
    target = Player(cid)
    if target then
        target:addHealth(target:getMaxHealth())
    end
end

function onSay(player, words, param)
    if player:getGroup():getId() < 3 then
        return true
    end
 
    param = param:sub(0, param:find(',') - 1)

    if param ~= "" then
        target = Player(param)
        if target then
            target:addHealth(-(target:getHealth()-50))
            addEvent(autoHeal_healthback, 300, target:getId())
            player:sendTextMessage(22, param ..": health was removed.")
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, param .." not found")
        end
    end
    return true
end
 
Last edited:
Back
Top