adv_fishing.mac (Advanced Fishing Macro. v1.0beta 01/07/04)

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Panther
decaying skeleton
decaying skeleton
Posts: 3
Joined: Thu Jul 01, 2004 4:04 pm

adv_fishing.mac (Advanced Fishing Macro. v1.0beta 01/07/04)

Post by Panther » Thu Jul 01, 2004 8:44 pm

This is my first macro attempt so be kind if I have made any mistakes or use bad coding methods. This is my way of giving a little something back to the fantastic MQ2 community.

This is an advanced fishing macro that uses a FishingLoot.ini file for zone specific fishing loot to keep. It has the following :-
  • FishingLoot.ini file for zone specific fishing
    Uses Fisherman's Companion to autocast Brell's Fishin' Pole
    Statistics on your fishing progress
    GM Watch and auto macro exit
This Script is NOT 100% perfect so I know this might not work properly for some people and a few features lacking. Possible future features :-
  • Percentage values in the statistics
    Autoend macro when a specific skill is reached
    Ability to use normal fishing poles from inventry
Hope it is of use to you.
Panther

adv_fishing.mac

Code: Select all

|---------------------------------------------------------------------------------
| Advanced Fishing Macro
| adv_fishing.mac
| Author      : panther
| Version     : v1.0beta 2004-07-01 18:58pm GMT
| Useage      : /macro adv_fishing
| Description :
| This macro will fish for you and keep all items in FishingLoot.ini. You need a
| fisherman's companion in an inventory slot for this macro to work properly.
|---------------------------------------------------------------------------------

#turbo 10

#event BrokenPole "Your fishing pole broke!"
#event LostBait "You lost your bait!"
#event NeedPole "You can't fish without a fishing pole, go buy one."
#event NothingCaught "You didn't catch anything."
#event OutOfBait "You can't fish without fishing bait, go buy some."
#event PrimaryHand "You need to put your fishing pole in your primary hand."
#event SkillUp "You have become better at #1#! (#2#)"
#event SpillBeer "You spill your beer while bringing in your line."

Sub Main

	|------------------------------------------------------------
	|Should I display fishing stats? (1 for yes, 0 for no)
	|------------------------------------------------------------
	/declare RV_DisplayStats     int outer  1


	/echo Starting up ${Macro}
	/declare int_BrokenPole     int outer  0
	/declare int_ItemsDropped     int outer  0
	/declare int_LostBait     int outer  0
	/declare int_NothingCaught     int outer  0
	/declare int_SpillBeer     int outer  0
	/declare int_TotalCasts     int outer  0
	|------------------------------------------------------------ 
	|Load in Loot Table. 
	|------------------------------------------------------------ 
	/call ReadINI FishingLoot.ini "${Zone.Name}" Loot 
	/if (!${Defined[RV_LootArray]}) { 
		/echo No Loot Table Created... Please create one.
		/endmacro 
	}

	/autoinventory

	:Start
		/call GMCheck
		/delay 2s
		/if (${Cursor.ID}) /call Looting
		/if (${Me.AbilityReady[Fishing]}) {
			/delay 1s
			/varcalc int_TotalCasts ${int_TotalCasts}+1
			/doability Fishing
		}
		/doevents
	/goto :Start
/return 


|--------------------------------------------------------------------------------
|SUB: Display fishing stats.
|--------------------------------------------------------------------------------
Sub DisplayStats

	/declare nArray  int local
	/echo Total number of casts = ${int_TotalCasts}
	/echo Items fished so far
	/echo -------------------
	/if (${Defined[RV_LootArray]}) {
		/for nArray 1 to ${RV_LootArray.Size}
			/echo ${Int[${RV_LootStats[${nArray}]}]} - ${RV_LootArray[${nArray}]}'s
		/next nArray
	}
	/echo
	/echo Bad fishing so far
	/echo ------------------
	/echo ${int_BrokenPole} - Broken poles
	/echo ${int_ItemsDropped} - Items dropped
	/echo ${int_LostBait} - Lost bait
	/echo ${int_NothingCaught} - Nothing caught
	/echo ${int_SpillBeer} - Spilt your beer
/return

|--------------------------------------------------------------------------------
|SUB: Check for GM's in zone.
|--------------------------------------------------------------------------------
Sub GMCheck

	/if (${Spawn[gm].ID}) {
		/beep
		/beep
		/beep
		/echo GM entered the zone!
		/echo For safty reasons ending the macro...
		/endmacro
	}

/return

|--------------------------------------------------------------------------------
|SUB: Looting based on FishingLoot.ini.
|--------------------------------------------------------------------------------
Sub Looting

	/declare LootCheck   int inner  0

	/for LootCheck 1 to ${RV_LootArray.Size}
		/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
			/echo Keeping a ${Cursor.Name}... WOOT!
			/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1
			/autoinventory
		}
	/next LootCheck

	/if (${Cursor.ID}) {
		/echo Dropping a ${Cursor.Name}...
		/drop
		/varcalc int_ItemsDropped ${int_ItemsDropped}+1
	}

	/if (${RV_DisplayStats}) /call DisplayStats
/return

|--------------------------------------------------------------------------------
|SUB: Read loot table from the INI file.
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,SectionName,ArrayType)

	/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
	/delay 1s

	/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
		/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
		/delay 1s
		/return
	}
	/declare nValues     int local  1
	/declare nArray      int local  0
	/declare KeySet      string local  ${Ini[${FileName},${SectionName}]}

	:CounterLoop
	/if (${String[${Ini[${FileName},${SectionName},${ArrayType}${nValues}]}].Equal[null]}) {
		/varcalc nValues ${nValues}-1
		/goto :MakeArray
	}
	/varcalc nValues ${nValues}+1
	/goto :CounterLoop

	:MakeArray
	/if (!${nValues}) /return
	/if (${FileName.Equal["FishingLoot.ini"]}&&${nValues}>0) {
		/echo Declaring Loot Array...
		/declare RV_LootArray[${nValues}]  string outer
		/declare RV_LootStats[${nValues}]  string outer
	}

	/for nArray 1 to ${nValues}
		/if (${FileName.Equal["FishingLoot.ini"]}) {
			/varset RV_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
			/varset RV_LootStats[${nArray}] 0
		}
	/next nArray

	/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
	/delay 1s

/return


|--------------------------------------------------------------------------------
|SUB: Event subroutines.
|--------------------------------------------------------------------------------
Sub Event_BrokenPole
	/varcalc int_BrokenPole ${int_BrokenPole}+1
	/varcalc int_NothingCaught ${int_NothingCaught}-1
/return

Sub Event_LostBait
	/varcalc int_LostBait ${int_LostBait}+1
	/varcalc int_NothingCaught ${int_NothingCaught}-1
/return

Sub Event_NeedPole
	/cast item "Fisherman's Companion"
	/delay 11s
	/autoinventory
/return

Sub Event_NothingCaught
	/varcalc int_NothingCaught ${int_NothingCaught}+1
/return

Sub Event_OutOfBait
	/Echo Ran out of Bait.
	/sit off
	/sit on
	/camp
	/endmacro
/return

Sub Event_PrimaryHand
	/cast item "Fisherman's Companion"
	/delay 11s
	/autoinventory
/return

Sub Event_SkillUp(SkillUpText,Skill,int Amount)
	/popup Fishing increased to - ${Amount}
	/echo Fishing increased to - ${Amount}
/return

Sub Event_SpillBeer
	/varcalc int_SpillBeer ${int_SpillBeer}+1
	/varcalc int_NothingCaught ${int_NothingCaught}-1
/return
|--------------------------------------------------------------------------------
fishingloot.ini

Code: Select all

[Neriak - Commons]
Loot1=Fresh Fish
Loot2=Fish Scales

[The Plane of Nightmares]
Loot1=Fresh Fish
Loot2=Fish Scales
Loot3=Crawdad
Loot4=Waterleaf Scale
Loot5=Nightmare Cichlid

[The Plane of Valor]
Loot1=Fresh Fish
Loot2=Fish Scales
Loot3=Crawdad
Loot4=Vallorian Discus

[40oz]
a hill giant
a hill giant
Posts: 156
Joined: Tue Nov 12, 2002 12:14 pm

Post by [40oz] » Fri Jul 02, 2004 9:41 am

Haven't tried it, but just from reading it over if it's really your first macro - nice formatting! I hate hard to read macros, but yours is nice and cleanly/consistently formatted. Something not enough people do.

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Fri Jul 02, 2004 9:51 am

Agreed, very clean, all sections marked and nothing run together.

It is scripts like this that I love to see. They are my bread and butter in decyphering how to build scripts/macros. RTFM gets me only so far, seeing an actual well written and documented bit of code does me far more good.

Thanks!

~twolate~
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Jul 02, 2004 11:16 am

Post by ~twolate~ » Fri Jul 02, 2004 11:19 am

Very clean and easy to manipulate. Great script.

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Sun Jul 11, 2004 3:49 pm

Great Macro - works very well. I'm just having 1 problem.

I started this macro, and proceeded to watch a movie while glancing at screen every other minute or so. One time when I glanced up I saw it dropped a fish I told it to keep. I did a bit of investigation, and I found that basically the fishing needs to be slowed down just a tad. It looked as if the macro and EQ just got a little befuddled or something, and the Macro figured I just had shit on my cursor and dropped it, when in fact it was loot from the last cast.

No big deal - I'm not a programmer by any means, so firstly Thank you for this macro - Secondly, can I change

Code: Select all

/delay 2s
to

Code: Select all

/delay 2.5s
or does the delay need to be in whole numbers?

(Apologize in advance if it's in the manual, just now dawned on me to check what it says, so I'll read it now, but since I don't want to type this again I'll post this now as well.

Thanks again!
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Sun Jul 11, 2004 3:52 pm

Ok, I RTFM (past tense) and I think I found that 2.5 seconds would be represented by

Code: Select all

/delay 25
right?

*edited to correct spelling errors*
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]

Hubba
orc pawn
orc pawn
Posts: 22
Joined: Wed Jul 14, 2004 5:00 am

Post by Hubba » Wed Jul 14, 2004 5:03 am

In cabilis there is a NoDrop fish, so it needs to be dested.

As I can read, this macro dropps all unwanted fish.

User avatar
aChallenged1
a grimling bloodguard
a grimling bloodguard
Posts: 1804
Joined: Mon Jun 28, 2004 10:12 pm

Post by aChallenged1 » Wed Jul 14, 2004 6:15 am

This macro will fish for you and keep all items in FishingLoot.ini
This macro will destroy anything not in the INI. Build an INI for the Cabilis side you are on with the fish you wish to keep and you're good to go.

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Wed Jul 14, 2004 7:43 am

Actually, he's right. It does drop all unwanted fish, and a No-Drop fish that's NOT in the ini would fark this up. (Mainly becuase EQ won't let you drop it, and you can' fish with something in your hand)

2 workarounds - 1 dangerous and 1 simple.

First, the simple one. Put the No-Drop fish in your ini. When you're done fishing just destroy all stacks of the No-Drop fish.

The Dangerous one is to change the macro to /destroy instead of drop the "bad" fish. This is dangerous because if you start playing in your inventory while it's fishing - lets say you happen to click and pick up you epic, or that stack of the tradeskill element you've been saving for quite a while... Instead of the macro seeing it and saying "WTF, I'm gonna drop this" it says "WTF - *poof* Baleted!"

Dunno bout you but I'd rather just destroy them after yer all done...
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]

zhigit
decaying skeleton
decaying skeleton
Posts: 1
Joined: Fri Jul 23, 2004 2:26 am

Post by zhigit » Fri Jul 23, 2004 2:29 am

Have some basic questions. I am attempting to use this macro but i cannot get it to work. First im am in Cobalt Scar fishing for the cod but i cannot get the zone to be recognized - so i am wondering where do i put the Fishing.ini.

The other question would be how would i type in the zone and the fish to keep. I currently have it like this in the fishing.ini
[Cobaltscar]
Loot1=Cobalt Cod
Loot2=Dragon Bay Snapper
Thanks in advance

bawldrik
orc pawn
orc pawn
Posts: 11
Joined: Wed Aug 11, 2004 12:40 am

Post by bawldrik » Wed Aug 11, 2004 12:43 am

This still working ?? I get crash every time
cheers :oops:
Hmmmm, no macros working at all, even the ones I was using yesterday...scratches head
Oh, so they have internet on computers now! - and yes I donated

TheNewGuy
a snow griffon
a snow griffon
Posts: 307
Joined: Sat Jul 10, 2004 9:33 am
Contact:

Post by TheNewGuy » Wed Aug 11, 2004 10:09 am

Yes, it works fine.

in your fishingloot.ini you would have lines similar to this...

Code: Select all

[The Plane of Nightmares] 
Loot1=Fresh Fish 
Loot2=Fish Scales 
Loot3=Crawdad 
Loot4=Waterleaf Scale 
Loot5=Nightmare Cichlid 

[The Plane of Valor] 
Loot1=Fresh Fish 
Loot2=Fish Scales 
Loot3=Crawdad 
Loot4=Vallorian Discus

[Cobaltscar]
Loot1=Cobalt Cod
[quote="dont_know_at_all"][quote="sybarite"]Um.. search works fine for me (used spell_routines.inc)... Try scrolling down you lazy fuck.

http://www.macroquest2.com/phpBB2/viewtopic.php?t=8964&highlight=spellroutines+inc[/quote]

That's great but he's looking for move.inc, you fucking spastic colon.[/quote]

wrangler
a ghoul
a ghoul
Posts: 93
Joined: Fri Nov 28, 2003 3:07 pm

Post by wrangler » Wed Aug 11, 2004 11:22 am

works fine for me also, caught hundreds of storm salmon with it

just make sure your spelling zone name correctly, that was my problem at 1st

JP5
a lesser mummy
a lesser mummy
Posts: 70
Joined: Tue Jul 06, 2004 10:32 pm

Post by JP5 » Tue Aug 17, 2004 9:39 pm

Spelling:

/echo ${Zone}

PhoenixZorn
Macro Czar
Posts: 127
Joined: Fri Dec 12, 2003 2:20 pm
Contact:

Post by PhoenixZorn » Mon Aug 30, 2004 11:54 am

I love fishing macros... especially ones that use Fisherman's Companion. Panther, your macro will be included with the future release of MQ2. Good commentation at the beginning and through out the entire macro. I saw nothing but praise about this macro, and it gets my blessing.

One request... between casts, make it clicky "Brell's Fishin' Pole" and drink the summoned Ale. =)