Wow i used the github version and it trashed one of my Epheria rod away once it ran out of durability since the pixel detection detected the mini clock + red background. Not caring what type of rod it is.
And locking the item to prevent trashing will result in script cannot detect Epheria rod due to the lock icon appearing on the location the script is searching for on the rod image.
---- @
Is OCInventory the part that scan inventory for free slots?
I'll see if i can modify it a little bit so it can work for me. Because sometimes i see some unnecessary actions.
Code:
Func SwapFishingrod($discard = False)
Local $Fishingrods[5] = ["res/fishing/rod_default.png", "res/fishing/rod_balenos.png", "res/fishing/rod_calpheon.png", "res/fishing/rod_epheria.png", "res/fishing/rod_mediah.png"]
SetGUIStatus("Trying to swap Fishingrod. Discard = " & $discard)
Local $C = SearchInventory($Fishingrods, 20)
If IsArray($C) Then
SetGUIStatus("Equipping Fishingrod")
MouseClick("right", $C[0], $C[1])
If $discard = True Then DiscardEmptyRod()
OCInventory(False)
Return True
Else
SetGUIStatus("No usable Fishingrod found")
[COLOR="Red"]If $discard = True Then DiscardEmptyRod()
OCInventory(False)[/COLOR]
Return False
EndIf
EndFunc ;==>SwapFishingrod
Red text: unnecessary task? End of fishing bot, no need to continue with no rod detected, why discard instead let human do it?
And where it went wrong with (deleting) fishing rod when the image aren't accurate:
-Like when item (fishing rods) are locked(Shift-right click), they are not detected due to lock icon.
-Or in my case, the Epheria Fishing Rod image was just outside of the rod_default_discard.png top corner. So script only detected the red layer etc and not the top corner as well where the Epheria rod image pixel is located at. and by that i mean this:
Blue is the Epheria rod image (the balenos etc rods are also same pixels, so i assume will have the same result?).
Yellow is the Exclamation mark while Black is the whole item.
Red + part of the yellow corner is the rod_default_discard.png search image.
So it kinda just skips over the repairable rods.
So what i did so far is commented the Discard rod part in Else statement for SwapFishingrod function. And I made a new Epheria rod image with Lock Icon. Locked item cannot be trashed. So i will test it out again to see if this can solve the issue for now.
Worse case is that the script will get into a bug where it cannot throw away the Epheria rod and get stuck once durability runs out.
But from what i conclude is that it will simply just ignore it due to the search area for red layer rod. So i'll have to make a new image of this as well to prevent the bug.
----edit 3
meanwhile i typed the text above, i tested with new image of Epheria rod and bought 1 normal Fishing rod for testing purpose:
this is the log:
Code:
10:38.01 Casting Fishingrod
10:38.11 Casting fishingrod failed.
10:38.13 Equipment found
10:38.14 rod_empty detected
10:38.15 Broken Fishingrod in Weaponslot detected.
10:38.15 Trying to swap Fishingrod. Discard = 0
10:38.15 Inventory closed
10:38.19 Equipping Fishingrod
10:38.20 Searching for unrepairable Fishingrod
10:38.25 Discarding Fishingrod.
10:38.30 Inventory closed
10:38.30 SwapFishingrod successful.
I have discard rod option Off as you can see above Discard = 0 (false).
And yet it threw away that Fishing Rod once it broke.