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
Detect itemID on screen and press it
#1
Hi, i need a script that does detect ItemID and use it or right click on it until it disapears


exempel

local ItemIdPress = itemid1, itemid2, itemid3 -- add amount of items to search and press

press- loop until it is used or disapeard - 


2: checker if ItemIDpress still there go to label (retry 1)
Reply

#2
Your request doesn't make much sense for me... Because first you say to keep using it until it disappears, but then you say until you use it or it disappears.. Finally, you say if the item is still there then go to label.

So I can think in three possible alternatives that you may be asking:
1. Keep using the item until it disappears.
2. Use it once, regardless if it's still there.
3. Use and check if it's still there and then play alert.

So please, explain better.
Reply

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

#4
Mate... spend 30 seconds of your time describing EXACTLY what you need, otherwise I'll just do what I understood and if it's not what you need, I won't be able to help you anymore.
I can't guess exactly what you need and I can't waste time guessing or writing code that will NOT be used.

If you need the script:
1. WALK to the item, then add this to your request.
2. Locate the item anywhere on the screen, then add this to your request.
3. Locate the item only in a specific square meters, then add this to your request.
4. Locate the item only within a few specific square meters, then add this to your request.
etc
Reply

#5
The script is for mining as i could not find one here

i will out the lua script on cavebot after wpt and it should detect the itemIDs that puts on list and then use it by right clicking it, also i need a checker like if itemid then goto label (leave)

1) detect if itemID is on screen, walk to it use it until it disapears, continue detect itemID and repeat the process untill all ItemID is used or disapeard.

2) checker like if someone already used mining there so i couls go to end of that route and leave that cave and continue

also i could use like on cavebot the option NE, SE etc to put that screen on the specific stone to mine, i will walk around the map and stand next to the stone and script shall detect itemIDs and use until its not there anymore itemID change.

edit: some big stones got like 2 and 4 places to "pick"  so if i have the script detect on it should use on that sqm then go to next sqm and so on untill. whole is finished
Reply

#6
Hello.

You didn't explain how it's supposed to detect that it already used mining there, so I didn't developed that.

This script will search for listed items on all sqms located in your screen then reach and keep using it while it's there.
local ITEMS = { 1234, 4321 }


if dist == nil then
    function dist(x, y)
        local xDist = math.abs(posx() - x);
        local yDist = math.abs(posy() - y);

        if xDist >= yDist then
            return xDist
        end

        return yDist
    end
end

if connected() then
    local player_x = posx()
    local player_y = posy()
    local player_z = posz()
    for x = -7, 7, 1 do
        for y = -5, 5, 1 do
            local flag = false
            local item = topitem(player_x + x, player_y + y, player_z, false)
            while table.find(ITEMS, item.id) ~= nil and tilereachable(player_x + x, player_y + y, player_z) do
                if dist(player_x + x, player_y + y) > 1 and not reachlocation(player_x + x, player_y + y, player_z, false, true) then
                    break
                end

                useitem(item.id, ground(player_x + x, player_y + y, player_z))
                wait(300, 500)
                item = topitem(player_x + x, player_y + y, player_z, false)
                flag = true
            end

            if flag then
                return
            end
        end
    end
end

This script will search for listed items on the specific sqm that you created the action wpt then reach and keep using it while it's there.
local ITEMS = { 1234, 4321 }


if connected() then
    local wpt = waypoint()
    if wpt ~= nil and wpt.id < 0 then
        local item = topitem(wpt.x, wpt.y, wpt.z, false)
        while table.find(ITEMS, item.id) ~= nil and tilereachable(wpt.x, wpt.y, wpt.z) do
            useitem(item.id, ground(wpt.x, wpt.y, wpt.z))
            wait(300, 500)
            item = topitem(wpt.x, wpt.y, wpt.z, false)
        end
    end
end

This script will search for listed items on the specific sqm that you setup then reach and keep using it while it's there.
local ITEMS = { 1234, 4321 }
local LOCATION = { X = 12345, Y = 12345, Z = 6}

if connected() then
    local item = topitem(LOCATION.X, LOCATION.Y, LOCATION.Z, false)
    while table.find(ITEMS, item.id) ~= nil and tilereachable(LOCATION.X, LOCATION.Y, LOCATION.Z) do
        useitem(item.id, ground(LOCATION.X, LOCATION.Y, LOCATION.Z))
        wait(300, 500)
        item = topitem(LOCATION.X, LOCATION.Y, LOCATION.Z, false)
    end
end
Reply

#7
Im trying to use "
This script will search for listed items on all sqms located in your screen then reach and keep using it while it's there."

and i add it to presistant but i get following error: 17:36:40 - LUA Script -> Persistent02: 352: global 'posY' is not callable (a nil value)"

Very new to this please help
|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

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

Try again, because I just fixed it.
Reply

#9
|Only Registered members can see download links. | Click here to buy subscription or here to register.
I get this now:
17:55:17 - LUA Script -> Persistent02: 28: Invalid arguments to method call
Reply

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

Im also getting same error
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016