Problems with default fishing macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

ImaNoob
a ghoul
a ghoul
Posts: 89
Joined: Mon Mar 08, 2004 4:37 am

Problems with default fishing macro

Post by ImaNoob » Mon Mar 08, 2004 4:44 am

Hello, let me first say I LOVE this program, the mapfilter is great for finding that uber hard to find NPC.

Anyways, I wanna fish, but I'm having problems with the default fishing macro, I'm hoping someone can tell me what I'm doing wrong here...

Whenever I load it I get something akin to Invalid Variable
/varset v99 0

So I removed it and got the same statment about

/varset t1 5m

I then removed it and got
Unparsable (something or other sorry no cut and paste)

/if n $calc(@NoPoles+@NoBait)>0 /call Event_Timer

SO whats going wrong here?

Just for discussion I am including the macro here, if ti is bad form I will refrain in the future from posting the entire file... But here goes.

Code: Select all

| - Fish.mac -
|
#turbo
#event NoBait "You can't fish without fishing bait, go buy some."
#event Cast "You cast your line."
#event Skillup "You have become better at Fishing"
#chat tell

Sub Main 
   /declare StatSandal global
   /declare StatDagger global
   /declare StatScales global
   /declare StatFresh global
   /declare StatZone global
   /declare Skillups global
   /declare Casts global
   /declare NoPoles local
   /declare NoBait global

   /call ClearStats
   /varset v99 0
   /varset t1 5m
   /doevents flush
   :Fish
      /call CheckPole
      /varset NoPoles $return
      /doevents NoBait
      /if n @NoPoles==1 /call DoLog "Aborting: Out of poles..."
      /if n @NoBait==1 /call DoLog "Aborting: Out of bait..."
      /if n $calc(@NoPoles+@NoBait)>0 /call Event_Timer
      /if n $calc(@NoPoles+@NoBait)>0 /return
      /if $char(ability,fishing)>0 /if $cursor()==NULL /doability Fishing
      /if $cursor()==TRUE /call KeepStats "$cursor(name)"
      /if "$cursor(name)"=="Tattered Cloth Sandal" /call Destroy
      /if "$cursor(name)"=="Rusty Dagger" /call Destroy
      /if $cursor()==TRUE /call KeepItem
      /doevents
    /goto :Fish
/return

Sub Destroy
   /click left destroy 
   /delay 1s
/return

Sub CheckPole
   /if "$equip(primary,name)"~~"Fishing Pole" /return 0
   /finditem similar "Fishing Pole"
   /if "$cursor()"=="NULL" /return 1
   /click left primary
   /delay 1s
   /if "$cursor()"!="NULL" /autoinventory
/return 0

Sub KeepItem
   /if "$cursor(name)"!="Fish Scales" /call DoLog "Caught $cursor(name)..."
   /autoinventory
/return

Sub KeepStats(Item)
   /if "@Item"~~"cloth sandal" {
      /varadd StatSandal 1
   } else /if "@Item"~~"rusty dagger" {
      /varadd StatDagger 1
   } else /if "@Item"~~"fish scales" {
      /varadd StatScales 1
   } else /if "@Item"~~"fresh fish" {
      /varadd StatFresh 1
   } else {
      /varadd StatZone 1
   }
/return

Sub Event_NoBait
  /varset NoBait 1
/return

Sub Event_Cast
  /varadd Casts 1
/return

Sub Event_Skillup
  /varadd Skillups 1
/return

Sub Event_Timer(Timer,Value)
   /call DoLog "Run time: $calc($running/60) min - Casts: $int(@Casts) - Skill ups: $int(@Skillups)"
   /call DoLog "Found: $int(@StatSandal) sandals - $int(@StatDagger) daggers - $int(@StatScales) scales - $int(@StatFresh) fresh fish - $int(@StatZone) zone items"
   /varset @Timer @Value
/return

Sub ClearStats
   /varset StatSandal 0
   /varset StatDagger 0
   /varset StatScales 0
   /varset StatFresh 0
   /varset StatZone 0
   /varset Skillups 0
   /varset Casts 0
/return

Sub Event_Chat(Channel,Sender,Text)
   /mqlog ** @Sender: '@Text'
/return

Sub DoLog(Text)
   /mqlog @Text
   /echo @Text
/return
[/code]
Last edited by ImaNoob on Tue Mar 30, 2004 4:56 am, edited 1 time in total.

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Mon Mar 08, 2004 4:45 am

Using the search feature, and "fish and forage" in the search field, it turned up this fish and forage macro in the Macro Depot section: http://macroquest2.com/phpBB2/viewtopic.php?t=5085

ImaNoob
a ghoul
a ghoul
Posts: 89
Joined: Mon Mar 08, 2004 4:37 am

Thank you

Post by ImaNoob » Mon Mar 08, 2004 12:03 pm

Thank you, I also noticed after I posted this that I posted to the wrong part of the forum, if someone would please be so kind as to move this to the section relevant to debugging macros, I would greatly appreciate knowing what is wrong with the default fishing macro.

And again thank you.

Chaesar
orc pawn
orc pawn
Posts: 15
Joined: Mon Feb 23, 2004 1:28 pm

Post by Chaesar » Mon Mar 08, 2004 3:15 pm

I believe that the way variables are handled was changed several months ago and the some of the macros that are included in the download still use the old method (characterized by the vNN format), which no longer works.

Your best bet is to look in/search the Macro Depot forum as those macros are written using the new variable syntax.

HTH