Posts: 96
Threads: 40
Joined: Oct 2020
Reputation:
0
02-28-2021, 06:04 PM
(This post was last modified: 02-28-2021, 06:28 PM by gamefreak777.)
wondering if you can make a script to equip a torch use it wait 20 mins drop it and equip and use the next one.
but if cave bot is enabled have to figure out something like disable cavebot equiptorch use enable cave bot because if it attempts to move torch while its moving it'll glitch out and u won't be able to drag things till u minimize window
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
03-01-2021, 06:58 PM
(This post was last modified: 09-30-2022, 01:18 AM by Arkilys.)
local TORCH_ID = 1234 -- Torch id
local TIME = { Min = 1200, Max = 1230 } -- Time to change torch, in seconds. Default value 1200 to 1230 means 20 minutes to 20 minuntes and a half.
NEXT_TORCH_TIME = NEXT_TORCH_TIME or 1
if runningtime() >= NEXT_TORCH_TIME then
local belt_item = belt()
if belt_item.id > 0 then
setsettings('Cavebot/Enabled', false)
cavebot_disabled = true
moveitems(belt_item.id, ground(posx(), posy(), posz()), 'belt', 100)
wait(300, 500)
end
if itemcount(TORCH_ID) > 0 then
if belt_item.id == 0 then
setsettings('Cavebot/Enabled', false)
end
moveitems(TORCH_ID, 'belt', '', 100)
wait(300, 500)
local belt_item = belt()
while belt_item.id == TORCH_OUT_ID do
useitem(TORCH_OUT_ID, 'belt')
wait(500, 800)
belt_item = belt()
end
end
end
Or based on Torch ids.
local TORCH_NEW_ID = 2921 -- Torch new id
local TORCH_OUT_ID = 2926 -- Torch used/burnt id
local belt_item = belt()
if (belt_item.id == 0 or belt_item.id == TORCH_OUT_ID) and itemcount(TORCH_NEW_ID) > 0 then
setsettings('Cavebot/Enabled', false)
if belt_item.id > 0 then
moveitems(belt_item.id, ground(posx(), posy(), posz()), 'belt', 100)
wait(500, 800)
end
moveitems(TORCH_NEW_ID, 'belt', '', 100)
wait(500, 800)
local belt_item = belt()
while belt_item.id == TORCH_NEW_ID do
useitem(TORCH_NEW_ID, 'belt')
wait(500, 800)
belt_item = belt()
end
setsettings('Cavebot/Enabled', true)
end
Posts: 96
Threads: 40
Joined: Oct 2020
Reputation:
0
i used the second script and it doesn't equip the torch if i don't have one and if i equip the torch my self "for the very first one ever" and it burns down after min or 2 it ends up dropping it but it doesn't equip a new one
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
03-03-2021, 07:52 PM
(This post was last modified: 03-03-2021, 07:54 PM by Arkilys.)
I just fixed it and should work fine.
Posts: 8
Threads: 2
Joined: Sep 2022
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.Hello i try to use this script and dont work fine, please make to put torch on arrow slot and turn on that, when torch burn drop to floor and get other new torch please
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
The script works fine, you must make sure the torch ids are correct. Because ids may be different on each server and there's an id for each STATE of torches.
Posts: 8
Threads: 2
Joined: Sep 2022
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.the problem is my character put the new torch on arrow slot but dont get on this torch just put and never on srry bad english
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
local TORCH_NEW_ID = 2921 -- Torch new id
local TORCH_OUT_ID = 2926 -- Torch used/burnt id
local belt_item = belt()
if (belt_item.id == 0 or belt_item.id == TORCH_OUT_ID) and itemcount(TORCH_NEW_ID) > 0 then
setsettings('Cavebot/Enabled', false)
if belt_item.id > 0 then
moveitems(belt_item.id, ground(posx(), posy(), posz()), 'belt', 100)
wait(500, 800)
end
moveitems(TORCH_NEW_ID, 'belt', '', 100)
wait(500, 800)
local belt_item = belt()
while belt_item.id == TORCH_NEW_ID do
useitem(TORCH_NEW_ID, 'belt')
wait(500, 800)
belt_item = belt()
end
setsettings('Cavebot/Enabled', true)
end
Posts: 8
Threads: 2
Joined: Sep 2022
Reputation:
0
|Only Registered members can see download links. | Click here to buy subscription or here to register.thank you
Posts: 3
Threads: 0
Joined: May 2023
Reputation:
0
I put the torch id without using it, and the torch id is almost gone, will it replace with the new torch inside the skeleton body?
|