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
Fire Field Runner
#1
Hello,

I would need simple script, when monster throw fire field under my character, it gonna moves as fast as possible to sqm without fire.

Best regards
Reply

#2
Will Targeting and Cavebot be enabled? Because the script would need to consider and pause those tools.
Should the script do that only when Targeting? There's any other requirement?

Please think carefully. So that I don't have to rework and depending on what it is, once i finish developing the script the way you wrote, I would no longer help you.
Reply

#3
Yes targeting and cavebot should be enabled.

Scenario should look like this:

Im fighting monster, if monster throw fire field under me, my character moves to safe spot without fire field, and if he is not standing on fire field anymore, he continues to attack monster. If monster is dead my character should continue walk on cavebot.
Reply

#4
Thanks for the information.
|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="Smile" title="Smile" class="smilie smilie_1" />

Are you standing next to the monster or keep away from it?
Are you using Chase (Attack mode -> Chase/Ofensive, etc.) or Stances (reach, circle, keep away, etc) to reach monsters? If it's a stance, which one? I need to consider that to find sqm to walk.
Reply

#5
Im using stance: "Reach" and standing next to the monster.
Reply

#6
Hello.

Try this code. If you are standing at one of the listed fields then it will find an sqm around the monster to stand at.
This script should only be used when you are reaching creatures that you are attacking like Chase mode, Reach stance, Circle stance, etc., but not with distance stances like Keep Away, Lure, etc.

You can test if the script is working by adding gold coin id on FIELDS_IDS and add a creature on Targeting then let it attack the creature. When it starts attacking then drop a gold coin under your character, so it will try to find another place around the creature to walk.
local FIELDS_IDS = { 2118, 2119, 2123, 2124, 2131, 2132, 2137, 2138 } -- Fields IDs to avoid

if connected() and hastarget() then
    local attackedCreature = attacked()
    if attackedCreature.id > 0 and attackedCreature.hppc > 0 and attackedCreature.dist <= 1 then
        local playerX, playerY, playerZ = posx(), posy(), posz()
        local foundFieldOnCharacterSqm = false
        local tile = gettile(playerX, playerY, playerZ)
        for _, item in ipairs(tile.items) do
            if table.find(FIELDS_IDS, item.id) ~= nil then
                foundFieldOnCharacterSqm = true
                break
            end
        end

        if foundFieldOnCharacterSqm then
            local closestSqm = { X = 0, Y = 0, Z = 0, Dist = 999 }
            for x = -1, 1 do
                for y = -1, 1 do
                    if x ~= 0 and y ~= 0 then
                        local tile = gettile(attackedCreature.posx + x, attackedCreature.posy + y, playerZ)
                        if tile ~= nil and tile.itemcount > 0 then
                            local fieldFound = false
                            for _, item in ipairs(tile.items) do
                                if table.find(FIELDS_IDS, item.id) ~= nil then
                                    fieldFound = true
                                    break
                                end
                            end

                            if fieldFound == false and closestSqm.Dist > proximity(playerX, playerY, attackedCreature.posx + x, attackedCreature.posy + y) then
                                closestSqm = { X = tile.posx, Y = tile.posy, Z = tile.posz, Dist = proximity(playerX, playerY, attackedCreature.posx + x, attackedCreature.posy + y) }
                            end
                        end
                    end
                end
            end

            if closestSqm.X > 0 then
                pausewalking(3000)
                reachlocation(closestSqm.X, closestSqm.Y, closestSqm.Z)
                wait(100, 200)
                pausewalking(0)
            end
        end
    end
end

Or

local FIELDS_IDS = { 2118, 2119, 2123, 2124, 2131, 2132, 2137, 2138 } -- Fields IDs to avoid

if connected() and hastarget() then
    local attackedCreature = attacked()
    if attackedCreature.id > 0 and attackedCreature.hppc > 0 and attackedCreature.dist <= 1 then
        local playerX, playerY, playerZ = posx(), posy(), posz()
        local foundFieldOnCharacterSqm = false
        local tile = gettile(playerX, playerY, playerZ)
        for _, item in ipairs(tile.items) do
            if table.find(FIELDS_IDS, item.id) ~= nil then
                foundFieldOnCharacterSqm = true
                break
            end
        end

        if foundFieldOnCharacterSqm then
            local closestSqm = { X = 0, Y = 0, Z = 0, Dist = 999 }
            local tiles = gettiles()
            for _, tile in ipairs(tiles) do
                if tile ~= nil and tile.itemcount > 0 and tile.posx ~= attackedCreature.posx and tile.posy ~= attackedCreature.posy and math.abs(tile.posx - attackedCreature.posx) <= 1 and math.abs(tile.posy - attackedCreature.posy) <= 1 then
                    local fieldFound = false
                    for __, item in ipairs(tile.items) do
                        if table.find(FIELDS_IDS, item.id) ~= nil then
                            fieldFound = true
                            break
                        end
                    end

                    if fieldFound == false and closestSqm.Dist > proximity(playerX, playerY, tile.posx, tile.posy) then
                        closestSqm = { X = tile.posx, Y = tile.posy, Z = tile.posz, Dist = proximity(playerX, playerY, tile.posx, tile.posy) }
                    end
                end
            end

            if closestSqm.X > 0 then
                pausewalking(3000)
                reachlocation(closestSqm.X, closestSqm.Y, closestSqm.Z)
                wait(100, 200)
                pausewalking(0)
            end
        end
    end
end
Reply

#7
Thank you, gonna check if it works and msg after.

There is some problem, I got this error in console:

LUA Script -> Run fire: 32: attempt to perform arithmetic on a KasteriaOTBot.Core.Lua+CreatureInfo, Build, Version=1.1.27.6, Culture=neutral, PublicKeyToken=null value (local 'attackedCreature')
Reply

#8
Hello.

Just fixed it. Please, try again.
Reply

#9
It works buuuuut sometimes he moves instantly, but another time it takes too long to move. I need character to move instantly otherwise he would be dead after few secs.
Reply

#10
Then use lower intervals on your Persistent, because the only delay on script is 500ms AFTER moving.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016