Posts: 13
Threads: 4
Joined: Oct 2023
Reputation:
0
Hello Arkilys.
Since a lot of people seem to use Kasteriabot on Tibiascape, I am wondering if there is a chance you can create a fishing script that works on the server?
It would require for the bot to use fishing rod on a few SQMs, perhaps 2-5 depending on choice, then pause, after that as soon as a specific effect appears on those SQMs (I could find the ID of this effect by using a script that you provided before, lets call it X for simplicity), the bot would, withing a range of 200-600 ms, use a fishing rod on that same SQM. Afterwards there would need to be a break of 3000-5000 ms and the script would repeat.
If you would have the time to create a script like this I believe many would appreciate it.
Thank you for your continued development and time on this project!
|Only Registered members can see download links. | Click here to buy subscription or here to register.
I thought the script would be too complicated if I added all the neccessary things. If it is not, I will try to include all the things that would make the script complete.
1. everything essential, just throwing fishing rod on the sqms you choose, then wait for effect and use fishing rod on effect quickly before it "disappears"
2. drop trash items with specific ids, or it would perhaps be easier if the script dropped all items except a very few since only 2-3 things have value. I dont know which one would be easier, but both work
3. it is very hard to describe the time, but my guess is anywhere between 1500-7500 ms. if you would like I could try and fish and see the timing on all of the things. like how much time minimum between fishing and the "effect", how long the SQM takes before it "regenerates" and u can fish it again, and if there is anything else let me know.
To answer question 3 the fishing works as following;
you use the fishing rod on an SQM
the normal "fishing" animation keeps showing up a random amount of times, between 2-10 ticks
either the fishing "fails" and the SQM needs a few seconds to regenerate, or in most cases a yellow X effect appears, which you have to using fishing rod on again in order to "catch something" however the time for this is very short, I believe you have to use the fishing rod on it withing 1000-1500 ms? it has been hard for me to calculate but if you fish manually it is very very very hard in the beginning to manage to catch anything considering the time is so low.
If my explanations are too bad, please let me know and I will try to upload a video of the fishing instead.
Thank you once again!
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
04-11-2024, 11:43 AM
(This post was last modified: 04-11-2024, 11:46 AM by Arkilys.)
Hello.
Thanks for the informations!
1. About stop fishing on low capacity: I'm still not sure about stop fishing when reaching low capacity. Should the script stop fishing if reaches specific capacity?
2. Is there a specific amount of times that effects shows up? Example: Effects shows up for 10s, but only shows 3x then if scripts finds 3 effects in 5s then it can rest to start over instead of waiting 10s.
3. About places to fish BEFORE effects shows up: That means you will choose the sqms location to fish or should script try to fish on any water sqm until effects shows up?
4. About Drop Trash: That's easy and you could even use another script to achieve that.
5. Yeah, i would need to know those 2 timings: how long it takes to regenerate to start over? for how long effects keeps showing up?
Posts: 13
Threads: 4
Joined: Oct 2023
Reputation:
0
1. not needed, the only fish you want to keep is northern pike, the rest are useless. and u can impossibly get enough of them to be out of cap.
2. the effect shows up once, then u need to wait about 5s before u can use same sqm.
3. yes, it is much easier if u select few sqms as it would be close to impossible to maintain too many sqms, even for a bot in my opinion.
4. yes you are correct, however would it not risk ruining the other script if you run too low intervals? if im wrong let me know.
5. effect shows up and you have around 500-900ms before it disappears. regen time is about 3-8 seconds.
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
04-13-2024, 03:58 PM
(This post was last modified: 04-14-2024, 12:06 AM by Arkilys.)
Hello.
I could not test it, but it works this way:
1. If you are connected and has enough capacity then searches for water sqms on your screen and save only the ones that you didn't fish for last X time (CONFIG.DELAY_WATER_RESET) due to "sqm regeneration". If CONFIG.DELAY_WATER_RESET = 5000 (5 seconds) then if you already fished that spot in last 5s then it will not fish on that sqm again on this run.
2. Random sort water sqms remaining.
3. Random sort how many sqms will script fish this time based on CONFIG.FISH_ATTEMPTS_EACH_RUN. FISH_ATTEMPTS_EACH_RUN = 2 to 5 then it can sort 4 and it will try to fish on 4 water sqms.
4. Fish on each spot and create a deadline to search for effects on that sqm based on CONFIG.TIME_SEARCH_FISH_EFFECTS. TIME_SEARCH_FISH_EFFECTS = 10000 to 15000 (10s to 15s) then it will sort a value and may search for effects on this sqm for 12 seconds.
5. Searches for effects for specified time sorted on previous step on spots that script tried to fish.
6. If effect show up during deadline then it will fish on that sqm and remove from list, so it will no longer wait or search for effects there.
7. After searching for effects then it will, if you have CONFIG.DROP_TRASH enabled then it will drop all items on CONFIG.TRASH_IDS under your feet.
local CONFIG = {
PLAYER_CAP = 50, -- Only fish if capacity is higher than this.
FISH_ATTEMPTS_EACH_RUN = {Min = 2, Max = 5}, -- How many attempts to fish every time script run? 0 to unlimited! 10 to try to fish on 10 different places.
DELAY_BETWEEN_FISHING = {Min = 200, Max = 600}, -- Delay after using fishing rod on water.
DELAY_WATER_RESET = 5000, -- How long to water sqm regenerate after fishing?
DROP_TRASH = false,
TRASH_IDS = {},
FISH_EFFECTS = {11}, -- Effects ids that you must fish
TIME_SEARCH_FISH_EFFECTS = {Min = 10000, Max = 15000}, -- For how long should script wait for the effects after fishing?
DELAY_FISHING_ON_EFFECT = {Min = 200, Max = 600}, -- Delay after using fishing rod water with effect.
FISHING_ROD_ID = 3483, -- Fishing rod id.
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.
}
if SPOTS_HISTORY == nil then
SPOTS_HISTORY = {}
end
if canfishspot == nil then
function canfishspot(historyTable, x, y, z)
for _, spot in ipairs(historyTable) do
if spot.x == x and spot.y == y and spot.z == z then
if runningtimems() >= (spot.time + CONFIG.DELAY_WATER_RESET) then
return true
end
return false
end
end
return true
end
end
if addfishspothistory == nil then
function addfishspothistory(historyTable, x, y, z)
for _, spot in ipairs(historyTable) do
if spot.x == x and spot.y == y and spot.z == z then
spot.time = runningtimems()
return
end
end
table.insert(historyTable, {x = x, y = y, z = z, time = runningtimems()})
end
end
if connected() then
if cap() > CONFIG.PLAYER_CAP then
local player_x = posx()
local player_y = posy()
local player_z = posz()
local tiles = gettiles()
local waterSpots = {}
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 and
canfishspot(SPOTS_HISTORY, tile.posx, tile.posy)
then
for __, item in ipairs(tile.items) do
if table.find(CONFIG.WATER_IDS, item.id) ~= nil then
table.insert(waterSpots, {x = tile.posx, y = tile.posy, z = tile.posz})
break
end
end
end
end
local waterSpotsCount = #waterSpots
if waterSpotsCount > 0 then
if waterSpotsCount > 1 then
table.shuffle(waterSpots)
end
local fishedSpots = {}
local fishAttemptsThisRun = random(CONFIG.FISH_ATTEMPTS_EACH_RUN.Min, CONFIG.FISH_ATTEMPTS_EACH_RUN.Max)
for _, spot in ipairs(waterSpots) do
useitemon(CONFIG.FISHING_ROD_ID, spot.x, spot.y, player_z)
wait(CONFIG.DELAY_BETWEEN_FISHING.Min, CONFIG.DELAY_BETWEEN_FISHING.Max)
table.insert(
fishedSpots,
{
x = spot.x,
y = spot.y,
z = spot.z,
effectDeadline = runningtimems() +
random(CONFIG.TIME_SEARCH_FISH_EFFECTS.Min, CONFIG.TIME_SEARCH_FISH_EFFECTS.Max)
}
)
if #fishedSpots >= fishAttemptsThisRun then
break
end
end
while #fishedSpots > 0 do
local tilesEffects = gettileseffect()
local foundAnyEffect = false
for i = #fishedSpots, 1, -1 do
local spot = fishedSpots[i]
local isSpotFinished = false
if runningtimems() >= spot.effectDeadline then
isSpotFinished = true
else
for _, tile in ipairs(tilesEffects) do
if spot.x == tile.posx and spot.y == tile.posy and spot.z == tile.posz then
for __, effect in ipairs(tile.effects) do
if table.find(CONFIG.FISH_EFFECTS, effect) ~= nil then
useitemon(CONFIG.FISHING_ROD_ID, spot.x, spot.y, spot.z)
wait(CONFIG.DELAY_FISHING_ON_EFFECT.Min, CONFIG.DELAY_FISHING_ON_EFFECT.Max)
isSpotFinished = true
foundAnyEffect = true
break
end
end
if isSpotFinished then
break
end
end
end
end
if isSpotFinished then
table.remove(fishedSpots, i)
addfishspothistory(SPOTS_HISTORY, spot.x, spot.y, spot.z)
end
end
if not foundAnyEffect then
wait(100, 300)
end
end
end
end
if CONFIG.DROP_TRASH then
for _, item in ipairs(CONFIG.TRASH_IDS) do
if itemcount(item.Item) >= item.Count then
moveitems(item.Item, ground(posx(), posy(), posz()), "", 100)
wait(400, 800)
end
end
end
end
To find the special fishing effects just reproduce the effect, make it happen in your screen and run the script below. You must do it really fast (you can let the script running on a persistent with low intervals).
local tilesEffects = gettileseffect()
for _, tile in ipairs(tilesEffects) do
for __, effect in ipairs(tile.effects) do
print('effect id:', effect)
end
end
Posts: 13
Threads: 4
Joined: Oct 2023
Reputation:
0
04-13-2024, 08:45 PM
(This post was last modified: 04-13-2024, 09:02 PM by mufacx.)
it does not fish at all, had to change id of fishing rod to 3483 and water id seem to be correct but it doesnt start fishing. there are no errors in console either, and I tried turning on auto fishing on tools but same thing, nothing happens.
I uploaded a video of how the fishing works, sorry for being late with it
|Only Registered members can see download links. | Click here to buy subscription or here to register.
the yellow effect that shows up means you need to use fishing rod on it quickly to catch smth, then at the end u can see the red effect which means the square is regenerated and ready to be fished again
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
Hello.
I just fixed it. Notice you need to setup the effects ids properly on CONFIG.FISH_EFFECTS, because i just setup some random number there as example.
Posts: 7
Threads: 0
Joined: Apr 2024
Reputation:
0
Hello, i cant get the id of the special effect with this script, he always says it id is "0".
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
|Only Registered members can see download links. | Click here to buy subscription or here to register.Hello.
Please, redownload and reinstall Kasteria OTBot then try again: |Only Registered members can see download links. | Click here to buy subscription or here to register.
Posts: 7
Threads: 0
Joined: Apr 2024
Reputation:
0
04-23-2024, 08:51 PM
(This post was last modified: 04-23-2024, 08:53 PM by fdfdfdfd.)
they changed again the fishing, now its only 1 sqm to fish, can u fix this script please? its the same logical, but in only 1 sqm. and the id of the effect doesnt function, he dont use the fishing rod again.
Posts: 2,911
Threads: 481
Joined: Jul 2018
Reputation:
82
|Only Registered members can see download links. | Click here to buy subscription or here to register.Hello.
What do you mean by 1 sqm to fish? I need it very clear, otherwise i can't change the script.
I could not understand what you said by the effect as well, did you fail to get the effect id or the effect is correct but it doesn't fishes?
|