Fishing.mac -- MQData version.

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Fishing.mac -- MQData version.

Post by Preocts » Thu Jan 29, 2004 2:42 pm

Well. Since it's an historic event and all, the death of $params, I thought I'd dust off my ol'money-makin' fishing script and convert it over. Here is is, short and sweet.

Oh yeah, this one works with an ini file because I'm using it as an include for my druid's macro which runs constantly. Once I get all the bugs worked out of that one I'll post it.

Comments, suggestions, addtions welcome.

Code: Select all

| Fishing.mac - By Preocts. Updated April 21 2004
|
| Credit given where credit is do:
| grimjack -- learned much from his Fish2.mac
| Lax -- For endless posts of wisdom buried under profanity
| MQ2 Forums -- Where would I be without everyone who posts there?
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NOTE: This macro, as is, requires the existance of a "Fisherman's Companion" located in a Main Inventory slot.
| NOTE: You must also have your primary slot EMPTY or with a Brell's Fishin Pole equiped.
| This macro uses an INI file to control what is kept and what is destroyed.
| New items fished will be added to the existing list and set to keep by default.
| This can be changed by editing the INI and change -1 to 0 in which case that item will be destroyed

#Event Pocket "You caught"
#Event Pole "You can't fish without a fishing pole, go buy one."
#Event End "You can't fish without fishing bait, go buy some."
#Event End "You stop fishing"
#Event End "Trying to catch land sharks perhaps?"
#Event End "You must be on dry land to fish."

Sub Main
  
   /newif (!${Ini[fishing.ini,DestroyList].Length}) {
     /ini "fishing.ini" "DestroyList" "Rusty Dagger" "0"
   }
   
   /newif (${Me.Inventory["primary"].ID} && ${Me.Inventory["primary"].Name.NotEqual["Brell's Fishin' Pole"]}) {
     /echo Please remove whatever is in your primary hand and restart this macro.
     /return
   }
   /call CheckForFishingBox

   :Loop
     /newif (${Me.AbilityReady["Fishing"]}) {
       /delay 1s
       /newif (${Cursor.ID}) /call Event_Pocket
       /newif (${Me.State.Equal["STAND"]}) /sit 
       /doability Fishing
     }
     /doevents
     /delay 2
    /goto :Loop
/return
 
Sub CheckForFishingBox
   /declare TempLoop local
   /for TempLoop 22 to 29
     /newif (${Me.Inventory[@TempLoop].Name.Equal["Fisherman's Companion"]}) {
       /return
     }
   /next TempLoop

   /echo Fisherman's Companion not found.
   /echo It must be in an Inventory Slot
   /endmacro
/return

Sub Event_Pole  
  /newif (${Me.Inventory["primary"].Name.Equal["Brell's Fishin' Pole"]}) /return |Sometimes EQ gives two or more messages
  /call CheckForFishingBox
  /call Event_Pocket  
  /newif (${Me.State.Equal["SIT"]}) /sit 
  /cast item "Fisherman's Companion"
  /delay 15s
  :WaitForEquip
    /autoinventory
    /newif (${Cursor.ID}) /goto :WaitForEquip
  /newif (${Me.State.Equal["STAND"]}) /sit 
/return

Sub Event_Pocket

  /newif (!${Ini[fishing.ini,DestroyList,${Cursor.Name}].Length}) {
    /ini "fishing.ini" "DestroyList" "${Cursor.Name}" "-1"
  } else {
    /newif (!${Ini[fishing.ini,DestroyList,${Cursor.Name}]}) {
      /destroy
      /delay 5
      /return
    }
  }

  :LootIt
    /autoinventory
    /delay 5
    /newif (${Cursor.ID}) /goto :LootIt
/return

Sub Event_End
  /endmacro
/return
Ini is created when run.
Last edited by Preocts on Wed Apr 21, 2004 3:35 pm, edited 7 times in total.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Thu Jan 29, 2004 3:18 pm

[deleted]
Last edited by Preocts on Wed Apr 21, 2004 5:48 am, edited 1 time in total.

Scary_Penguin
a lesser mummy
a lesser mummy
Posts: 76
Joined: Sun Nov 16, 2003 11:45 am

Post by Scary_Penguin » Fri Jan 30, 2004 4:34 am


Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Wed Apr 21, 2004 5:51 am

::sighs:: Ah I learned so much logic structure from that macro.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Fishing.mac -- MQData version.

Post by wassup » Wed Apr 21, 2004 7:14 am

Preocts wrote: Sub Event_Pocket
.
.
.
/newif (${String[${Ini[fishing.ini,DestroyList,${Cursor.Name}]}].Equal["NULL"]}) {
Heya Preocts... was just wondering...
string Ini[filename,section,key,default]

So couldn't this be done like:

Code: Select all

/newif (${Ini[fishing.ini,DestroyList,${Cursor.Name}].Equal["NULL"]})

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Wed Apr 21, 2004 7:49 am

Oddly enough if I don't force Ini[] to be a string it doesn't work.

Code: Select all

  | ValueName in the ini does not exist:
  /echo ${Ini[fishing.ini,DestroyList,${Cursor.Name}].Equal["NULL"]}
  | Yields NULL. While:
  /echo (${String[${Ini[fishing.ini,DestroyList,${Cursor.Name}]}].Equal["NULL"]})
  | Yields TRUE
I dunno, it works this way. A little more cluttered but I think the whole macro has two lines like this.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Wed Apr 21, 2004 2:01 pm

The reason is because if the string is NULL, you wont get a string object. You'll just get NULL. This means to check it you should use:

${Ini[fishing.ini,DestroyList,${Cursor.Name}].NotEqual["NULL"]}
or
${Ini[fishing.ini,DestroyList,${Cursor.Name}].Length}

Either of these will give you a non-zero number (aka "true") if the string is not empty.
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Wed Apr 21, 2004 2:47 pm

Updated it. I like the idea of using .Length to check, just makes it cleaner starting with a numaric condition in the first place. Thank you Lax :)

trogdor
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue Mar 23, 2004 9:07 pm

Post by trogdor » Wed Apr 21, 2004 5:53 pm

had a problem with

Code: Select all

 /newif (${Me.Inventory["primary"].ID} && ${Me.Inventory["primary"].Name.NotEqual["Brell's Fishin' Pole"]}) { 
     /echo Please remove whatever is in your primary hand and restart this macro. 
     /return 
   } 
it would kill the macro even if there was nothing in the slot i just removed it but you may wana look into it
Trogdor strikes agian!!!

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Thu Apr 22, 2004 5:53 am

trogdor wrote:had a problem with

Code: Select all

 /newif (${Me.Inventory["primary"].ID} && ${Me.Inventory["primary"].Name.NotEqual["Brell's Fishin' Pole"]}) { 
     /echo Please remove whatever is in your primary hand and restart this macro. 
     /return 
   } 
it would kill the macro even if there was nothing in the slot i just removed it but you may wana look into it
Download the new .zip. The bug with /if's was fixed.