Brellfishing won't work :(

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

Stilgar

Brellfishing won't work :(

Post by Stilgar » Thu Oct 23, 2003 9:30 pm

heya :) I modified the original fishing.mac so it works with Brell's fishin' pole (recasts a new pole if the old one breaks)

but this is the error message I get:


Ending macro: Bad variable in /var function.
brellfishing.mac@92 (ClearStats): /varset v0 0
brellfishing.mac@11 (Main): /call ClearStats
Cleared the following: Timers Vars Arrays
The current macro has ended.


And here's the according macro:

| - 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
/cleanup
/call ClearStats <--- Line 11
/varset v99 0
|/varset t1 5m
/doevents flush
:Fish
/call CheckPole
/varset l0 $return
/doevents NoBait
/if n $l0==1 /call DoLog "Aborting: Out of poles..."
/if n $v99==1 /call DoLog "Aborting: Out of bait..."
/if n $calc($l0+$v99)>0 /call Event_Timer
/if n $calc($l0+$v99)>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 DestroyItem
/if "$cursor(name)"=="Rusty Dagger" /call DestroyItem
/if $cursor()==TRUE /call KeepItem
/doevents
/goto :Fish
/return

Sub CheckPole
/if "$equip(primary,name)"~~"Brell's Fishin' Pole" /return 0
/stand
/call dolog "standing up"
/delay 2s
/call dolog "standing up"
/finditem similar "Fisherman's Companion"
/delay 1 s
/click left
/delay 1 s
/click right
/delay 13s
/click left auto
/sit
/return 0

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

Sub KeepStats
/if "$p0"~~"cloth sandal" {
/varadd v0 1
} else /if "$p0"~~"rusty dagger" {
/varadd v1 1
} else /if "$p0"~~"fish scales" {
/varadd v2 1
} else /if "$p0"~~"fresh fish" {
/varadd v3 1
} else {
/varadd v4 1
}
/return

Sub DestroyItem
/call DoLog "Destroying junk..."
/click left destroy
/delay 2
/return

Sub Event_NoBait
/varset v99 1
/return

Sub Event_Cast
/varadd v5 1
/return

Sub Event_Skillup
/varadd v6 1
/return

Sub Event_Timer
/call DoLog "Run time: $calc($running/60) min - Casts: $int($v5) - Skill ups: $int($v6)"
/call DoLog "Found: $int($v0) sandals - $int($v1) daggers - $int($v2) scales - $int($v3) fresh fish - $int($v4) zone items"
/varset t$p0 $p1
/return

Sub ClearStats
/varset v0 0 <---- Line 92
/varset v1 0
/varset v2 0
/varset v3 0
/varset v4 0
/varset v5 0
/varset v6 0
/return

Sub Event_Chat
/mqlog ** $p1: '$p2'
/return

Sub DoLog
/mqlog $p0
/echo $p0
/return
----------------------------------------------


I hope you can help. I'm somewhat of a newb to this language (c++?) I'm sure the error is simple :) please help :)

Stilgar
a lesser mummy
a lesser mummy
Posts: 44
Joined: Thu Oct 23, 2003 9:43 pm

Post by Stilgar » Thu Oct 23, 2003 9:48 pm

sorry...should've put it in code- brackets :(

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Thu Oct 23, 2003 10:18 pm


Stilgar
a lesser mummy
a lesser mummy
Posts: 44
Joined: Thu Oct 23, 2003 9:43 pm

Post by Stilgar » Fri Oct 24, 2003 9:14 am

Oh...sorry, I didn't know there was this change...

Code: Select all

Sub Main 
/cleanup 
/call ClearStats <--- Line 11 
/varset v99 0 
|/varset t1 5m 
/doevents flush 
do I add an /declare Varname global there? if so, where?

This code...I understand what it does, but...I have no idea where to start to change it, with the "All $i, $|, etc WILL BE REMOVED" in mind.
I am more used to Delphi and Access (visual basic (censor: i'm an idiot; please ignore me)) and this is a bit confusing...

Code: Select all

if n $l0==1 /call DoLog "Aborting: Out of poles..." 
/if n $v99==1 /call DoLog "Aborting: Out of bait..." 
/if n $calc($l0+$v99)>0 /call Event_Timer 
/if n $calc($l0+$v99)>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 DestroyItem 
/if "$cursor(name)"=="Rusty Dagger" /call DestroyItem 
/if $cursor()==TRUE /call KeepItem 
/doevents 
/goto :Fish 
/return 
The rest of the macro is clear...but this keypart is not...I hope you can hint me in the right direction.
You are doing great work here :-)

Thank you in advance for your help.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Oct 24, 2003 9:33 am

Code: Select all

if n [color=red]@[/color]l0==1 /call DoLog "Aborting: Out of poles..." 
/if n [color=red]@[/color]v99==1 /call DoLog "Aborting: Out of bait..." 
MQ2: Think of it as Evolution in action.

MsRandom
orc pawn
orc pawn
Posts: 11
Joined: Fri Oct 03, 2003 6:04 am

Post by MsRandom » Fri Oct 24, 2003 6:04 pm

grimjack converted it to the new code back when the change went live - http://macroquest2.com/phpBB2/viewtopic.php?t=3236

Stilgar
a lesser mummy
a lesser mummy
Posts: 44
Joined: Thu Oct 23, 2003 9:43 pm

Post by Stilgar » Fri Oct 24, 2003 9:09 pm

ah, you know...I *do* feel kinda sheepish now :oops:

thanks...