[EasyUO]Fishing partner

If you make a Client-side script you can publish it here for other players to use
Post Reply
Shindaril
Grandmaster Scribe
Posts: 96
Joined: Tue Jul 01, 2014 12:11 pm

[EasyUO]Fishing partner

Post by Shindaril »

Hiya,

This script I made to help out when fishing. It's poorly commented / documented as I feel lazy while writing this, but it's simple enough for the few comments to explain what to change to set it up and how to comment out parts you don't need.

What this script does not do for you:
-It doesn't fish for you
-It doesn't cook for you

Then what does it do:
-Moves the trash (footwear, rare fish) into your safe trash for tokens bag once you've changed your's ItemID in the script
-Tracks your fishing pole's durability and moves it into your backpack when durability reaches zero and announces the need for repair
-Cuts the fish for you, assuming you took your time to change the blade's ItemID into the script and have it in an open container with you
-Moves the cut raw fish steaks into a container of your choice. This can be a bag of holding, boat's stash, pack animal, but again, you have to change the ID in the script, be in range of it and keep it open

Code: Select all

set %Boots ZVI_PVI_NVI_TVI_YDF_
; Tight Boots, Shoes, Sandals, Boots, Rare Fish
set %Trash UVDMXND             ; ItemID of your Trash Bag
set %FishBag BGLWNPD           ; Item ID of your Bag of Holding, boat stash, pack animal, ...
set %Fish FQD_GQD_EQD_DQD_
set %Blade WVDMXND            ; Item ID of your blade used for cutting, must be in an open pack
set %Backpack #BackpackID
set %min_durability 1

while #True
{
    ; Time to look for trash and move it to your trash bag
    finditem %Boots C_ , %Backpack
    if #FindKind <> -1
    {
        exEvent Drag #FindID
        wait 10
        exEvent Dropc %Trash
        wait 10
    }
    ; Let's check your fishing pole's durability
    ; If it's 0, remove the pole and announce the need for repair
    finditem KDF C_ , #CharID
    if #FindKind <> -1
    {
        event property #FindID
        str pos #property durability
        set %durmon_k #strres + 10
        str del #property 1 %durmon_k
        set %durmon_res #strres
        str pos %durmon_res /
        str del %durmon_res #strres 99
        set %durmon_res #strres
        if %durmon_res < %min_durability
        {
            exEvent Drag #FindID
            wait 10
            exEvent Dropc %Backpack
            wait 10
            event exmsg #charid 3 111 Fishing pole moved to your backpack
        }
    }
    ; Let's cut the fish
    ; Comment this out if you don't need it
    finditem %Fish C_ , #BackpackID
    if #FindKind <> -1  ; Alternatively, you could change this to #FindCnt > treshold to cut only when a stack is as large as you want
    {
        set %OldLObjectID #lObjectID
        set %OldTargetID #lTargetID
        set %OldTargetKind #lTargetKind
        set #lObjectID %Blade
        event macro 17 0
        set #lTargetKind 1
        set #lTargetID #FindID
        target 5s
        event macro 22
        set #lObjectID %OldLObjectID
        set #lTargetKind %OldTargetKind
        set #lTargetID %OldTargetID
        wait 20
    }
    ; Let's move those raw fish steaks to another container
    ; Comment this out if you don't need it
    finditem IND C_ , #BackpackID
    if #FindKind <> -1
    {
        exEvent Drag #FindID #FindStack
        wait 10
        exEvent Dropc %FishBag
        wait 10
    }
}
I never intended to make an automated fishing script in the spirit of the shard rules considering resource gathering, but I did want a helper script so I wouldn't have the need for constant carry weight monitoring and taking the trash out myself, so do not ask me to add fishing into this script.
User avatar
apocalypse
Elder Scribe
Posts: 127
Joined: Sat Feb 22, 2014 4:12 am
Location: Alberta, Canada

Re: [EasyUO]Fishing partner

Post by apocalypse »

Thanks so much for sharing it with us! Works really well :nod: :D
Jean Luc Picard in game
User avatar
apocalypse
Elder Scribe
Posts: 127
Joined: Sat Feb 22, 2014 4:12 am
Location: Alberta, Canada

Re: [EasyUO]Fishing partner

Post by apocalypse »

The only problem I ran into with the script, is sometimes when it is trying to cut the fish in my pack, it comes up with the message, you can't use a bladed item on that.
So it is missing targeting the fish, but after a few tries it does find it eventually.
So it still works, just sometimes it has a hard time targeting for some reason.
Jean Luc Picard in game
Shindaril
Grandmaster Scribe
Posts: 96
Joined: Tue Jul 01, 2014 12:11 pm

Re: [EasyUO]Fishing partner

Post by Shindaril »

Haven't seen the same behaviour myself, apocalypse, but just in case the script somehow progresses too fast, made a minor change to the fish cutting part. Moved the event macro 17 0 line two rows down. I am, however assuming that another script or user input would be able to set #lTargetID during the time the script waits for target. It's a very short timeframe, but as the "target" command pauses the script until it does get a target, it's quite possible.
Shindaril wrote:

Code: Select all

    ; Let's cut the fish
    ; Comment this out if you don't need it
    finditem %Fish C_ , #BackpackID
    if #FindKind <> -1  ; Alternatively, you could change this to #FindCnt > treshold to cut only when a stack is as large as you want
    {
        set %OldLObjectID #lObjectID
        set %OldTargetID #lTargetID
        set %OldTargetKind #lTargetKind
        set #lObjectID %Blade
        set #lTargetKind 1
        set #lTargetID #FindID
        event macro 17 0   ; Moved this line below setting #lTargetID
        target 5s
        event macro 22
        set #lObjectID %OldLObjectID
        set #lTargetKind %OldTargetKind
        set #lTargetID %OldTargetID
        wait 20
    }
Glad to see you're liking the script. I did comment out the section that moves the raw fish steaks into my bag of holding just to fasten things up as the raw fish steaks don't really weight much, so moving a larger stack saves a lot of time.
Post Reply