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
corpse above lootbag
#1
Can anyone help me writing this script?
I am trying to improve the lootbag depositer action. The thing is, sometime the moster dies on the lootbag that is on the ground.
So, i need a script to move the monster corpse if there is any corpse above the lootbag.

#2
Hello.

I didn't tried this script, but should work.

LOCATION = Location where the lootbag is.

LOOTBAG_ID = Id of the container that you are using as lootbag. If you are using a brown bag or red backpack for example then you write its id. It's possible to use the container name, because the script itself will use itemid to find search for the id of the name that you use. But it's recommended to use id directly instead of name.

ALERTS = Play alert on 3 specific situations:
1. If non-moveable item has been found, such as fire field;
2. Could not find the specified lootbag on sqm;
3. Failed to find a sqm to move the trash from the lootbag sqm.

If you are going to use on Cavebot->Action then I recommend you to use islocation() or islocationxyz() to make sure you have the lootbag on screen.

local LOCATION = { X = 12345, Y = 12345, Z = 6 }
local LOOTBAG_ID = 1234 -- Lootbag container id.
local ALERTS = true -- Alert if item not moveable on sqm (e.g.: fire field), could not find lootbag or failed to find sqm to move trash.

if type(LOOTBAG_ID) == 'string' then
    local tmp = tonumber(LOOTBAG_ID)
    if tmp ~= nil then
        LOOTBAG_ID = tmp
    else
        LOOTBAG_ID = itemid(LOOTBAG_ID)
    end
end

if LOOTBAG_ID > 0 then
    local tile_item = topitem(LOCATION.X, LOCATION.Y, LOCATION.Z, false)
    while tile_item.id > 0 and tile_item.id ~= LOOTBAG_ID do
        local flags = itemflags(tile_item.id)
        if table.find(flags, 13) then
            if ALERTS then
                print('Found not moveable item on Lootbag SQM: ' .. tile_item.id)
                playsound('default')
                flashclient()
            end
            break
        elseif table.find(flags, 0) or table.find(flags, 30) then
            if ALERTS then
                print('Could not find Lootbag on the specific SQM.')
                playsound('default')
                flashclient()
            end
            break
        end
        local where = wheretomoveitem(LOCATION.X, LOCATION.Y, LOCATION.Z, true, 2)
        if where.posx <= 0 then
            if ALERTS then
                print('Could not find a sqm to move trash.')
                playsound('default')
                flashclient()
            end
            break
        end
        
        moveitems(tile_item.id, ground(where.posx, where.posy, where.posz), ground(LOCATION.X, LOCATION.Y, LOCATION.Z), 100)
        wait(500, 700)
        tile_item = topitem(LOCATION.X, LOCATION.Y, LOCATION.Z, false)
    end
end



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016