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
FREE Untrash SQM
#1
Untrash SQM

Untrash anything on sqm.
local LOCATION = { X = 12345, Y = 12345, Z = 5 } -- Location that you want to untrash.
local MOVE_CREATURES = false

if posz() == LOCATION.Z then
    local tile = gettile(LOCATION.X, LOCATION.Y, LOCATION.Z)
    if tile.itemcount > 1 then
        for _, item_tile in ipairs(tile.items) do
            if item_tile.id > 99 then
                local notMoveable = itemhasflags(item_tile.id, 13)
                if notMoveable and itemhasflags(item_tile.id, 11) == false then
                    printerror('Found item ' .. item_tile.id .. ' on location, but cannot move it.')
                    playsound('default')
                    flashclient()
                elseif notMoveable == false then
                    if reachlocation(LOCATION.X, LOCATION.Y, LOCATION.Z) then
                        local move_item_sqm = wheretomoveitem(LOCATION.X, LOCATION.Y, LOCATION.Z, true, 2)
                        if move_item_sqm.posx > 0 then
                            moveitems(item_tile.id, ground(move_item_sqm.posx, move_item_sqm.posy, move_item_sqm.posz), ground(LOCATION.X, LOCATION.Y, LOCATION.Z), 100)
                            wait(300, 500)
                        end
                    end
                end
            elseif MOVE_CREATURES then
                local move_item_sqm = wheretomoveitem(LOCATION.X, LOCATION.Y, LOCATION.Z, true, 1)
                if move_item_sqm.posx > 0 then
                    moveitems(item_tile.id, ground(move_item_sqm.posx, move_item_sqm.posy, move_item_sqm.posz), ground(LOCATION.X, LOCATION.Y, LOCATION.Z), 100)
                    wait(300, 500)
                end
            end
        end
    end
end

This script will save the items it finds on first run then it will move any other items it finds on further executions.
local LOCATION = { X = 12345, Y = 12345, Z = 5 } -- Location that you want to untrash.
local MOVE_CREATURES = false

if (posx() ~= LOCATION.X or posy() ~= LOCATION.Y) and posz() == LOCATION.Z then

    local tile = gettile(LOCATION.X, LOCATION.Y, LOCATION.Z)

    if CACHED_TILE_ITEMS == nil then
        CACHED_TILE_ITEMS = tile.items
    else
        if tile.itemcount > 1 then
            for _, item_tile in ipairs(tile.items) do
                local found_item = false
                for __, item_cached in ipairs(CACHED_TILE_ITEMS) do
                    if item_cached.id == item_tile.id then
                        found_item = true
                        break
                    end
                end

                if found_item == false and item_tile.id > 99 then
                    if itemhasflags(item_tile.id, 13) then
                        printerror('Found item ' .. item_tile.id .. ' on location, but cannot move it.')
                        playsound('default')
                        flashclient()
                    else        
                        if reachlocation(LOCATION.X, LOCATION.Y, LOCATION.Z) then
                            local move_item_sqm = wheretomoveitem(LOCATION.X, LOCATION.Y, LOCATION.Z, true, 2)
                            if move_item_sqm.posx > 0 then
                                moveitems(item_tile.id, ground(move_item_sqm.posx, move_item_sqm.posy, move_item_sqm.posz), ground(LOCATION.X, LOCATION.Y, LOCATION.Z), 100)
                                wait(300, 500)
                            end
                        end
                    end
                elseif item_tile.id == 99 then
                    local move_item_sqm = wheretomoveitem(LOCATION.X, LOCATION.Y, LOCATION.Z, true, 1)
                    if move_item_sqm.posx > 0 then
                        moveitems(item_tile.id, ground(move_item_sqm.posx, move_item_sqm.posy, move_item_sqm.posz), ground(LOCATION.X, LOCATION.Y, LOCATION.Z), 100)
                        wait(300, 500)
                    end
                end
            end
        end
    end
end

keywords: untrash location, untrash location, remove trash sqm
Reply

#2
when parcel is on the spot defined to untrash, script does not untrash the spot (works with chairs etc, but not stamped parcel/parcel)
Reply

#3
There is nothing in the code that makes a distinction regarding a parcel. Please, debug and tell me the line number and function that's failing. Because I'm out of time right now and I won't have enough time available to run tests in the next few days
Reply

#4
I need an action that removes the wheat and then uses the scythe
'why is he going to use the scythe he doesn't use it because there's wheat on top
Reply

#5
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Please, next time create your own thread. This isn't a thread to post requests.
local SCYTHE_ID = 3453
local WHEAT_ID = 3653
local BOUNCH_WHEAT_ID = 3605
local WHEAT_LOCATION = { X = 12345, Y = 12345, Z = 7 }
local BACKPACK = 'red backpack'
local PICKUP_WHEAT = false

local item = topitem(WHEAT_LOCATION.X, WHEAT_LOCATION.Y, WHEAT_LOCATION.Z, false)
while item.id == BOUNCH_WHEAT_ID or item.id == WHEAT_ID do
    if item.id == BOUNCH_WHEAT_ID then
        if PICKUP_WHEAT then
            moveitems(BOUNCH_WHEAT_ID, BACKPACK, ground(WHEAT_LOCATION.X, WHEAT_LOCATION.Y, WHEAT_LOCATION.Z), 100)
            wait(400, 800)
        else
            local where = wheretomoveitem(WHEAT_LOCATION.X, WHEAT_LOCATION.Y, WHEAT_LOCATION.Z)
            moveitems(BOUNCH_WHEAT_ID, ground(where.posx, where.posy, where.posz), ground(WHEAT_LOCATION.X, WHEAT_LOCATION.Y, WHEAT_LOCATION.Z), 100)
            wait(400, 800)
        end
    elseif item.id == WHEAT_ID then
        useitemon(SCYTHE_ID, WHEAT_LOCATION.X, WHEAT_LOCATION.Y, WHEAT_LOCATION.Z)
        wait(400, 800)
    end
    item = topitem(WHEAT_LOCATION.X, WHEAT_LOCATION.Y, WHEAT_LOCATION.Z, false)
end
Reply

#6
is this an action to use in cavebot or is it a script to use in persistent?
Reply

#7
|Only Registered members can see download links. | Click here to buy subscription or here to register.

That depends on you... Both tools (Cavebot and Persistents) can run LUA scripts, but the deal is how it works.
Cavebot -> Action runs a LUA script when you reach that Action wpt.
Persistent runs the script from time to time.
Reply

#8
I understand thank you very much
|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="Big Grin" title="Big Grin" class="smilie smilie_4" />
Reply

#9
19:07:35 - LUA Script -> Cavebot/Action:13: 8: attempt to index a nil value (global 'item')
Reply

#10
|Only Registered members can see download links. | Click here to buy subscription or here to register.
I've updated it, try again.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016