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
Skinning using obsidian knife, checking condition of obsidian knife
#1
Is it possible to also skin each looted monster? and check when the obsidian knife kneeds regenerated in order to refill and go talk to npc(I think I can handle this part)
Reply

#2
Hello.

I didn't tested this code, but i think this will work.
This script will skin bodies after looting is done and there are no more bodies to loot.

Notice that you MUST change the "SETTINGS.KNIFE_ID" to the obsidian knife id and SETTINGS.BODIES with the id of each body that you wanna use obsidian knife on.

The easiest way to find out bodies ids is by killing monster and using HUD->Show cursor info. Once you enable this option, you just need to move your mouse over the body and a simple hud will be displayed telling the item id, which will be the body id.

local SETTINGS = {
    KNIFE_ID = 1234, -- Obsidian knife id
    MAX_RANGE = 5, -- Max range/distance away to skin bodies
    BODIES = { 1234, 4321, 5432 } -- Bodies IDs that you wanna skin.
}

if maround() == 0 and islooting() == false and lootbodies() == 0 then
    local tiles = gettiles()
    local player_x, player_y, player_z = posx(), posy(), posz()
    for _, tile in ipairs(tiles) do
        if tile.posz == player_z and math.abs(player_x - tile.posx) <= SETTINGS.MAX_RANGE and math.abs(player_y - tile.posy) <= SETTINGS.MAX_RANGE and tile.itemcount > 1 and table.find(SETTINGS.BODIES, tile.topitem.id) ~= nil and tilereachable(tile.posx, tile.posy, tile.posz, false) then
            pausewalking(5000)
            if iswalking() then
                stop()
                wait(200)
            end

            local flag = true
            if proximity(player_x, player_y, tile.posx, tile.posy) > 1 then
                flag = reachlocation(tile.posx, tile.posy, tile.posz, false)
                wait(300, 800)
            end

            if flag then
                useitemon(SETTINGS.KNIFE_ID, tile.posx, tile.posy, tile.posz)
                wait(500, 800)
            end
        end
    end
    pausewalking(0)
end

Or this script, which tries to skin closest corpses first.
local SETTINGS = {
    KNIFE_ID = 1234, -- Obsidian knife id
    MAX_RANGE = 5, -- Max range/distance away to skin bodies
    BODIES = { 1234, 4321, 5432 } -- Bodies IDs that you wanna skin.
}

if islooting() == false and lootbodies() == 0 then
    local tiles = gettiles()
    local player_x, player_y, player_z = posx(), posy(), posz()
    local monsterCount = maround()
    local closestCorpse = { x = 0, y = 0, dist = -1, id = 0 }

    for _, tile in ipairs(tiles) do
        if tile.posz == player_z and math.abs(player_x - tile.posx) <= SETTINGS.MAX_RANGE and math.abs(player_y - tile.posy) <= SETTINGS.MAX_RANGE and tile.itemcount > 1 and table.find(SETTINGS.BODIES, tile.topitem.id) ~= nil and tile.hascreature == false then
            local dist = proximity(player_x, player_y, tile.posx, tile.posy)
            if (closestCorpse.dist == -1 or closestCorpse.dist > dist) and (monsterCount == 0 or dist <= 1) and (dist <= 1 or tilereachable(tile.posx, tile.posy, tile.posz, false)) then
                closestCorpse.x = tile.posx
                closestCorpse.y = tile.posy
                closestCorpse.dist = dist
                closestCorpse.id = tile.topitem.id
            end
        end
    end

    if closestCorpse.dist ~= -1 then
        pausewalking(5000)
        if iswalking() then
            stop()
            wait(200)
        end

        local flag = true
        if closestCorpse.dist > 1 then
            flag = reachlocation(closestCorpse.x, closestCorpse.y, player_z, false)
            wait(300, 500)
        end

        if flag then
            useitemon(SETTINGS.KNIFE_ID, closestCorpse.x, closestCorpse.y, player_z)
            wait(500, 800)
        end

        pausewalking(0)
    end
end

About checking when obsidian knife needs to be regenerated then you need to check if obsidian knife changes when it's "out" then you can use itemcount() to know when it's out.
Example:
local OBS_KNIFE_ID_OUT = 1234

if itemcount(OBS_KNIFE_ID_OUT) then
    gotolabel('GO_REFILL_OBSIDIAN')
end
Reply

#3
Ty. Is there any way to make cavebot not turn around on each node? like ctrl + direction each node?
Reply

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

Hello.

Yes, disable WASD. Bot is pressing CTRL+W to clean status message, but as you are using WASD then it turns north.
Reply

#5
Im having trouble getting this to work, after it finishes looting it just continues to the next waypoint. I tried to put a print statement and it looks like it's not getting past the first statement
Reply

#6
Hello.

So I believe Looter has still bodies to loot...

Try change this line:
if maround() == 0 and islooting() == false and lootbodies() == 0 then
with
if maround() == 0 and islooting() == false then
Reply

#7
Hiya im trying to make it not stand on corpses so it can skin them, as it's getting stuck.

so if I do

if tile.posx == player_x and tile.pozy == player_y then
moveemptydirection
end

Is there any command which moves into any available space? If not how would I check if it's possible to move for each direction>
Reply

#8
Hello.

Maybe it's easier to move your character instead item?

Anyway, you can use both functions below.
moveitems(string item, string to, string from, optional in count) [boolean]Moves items based on its name or id.
wheretomoveitem(number fromX, number fromY, number fromZ) [table]: Return a table with information about the tile you can move an item to from the specified location. That's useful when you want to untrash
local where = wheretomoveitem(tile.posx, tile.posy, tile.posz)
if where ~= nil and where.posx > 0 then
    moveitems(0, ground(where.posx, where.posy, where.posz), ground(tile.posx, tile.posy, tile.posz), 100)
end
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Reply

#9
for this is there anyway i can make it so it'll do it while its killing things?

also where in the code do i put it so it'll move my character

and is there a way i can have it skin the ones closest to my character first cause it just goes in a order so if it fails on 1 it walks few steps away to the next one then back until it finishes
Reply

#10
also instead of having it wait like 10 seconds before cavebot enables again or it starts walking can it be like if no bodys start walking again?
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016