A mod to the fish.mac macro

Artemus

Lifetime Member
Joined
May 30, 2006
Messages
1,048
Reaction score
9
Points
38
I use the fish.mac macro a lot and it's great but could stand for one slight improvement that is well beyond my abilities.

When your rod breaks, the macro ends. But what if you have another rod in your bags? If the macro could find it and auto equip, and thus keep going until you run out of bail, that would be super cool.

Doable?
 
  • Like
Reactions: EQDAB
i havent tried this one. I thought i liked hyperfish but it keeps dropping my Raxil Fish for some reason so its useless to me.
and the fishing mac just says i need to put a fishing pole in my primary when i already have one there
 
Hello,

For those of you that are using the fish.mac and are finding it difficult to keep equipping the pole after it breaks then restarting the macro, I have copied the code from fishing.mac and added it to the fish.mac so it will auto equip it as it breaks without having to end your macro. However, You will still need to equip your bait manually as I didn't add that section because I didn't run into that issue.

Usage: Before you start your macro, ensure your Primary Slot is not equipped. to start the macro simply in-game /mac fish

Note: I am just posting this just in case some of you are doing the tradskill and need it.

Spoiler:
Code:
#turbo

#event BrokenPole "#*#You can't fish without a fishing pole, go buy one.#*#"
#event NoBait "#*#You can't fish without fishing bait, go buy some.#*#"

Sub Main
    /cleanup
    :Fish
        /call CheckPole 
        /doability Fishing
        /delay 65 
        /doevents

        /if (!${Cursor.ID}) /goto :Fish

        /if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
            /destroy
            /delay 1s
        } else {
            /if (${Cursor.Name.Equal[Rusty Dagger]}) {
                /destroy
                /delay 1s
            } else {
                /call KeepItem
            }
      }
   /goto :Fish
/return

Sub KeepItem
   /if (${Cursor.Name.NotEqual[Fish Scales]}) /echo Caught ${Cursor.Name}
   /autoinventory
/return

Sub CheckPole
	/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]}) /return
	/if (!${Me.Inventory[mainhand].Name.Find[Fishing Pole]}) {
		/if (${FindItemCount[=Fishing Pole]}>0) {
			/delay ${Math.Calc[${DelayMult}*1]}s
			/nomodkey /ctrl /itemnotify ${FindItem[=Fishing Pole].InvSlot} leftmouseup
			/delay 2s ${Cursor.ID}
			/nomodkey /itemnotify mainhand leftmouseup
			/delay 1s
			/autoinv
			/delay ${Math.Calc[${DelayMult}*2]}s
			/return
		}
	}

   /echo  You need to put your fishing pole in your primary hand.
   /endm
/return

Sub Event_BrokenPole
   /endmacro
/return

Sub Event_NoBait
   /endmacro
/return
 
Last edited:
  • Like
Reactions: EQDAB
Thanks for that bit of code Island.

For those of you interested in a bait option

/if (${FindItemCount[=Name of bait here]}>0) {
/delay ${Math.Calc[${DelayMult}*1]}s
/nomodkey /ctrl /itemnotify ${FindItem[=name of bait here].InvSlot} leftmouseup
/delay 2s ${Cursor.ID}
/nomodkey /itemnotify mainhand leftmouseup |**slot for bait? Ammo? **|
/delay 1s
/autoinv
/delay ${Math.Calc[${DelayMult}*2]}s
/return
}

I can look more into this after I get home, I'm about to head out. In the mean time if anyone wants to give me a list of bait items to search for I can make a new sub for it and have it verify bait is equipped or in your inventory. I can also search for any bait clickies (DBG Cash item for endless worms) to see if you have that, and if you do then click it, then put the bait in inventory.

Lemme know what to add. Thanks.
 
  • Love
Reactions: EQDAB
Hello,

I added the code that CHATWITHTHIS suggested and also added the option for the Fisherman's Companion. Hope this will help all.

Spoiler:
Code:
#turbo

#event BrokenPole "#*#You can't fish without a fishing pole, go buy one.#*#"
#event NoBait "#*#You can't fish without fishing bait, go buy some.#*#"

Sub Main
    /cleanup
    :Fish
        /call CheckPole
	/call CheckBait 
        /doability Fishing
        /delay 65 
        /doevents

        /if (!${Cursor.ID}) /goto :Fish

        /if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
            /destroy
            /delay 1s
        } else {
            /if (${Cursor.Name.Equal[Rusty Dagger]}) {
                /destroy
                /delay 1s
            } else {
                /call KeepItem
            }
      }
   /goto :Fish
/return

Sub KeepItem
   /if (${Cursor.Name.NotEqual[Fish Scales]}) /echo Caught ${Cursor.Name}
   /autoinventory
/return

Sub CheckPole
	/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]} || ${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}) /return
	
	/if (!${Me.Inventory[mainhand].Name.Find[Fishing Pole]} || !${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}) {
		/if (${FindItemCount[=Fisherman's Companion]}>0) {
:ReCast
			/Echo Summoning ---> Brell's Fishin' Pole <---
			/delay 1s
			/casting 29175|item
:CastWait			
			/delay 1s
			/if (${Me.Casting.ID}) /goto :CastWait
			/if (${Cursor.ID}) /autoinventory
			/delay 1s
			/if (${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}<1) /goto :ReCast
			/if (${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}>0) /return
		}
	}

	/if (!${Me.Inventory[mainhand].Name.Find[Fishing Pole]} && ${FindItemCount[=Fisherman's Companion]}<1) {
		/if (${FindItemCount[=Fishing Pole]}>0) {
			/Echo Equiping ---> Fishing Pole <---
			/delay ${Math.Calc[${DelayMult}*1]}s
			/nomodkey /ctrl /itemnotify ${FindItem[=Fishing Pole].InvSlot} leftmouseup
			/delay 2s ${Cursor.ID}
			/nomodkey /itemnotify mainhand leftmouseup
			/delay 1s
			/autoinv
			/delay ${Math.Calc[${DelayMult}*2]}s
			/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]}<1) /goto :ReCast
			/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]}>0) /return
		}
	}

	/echo  You need to put your fishing pole in your primary hand.
	/endm
	/return

Sub CheckBait

	/if (${FindItemCount[=Name of bait here]}>0) {
		/delay ${Math.Calc[${DelayMult}*1]}s
		/nomodkey /ctrl /itemnotify ${FindItem[=[COLOR="Lime"]NAME OF BAIT HERE[/COLOR]].InvSlot} leftmouseup
		/delay 2s ${Cursor.ID}
		/nomodkey /itemnotify mainhand leftmouseup |**slot for bait? Ammo? **| 
		/delay 1s
		/autoinv
		/delay ${Math.Calc[${DelayMult}*2]}s
		/return
	}

Sub Event_BrokenPole
   /call CheckPole
/return

Sub Event_NoBait
   /call CheckBait
/return
 
Last edited:
  • Love
Reactions: EQDAB
Tryed using this today and keep running into the same issue.
Flow ran into another subroutine. (Sub Event_BrokenPole)
fish.mac@99 (CheckBait): Sub Event_BrokenPole
fish.mac@22 (Main): /Call CheckBait
The Current macro has ended

Code:
#turbo

#event BrokenPole "#*#You can't fish without a fishing pole, go buy one.#*#"
#event NoBait "#*#You can't fish without fishing bait, go buy some.#*#"

Sub Main
    /cleanup
    :Fish
        /call CheckPole
	/call CheckBait 
        /doability Fishing
        /delay 65 
        /doevents

        /if (!${Cursor.ID}) /goto :Fish

        /if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
            /destroy
            /delay 1s
        } else {
            /if (${Cursor.Name.Equal[Rusty Dagger]}) {
                /destroy
                /delay 1s
            } else {
                /call KeepItem
            }
      }
   /goto :Fish
/return

Sub KeepItem
   /if (${Cursor.Name.NotEqual[Fish Scales]}) /echo Caught ${Cursor.Name}
   /autoinventory
/return

Sub CheckPole
	/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]} || ${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}) /return
	
	/if (!${Me.Inventory[mainhand].Name.Find[Fishing Pole]} || !${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}) {
		/if (${FindItemCount[=Fisherman's Companion]}>0) {
:ReCast
			/Echo Summoning ---> Brell's Fishin' Pole <---
			/delay 1s
			/casting 29175|item
:CastWait			
			/delay 1s
			/if (${Me.Casting.ID}) /goto :CastWait
			/if (${Cursor.ID}) /autoinventory
			/delay 1s
			/if (${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}<1) /goto :ReCast
			/if (${Me.Inventory[mainhand].Name.Find[Brell's Fishin' Pole]}>0) /return
		}
	}

	/if (!${Me.Inventory[mainhand].Name.Find[Fishing Pole]} && ${FindItemCount[=Fisherman's Companion]}<1) {
		/if (${FindItemCount[=Fishing Pole]}>0) {
			/Echo Equiping ---> Fishing Pole <---
			/delay ${Math.Calc[${DelayMult}*1]}s
			/nomodkey /ctrl /itemnotify ${FindItem[=Fishing Pole].InvSlot} leftmouseup
			/delay 2s ${Cursor.ID}
			/nomodkey /itemnotify mainhand leftmouseup
			/delay 1s
			/autoinv
			/delay ${Math.Calc[${DelayMult}*2]}s
			/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]}<1) /goto :ReCast
			/if (${Me.Inventory[mainhand].Name.Find[Fishing Pole]}>0) /return
		}
	}

	/echo  You need to put your fishing pole in your primary hand.
	/endm
	/return

Sub CheckBait

	/if (${FindItemCount[=Name of bait here]}>0) {
		/delay ${Math.Calc[${DelayMult}*1]}s
		/nomodkey /ctrl /itemnotify ${FindItem[=Catch-A-Lot Bait].InvSlot} leftmouseup
		/delay 2s ${Cursor.ID}
		/nomodkey /itemnotify mainhand leftmouseup |**slot for bait? Ammo? **| 
		/delay 1s
		/autoinv
		/delay ${Math.Calc[${DelayMult}*2]}s
		/return
	}

Sub Event_BrokenPole
   /call CheckPole
/return

Sub Event_NoBait
   /call CheckBait
/return
 
Last edited:
The last macro has an error in the CheckBait sub. Change the sub to this which will move the return outside of the if statement

In glancing at the code, I am not sure you need the events, since you are running the CheckPole and CheckBait routines every loop anyway. I don't think they hurt, just may not be necessary.

Code:
Sub CheckBait

	/if (${FindItemCount[=Name of bait here]}>0) {
		/delay ${Math.Calc[${DelayMult}*1]}s
		/nomodkey /ctrl /itemnotify ${FindItem[=Catch-A-Lot Bait].InvSlot} leftmouseup
		/delay 2s ${Cursor.ID}
		/nomodkey /itemnotify mainhand leftmouseup |**slot for bait? Ammo? **| 
		/delay 1s
		/autoinv
		/delay ${Math.Calc[${DelayMult}*2]}s
	}
/return
 
  • Like
Reactions: EQDAB
The last macro has an error in the CheckBait sub. Change the sub to this which will move the return outside of the if statement

In glancing at the code, I am not sure you need the events, since you are running the CheckPole and CheckBait routines every loop anyway. I don't think they hurt, just may not be necessary.

Code:
Sub CheckBait

	/if (${FindItemCount[=Name of bait here]}>0) {
		/delay ${Math.Calc[${DelayMult}*1]}s
		/nomodkey /ctrl /itemnotify ${FindItem[=Catch-A-Lot Bait].InvSlot} leftmouseup
		/delay 2s ${Cursor.ID}
		/nomodkey /itemnotify mainhand leftmouseup |**slot for bait? Ammo? **| 
		/delay 1s
		/autoinv
		/delay ${Math.Calc[${DelayMult}*2]}s
	}
/return

It kinda pains me that nobody else has noticed that "Name of bait here" is in both FindItem TLO calls. Namely at the beginning of the if statement. So whatever the name of the bait is..... that goes in ${FindItemCount[=BaitName]} <~~~~

Also, I didn't really go out of my way to throw that code out. The if statement should check to see if the FindItemCount is false I do believe, IE: FindItemCount returns a 0 then you need to use your bait clicking item. Then below clicking for the bait you'll find the note that says **slot for bait? Ammo? That implies that I don't know what slot the bait goes in, but you don't put your bait in your mainhand where the fishing pole goes. So even without the issue mentioned by nightmare there's still a bit wrong with this bit.

I realize not everyone codes. I just didn't bother to try because I was under the impression that someone else posted it. If it's still jacked up tomorrow pending my classwork I'll try to recall looking into this. Perhaps even add an INI entry for both the pole and the bait.
 
Last edited:
  • Love
Reactions: EQDAB
No Ini, but I've tested everything but the Fisherman's Companion and Brell's Fishing Pole. Because I don't own them.

For those of you that want to get drunk I should probably add an option to do that while fishing lol.

But seriously. I've also added a Destroy check. Before it was just checking for the sandle or the dagger and then destroying them. At the top of the macro is an option
Code:
 /declare Destroy bool outer FALSE
You can change that to true if you want to keep those items for some reason.

As a side note I did a quick look on EQ to find bait and it seemed to all have the word "bait" in it. Though I'm not certain. So It's a generalized check. If you run out of bait it will check for possesion of Endless Worms and then cast it if you have it. If you have it and the cast timer isn't ready it'll wait for it to be ready. Though It summons 10 and only has a minute recast, so I don't see that happening.

To my displeasure I had to create a new sub that checked for your inventory window to be open and then open all of your bags. In order to get accurate InvSlot locations for items for moving them about the bags MUST BE OPEN. So I've included a sub that does just that.
 

Attachments

  • Fish.mac
    3.8 KB · Views: 11
I'm getting an error, Subroutine Main not found. Which is odd because Main is right there.
 
I'm getting an error, Subroutine Main not found. Which is odd because Main is right there.

That's cuz I'm an idiot. :) At the top I added a note to show that I updated it. I started that note with |** which is a box style comment, But I failed to end it with **| which is the closing command. Basically I commented out the entire macro like a tool.


This fixes it. My fault.
 

Attachments

  • Fish.mac
    4.2 KB · Views: 4
Last edited:
  • Like
Reactions: EQDAB
As someone with a lengthy string of embarrassing fuck ups, I shall spare you the taunting. :)
 
  • Like
Reactions: EQDAB
Couple more errors.

1) At the top you have #Warning. This caused it to fail. I just removed it

2) I get a TON of access violation errors. But it still works.
 
  • Like
Reactions: EQDAB
Couple more errors.

1) At the top you have #Warning. This caused it to fail. I just removed it

2) I get a TON of access violation errors. But it still works.

Access violations are typically due to the bags being closed. Are your bags close :-x

I don't get those errors on my character so I'm not sure how I could go about assessing the damage.

I have #Warning because if there are undeclared variables the macro shouldn't be trying to use them and it will make it pause. It's supposed to do that. The fail would be if I failed to declare a variable. But since there are none that i"m aware of it shouldn't be an issue.

Interesting that you get the access violation errors though. I'd be curious to know the situation in which that occurs.
 
  • Like
Reactions: EQDAB
This is a video of it working without any of those access violations you've referenced (apologies for the constant sloshing, someone is leveling up their swimming in the fishing pond). Note that #Warning is still included in this macro.

While running this I pulled my fishing pole out of my hand while fishing and put it in a bag and found that I was missing an Event.

Code:
#event Pole "#*#fishing pole in your primary hand.#*#"

which was added.

Also,
Code:
#event Pole "#*#You can't fish without a fishing pole, go buy one.#*#"
was changed to just Pole instead of BrokenPole. And the subsequent event sub was altered as well. Both of these events do the same thing.

I found an error in pole sub that had a random if statement without a command and no closing bracket. That has been corrected.

You haven't responded about if your bags were closed or not. I have the macro check to see if your inventory window is open and if it is not it does a /keypress i

I've changed the OpenAllBags sub to use /windowstate instead of /keypress i
Code:
	|** Opening your inventory **|
	/if (!${Window[InventoryWindow].Open}) {
		/windowstate InventoryWindow open
	}
This avoids worrying about if you've changed a hotkey.

I hope this clears up any issues. Your feedback is appreciated.
 

Attachments

  • Fish.mac
    4.4 KB · Views: 12
Last edited:
  • Love
Reactions: EQDAB
How do i find and open the .ini and how do I change it to keep certain things and destroy others? specifically the /mac fish actions
 
there is no ini for it. the only things that it currently filters out are in this section of it.

/if (!${Cursor.ID}) /goto :Fish

/if (${Destroy}) {
/if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
/destroy
/delay 1s
} else {
/if (${Cursor.Name.Equal[Rusty Dagger]}) {
/destroy
/delay 1s
} else {
/call KeepItem
}
}
} else {
/call KeepItem
}


if you want to add other stuff, add more sections of
/if (${Cursor.Name.Equal[item name]}) {
/destroy
/delay 1s
} else {
 
  • Like
Reactions: EQDAB
there is no ini for it. the only things that it currently filters out are in this section of it.

/if (!${Cursor.ID}) /goto :Fish

/if (${Destroy}) {
/if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
/destroy
/delay 1s
} else {
/if (${Cursor.Name.Equal[Rusty Dagger]}) {
/destroy
/delay 1s
} else {
/call KeepItem
}
}
} else {
/call KeepItem
}


if you want to add other stuff, add more sections of
/if (${Cursor.Name.Equal[item name]}) {
/destroy
/delay 1s
} else {


ok, new to all this, so where am I adding or removing these commands?
 
/if (!${Cursor.ID}) /goto :Fish

/if (${Destroy}) {
/if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
/destroy
/delay 1s
} else {
/if (${Cursor.Name.Equal[Rusty Dagger]}) {
/destroy
/delay 1s
} else {
/call KeepItem
}




becomes:


/if (!${Cursor.ID}) /goto :Fish

/if (${Destroy}) {
/if (${Cursor.Name.Equal[Tattered Cloth Sandal]}) {
/destroy
/delay 1s
} else {
/if (${Cursor.Name.Equal[Rusty Dagger]}) {
/destroy
/delay 1s
} else {
/if (${Cursor.Name.Equal[item name]}) {
/destroy
/delay 1s
} else {
/call KeepItem
}
 
  • Like
Reactions: EQDAB
Although how many items are you wanting to add to this? just 2 or 3 that would be the easy way to do, but if you are wanting this to be more like yafm for fishing everywhere, should probably do something different
 
  • Like
Reactions: EQDAB