Posts: 8
Threads: 4
Joined: Jan 2023
Reputation:
0
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)
Posts: 2,391
Threads: 409
Joined: Jul 2018
Reputation:
61
01-30-2023, 11:04 PM
(This post was last modified: 01-30-2023, 11:05 PM by Arkilys.)
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.
Posts: 8
Threads: 4
Joined: Jan 2023
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Posts: 2,391
Threads: 409
Joined: Jul 2018
Reputation:
61
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
Posts: 8
Threads: 4
Joined: Jan 2023
Reputation:
0
01-31-2023, 07:54 PM
(This post was last modified: 01-31-2023, 07:56 PM by lilb4l.)
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
Posts: 2,391
Threads: 409
Joined: Jul 2018
Reputation:
61
02-05-2023, 02:11 PM
(This post was last modified: 02-06-2023, 03:01 AM by Arkilys.)
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
Posts: 3
Threads: 0
Joined: Jan 2023
Reputation:
0
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" />
Posts: 2,391
Threads: 409
Joined: Jul 2018
Reputation:
61
|Only Registered members can see download links. | Click here to buy subscription or here to register.Hello.
Try again, because I just fixed it.
Posts: 3
Threads: 0
Joined: Jan 2023
Reputation:
0
|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
Posts: 1
Threads: 0
Joined: Jan 2023
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Im also getting same error
|