Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script to avoid UH block
#1
Hi!

Sometimes players stand on my character and that makes all my UHs heal the other player instead of me and if they have trapped me, it kills my character pretty fast because it wont heal.

Is it possible to make the bot move if someone tries to stand on me or is there another way for the UH to heal so it does not heal the other player?

Thanks in advance!
Reply

#2
Hello.

This script will check if there are any players on same sqm you are when you are healing then randomly move.
if connected() and ishealing() then
    local playerSameSqm = false
    local playerId = id()
    local playerX, playerY, playerZ = posx(), posy(), posz()
    local creatures = getcreatures('pfs')
    for _, creature in ipairs(creatures) do
        if creature.id ~= playerId and creature.posx == playerX and creature.posy == playerY and creature.posz == playerZ then
            playerSameSqm = true
            break
        end
    end
    
    if playerSameSqm then
        move(random(1,3))
        wait(200, 400)
    end
end

The same what script above does, but instead of checking if you are healing, it will check based on health %, if you are under X % then avoid being on same sqm than players. So you can setup health % higher than actual % to heal.
Example: If your UH heal rule is on 50% then setup this on 55% or 60%, even higher depending on hunt monsters. So your character would avoid staying on same sqm when you are about to heal or healing.
local HEALTH_PC = 55 -- Health % to avoid stay on same with more players.

if connected() and hppc() <= HEALTH_PC then
    local playerSameSqm = false
    local playerId = id()
    local playerX, playerY, playerZ = posx(), posy(), posz()
    local creatures = getcreatures('pfs')
    for _, creature in ipairs(creatures) do
        if creature.id ~= playerId and creature.posx == playerX and creature.posy == playerY and creature.posz == playerZ then
            playerSameSqm = true
            break
        end
    end
    
    if playerSameSqm then
        move(random(1,3))
        wait(200, 400)
    end
end
Reply

#3
Thanks!
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016