Hello.
About the script
The scripts below will fish only on the WATER_IDs. So you must make sure the water id you are willing to fish is in the list.
This script will fish and drop garbage when it has at least x count of garbage.
This script will stop fishing and drop garbage as well, but will stop fishing whenever it reaches the "FISHING_ROD_CHARGES" count. That mean it would use a fishing rod 300 times then stop.
This script will also fish, drop garbage and stop fishing, BUT it will make cavebot go to specific waypoint and enable cavebot. So you can make waypoints to reach an npc or simply do whatever you need to refill your fishing rod. alt="Smile" title="Smile" class="smilie smilie_1" />
Notice that you must reset the variable "USED_TIMES" after refilling. The script below does that, so you just need to add it on Cavebot -> Action after refilling or walking back to fishing spot.
Right-click on water
This script should be used on servers that you don't need to use a fishing rod, but only right-click directly on water.
keywords: fishing rod, fish, fishing, garbage, trash, drop trash, drop garbage, drop, fish and drop, advanced fishing, wooden rod, mechanical rod
About the script
The scripts below will fish only on the WATER_IDs. So you must make sure the water id you are willing to fish is in the list.
This script will fish and drop garbage when it has at least x count of garbage.
local WATER_IDS = { 618, 619, 620, 622, 623, 624, 625, 626, 627, 628, 629, 4597, 4598, 4599, 4600, 4601, 4602, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4653, 4654, 4655 } -- Water ids which script should try to fish.
local FISHING_ROD_ID = 5331 -- Fishing rod id.
local TRASH = {
{ Item = 5326, Count = 1 }, -- wood
}
if connected() then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local tiles = gettiles()
for _, tile in ipairs(tiles) do
if math.abs(tile.posx - player_x) <= 7 and math.abs(tile.posy - player_y) <= 5 and tile.posz == player_z then
for __, item in ipairs(tile.items) do
if table.find(WATER_IDS, item.id) ~= nil then
useitemon(FISHING_ROD_ID, tile.posx, tile.posy, tile.posz)
wait(800, 1200)
break
end
end
end
end
for _, item in ipairs(TRASH) do
if itemcount(item.Item) >= item.Count then
moveitems(item.Item, ground(posx(), posy(), posz()), '', 100)
wait(500)
end
end
end
This script will stop fishing and drop garbage as well, but will stop fishing whenever it reaches the "FISHING_ROD_CHARGES" count. That mean it would use a fishing rod 300 times then stop.
local WATER_IDS = { 618, 619, 620, 622, 623, 624, 625, 626, 627, 628, 629, 4597, 4598, 4599, 4600, 4601, 4602, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4653, 4654, 4655 } -- Water ids which script should try to fish.
local FISHING_ROD_ID = 5331 -- Fishing rod id.
local FISHING_ROD_CHARGES = 300 -- How many charges fishing rod has? It will stop after using that many times.
local TRASH = {
{ Item = 5326, Count = 1 }, -- wood
}
USED_TIMES = getglobal('USED_TIMES')
if USED_TIMES == nil then
setglobal('USED_TIMES', 0)
USED_TIMES = 0
end
if connected() then
if USED_TIMES ~= nil and USED_TIMES < FISHING_ROD_CHARGES then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local tiles = gettiles()
for _, tile in ipairs(tiles) do
if math.abs(tile.posx - player_x) <= 7 and math.abs(tile.posy - player_y) <= 5 and tile.posz == player_z then
for __, item in ipairs(tile.items) do
if table.find(WATER_IDS, item.id) ~= nil then
useitemon(FISHING_ROD_ID, tile.posx, tile.posy, tile.posz)
wait(800, 1200)
USED_TIMES = USED_TIMES + 1
setglobal('USED_TIMES', USED_TIMES)
break
end
end
end
end
end
for _, item in ipairs(TRASH) do
if itemcount(item.Item) >= item.Count then
moveitems(item.Item, ground(posx(), posy(), posz()), '', 100)
wait(500)
end
end
end
This script will also fish, drop garbage and stop fishing, BUT it will make cavebot go to specific waypoint and enable cavebot. So you can make waypoints to reach an npc or simply do whatever you need to refill your fishing rod.
local WATER_IDS = { 618, 619, 620, 622, 623, 624, 625, 626, 627, 628, 629, 4597, 4598, 4599, 4600, 4601, 4602, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4653, 4654, 4655 } -- Water ids which script should try to fish.
local FISHING_ROD_ID = 5331 -- Fishing rod id.
local FISHING_ROD_CHARGES = 300 -- How many charges fishing rod has? It will stop after using that many times.
local WAYPOINT_RECHARGE = 'go_recharge' -- Wpt name or index to recharge rod. Leave empty to ignore.
local TRASH = {
{ Item = 5326, Count = 1 }, -- wood
}
USED_TIMES = getglobal('USED_TIMES')
if USED_TIMES == nil then
USED_TIMES = 0
setglobal('USED_TIMES', 0)
end
if connected() then
if USED_TIMES ~= nil and USED_TIMES < FISHING_ROD_CHARGES then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local tiles = gettiles()
for _, tile in ipairs(tiles) do
if math.abs(tile.posx - player_x) <= 7 and math.abs(tile.posy - player_y) <= 5 and tile.posz == player_z then
for __, item in ipairs(tile.items) do
if table.find(WATER_IDS, item.id) ~= nil then
useitemon(FISHING_ROD_ID, tile.posx, tile.posy, tile.posz)
wait(800, 1200)
USED_TIMES = USED_TIMES + 1
setglobal('USED_TIMES', USED_TIMES)
break
end
end
end
end
elseif USED_TIMES ~= nil and USED_TIMES >= FISHING_ROD_CHARGES and WAYPOINT_RECHARGE ~= nil and WAYPOINT_RECHARGE ~= '' then
gotolabel(WAYPOINT_RECHARGE)
setsettings('Cavebot/Enabled', true)
end
for _, item in ipairs(TRASH) do
if itemcount(item.Item) >= item.Count then
moveitems(item.Item, ground(posx(), posy(), posz()), '', 100)
wait(500)
end
end
end
Notice that you must reset the variable "USED_TIMES" after refilling. The script below does that, so you just need to add it on Cavebot -> Action after refilling or walking back to fishing spot.
setglobal('USED_TIMES', 0)
Right-click on water
This script should be used on servers that you don't need to use a fishing rod, but only right-click directly on water.
local WATER_IDS = { 618, 619, 620, 622, 623, 624, 625, 626, 627, 628, 629, 4597, 4598, 4599, 4600, 4601, 4602, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4653, 4654, 4655 } -- Water ids which script should try to fish by using right click.
local DELAY_BETWEEN_CLICKS = { Min = 1000, Max = 2000 }
if connected() then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local tiles = gettiles()
local places = { }
for _, tile in ipairs(tiles) do
if math.abs(tile.posx - player_x) <= 7 and math.abs(tile.posy - player_y) <= 5 and tile.posz == player_z then
for __, item in ipairs(tile.items) do
if table.find(WATER_IDS, item.id) ~= nil then
table.insert(places, { x = tile.posx, y = tile.posy } )
break
end
end
end
end
table.shuffle(places)
for _, place in ipairs(places) do
local point = pointfromloc(place.x, place.y, player_z)
if point.x ~= -1 or point.y ~= -1 then
mouserclick(point.x, point.y)
wait(DELAY_BETWEEN_CLICKS.Min, DELAY_BETWEEN_CLICKS.Max)
break
end
end
end
keywords: fishing rod, fish, fishing, garbage, trash, drop trash, drop garbage, drop, fish and drop, advanced fishing, wooden rod, mechanical rod