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
Advanced cure poison
#1
Hello!

I need a script which cures poison only when the poison takes more than 4 hp points per round and preferably when there is no monster on screen (to avoid casting the spell mid-battle).

Thanks!

#2
Hello.


There are 2 approaches for it.

1. Default messages
You would need to let default channel selected and also depends how the damages displays for you, because there are two (or more) poisoned dmg messages:
A. "You lose 3 hitpoints."
B. "You lose 1 hitpoint due to an attack by a swamp troll."
local Monsters = { 'Scarab', 'Larva', 'Scorpion' }

if poisoned() and mp() >= 30 and cancast() and maround(0, table.unpack(Monsters)) == 0 then
    local msgs = getnewmessages()
    for _, msg in ipairs(msgs) do

        local dmgAmount = msg.content:match("You lose (%d-) hitpoints.")
        if dmgAmount ~= nil then
            dmgAmount = tonumber(dmgAmount)
            if dmgAmount ~= nil and dmgAmount >= 4 then
                cast('exana pox')
                wait(800)
                break
            end
        else
            local dmg, name = msg.content:match("You lose (%d-) .+ due to an attack by (.-)%.")
            if dmg ~= nil then
                dmg = tonumber(dmg)
                if dmg ~= nil and dmg >= 4 then
                    cast('exana pox')
                    wait(800)
                    break
                end
            end
        end
    end
end

2. Checking health points
That's not 100% accurate. It's gonna cast exana pox if there's no monsters around and you are poisoned and loses 3 or more hp.
I didn't tested this script. So if it didn't works, you can have some idea how it works.
local dmgHP = 3 -- Min. damage to cast exana pox.
local Monsters = { 'Scarab', 'Larva', 'Scorpion' } -- Monsters to check. If no such monsters and poisoned then cast exana pox.


HasCreatures = HasCreatures or true
LAST_HP = LAST_HP or 0

if poisoned() and mp() >= 30 and cancast() then
    if maround(0, table.unpack(Monsters)) > 0 then
        HasCreatures = true
        LAST_HP = 0
    else
        local current_hp = hp()
        if HasCreatures == false and LAST_HP > 0 then
            if LAST_HP > current_hp and (LAST_HP - current_hp) >= dmgHP then
                cast('exana pox')
                wait(800)
            end
            LAST_HP = hp()
        else
            HasCreatures = false
            LAST_HP = hp()
        end
    end
else
    LAST_HP = 0
end

#3
tried both, not working
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Sad" title="Sad" class="smilie smilie_8" />

but my server has "server log", not default

#4
Both scripts works.

If you wanna use the first script then use it and leave "Server Log" selected instead of Default channel.

The second script is bit slower and not quite accurate because it only checks dmg received after no monsters on screen, so you character could heal while that or even while Persistent is under delay.
So you must use with low persistent intervals like 100ms to 100ms AND/OR change dmgHP to something bit lower like 3, so if you heal like 2 hp between checks, it would still cast exana pox.

#5
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Tried both, with 100-100 ms, not working
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Sad" title="Sad" class="smilie smilie_8" />
Server log open
Server: tibiascape
Tried with 6 hp, 4hp, 3hp, 2hp
Message is like: 13:18 You lose 5 hitpoints.
Tried both at same time and isolated too



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016