Running macros command incorrectly

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

johnblack100
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Dec 10, 2003 9:16 pm

Running macros command incorrectly

Post by johnblack100 » Thu Dec 11, 2003 5:09 am

Hi need some assistance, either a link or tell me what I am doing wrong.
When I try to run a macro I get the following message

Ending macro: Usage /for <variable> <start> <to>downto> <end> [step x}
routines.mac@125 )findcombiner): /for p1:7 dpwmto 0
pattymelt.mac @ (Main): /call FIndCombiner backing
Cleared the following: Timers Vars Arrays
The current macro has ended.

The macro does not run anythng, what am I doing wrong?

:)

GD
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jun 29, 2002 11:57 pm

Post by GD » Thu Dec 11, 2003 7:38 am

Ending macro: Usage /for <variable> <start> <to>downto> <end> [step x}
routines.mac@125 )findcombiner): /for p1:7 dpwmto 0
pattymelt.mac @ (Main): /call FIndCombiner backing
Cleared the following: Timers Vars Arrays
The current macro has ended.
looks like ya got a typo there.
Opinions are like assholes, everyone has one, but most of them stink.

NotSoCSharp
a ghoul
a ghoul
Posts: 85
Joined: Sat Oct 25, 2003 10:48 am

Post by NotSoCSharp » Thu Dec 11, 2003 7:55 am

Would also help a great deal if you posted the code. Just a thought.

johnblack100
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Dec 10, 2003 9:16 pm

Post by johnblack100 » Fri Dec 12, 2003 7:15 pm

I am sorry here is the macro code trying to run ;)

| - BatWingPie.mac -
|


#include routines.mac

Sub Main

/call FindCombiner baking
/if $return==99 /return


/cleanup
/click right inv $return
:MakeBatWingPie
/sendkey down ctrl

/finditem "Bear Meat"
/if $find()==FALSE /goto :Done
/click left pack $return 4

/finditem "Cheese"
/if $find()==FALSE /goto :Done
/click left pack $return 1

/finditem "Loaf of Bread"
/if $find()==FALSE /goto :Done
/click left pack $return 2

/finditem "Non-Stick Frying pan"
/if $find()==FALSE /goto :Done
/click left pack $return 3

/sendkey up ctrl
/click left pack $return combine

/if "$cursor()"=="TRUE" /goto :AutoDropBatWingPie
/for v1 1 to 5
/delay 2
/if "$cursor()"=="TRUE" /goto :AutoDropBatWingPie
/next v1

/goto :MakeBatWingPie

:AutoDropBatWingPie
/click left auto
/delay 2
/click left auto
/goto :MakeBatWingPie
:Done

/sendkey up ctrl
/return

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

Post by Mckorr » Fri Dec 12, 2003 7:30 pm

The problem isn't there, it's in your routines.mac. From the error message looks like an outdated version. Variable format in the quoted /for error doesn't look right.

johnblack100
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Dec 10, 2003 9:16 pm

Post by johnblack100 » Sat Dec 13, 2003 7:12 am

Here is the routines.mac I am using.

- routines.mac -
| Generic routines that may be used a lot.
| ----------------------------
| Original Version by: Plazmic
| Improved by: L124RD


Sub BuyItems

/sendkey down shift

/for l1 1 to $p0
/click left merchant buy
/varset l2 $char(cash)
:BuyItems_Wait
/delay 0
/if n $l2==$char(cash) /goto :BuyItems_Wait
/next l1

/sendkey up shift

/return


| ----------------------------


Sub SellItem
/sendkey down shift
:SellItem
/finditem $p0
/if $find()==FALSE /goto :DoneSellItem
/click left merchant sell
/delay $rand(3)
/goto :SellItem
:DoneSellItem
/sendkey up shift
/return


| ----------------------------


Sub BackPedal
/if $p0==$v79 /return
/varset v79 $p0
/if $p0==1 /sendkey down up
/if $p0==0 /sendkey up up
/return


| ----------------------------


Sub AutoRun
/if $p0==$v80 /return
/varset v80 $p0
/if $p0==1 /sendkey down up
/if $p0==0 /sendkey up up
/return


| ----------------------------


Sub GotoLoc
/varset v91 $rand(5)
:GotoLocLoop
/face loc $p0
/if "$p1"=="u" /Press u
/call AutoRun 1
/if n $distance($p0)>$v91 /goto :GotoLocLoop
/call AutoRun 0
/return


| ----------------------------


Sub GotoTarg
/varset v91 $rand(5)
/target $p0
:GotoTargLoop
/face
/if "$p1"=="u" /Press u
/call AutoRun 1
/if n $target(distance)>$v91 /goto :GotoTargLoop
/call AutoRun 0
/return

| ----------------------------

Sub BuyItems
/press down shift
/for p1 1 to $p0
/varcalc p2 $char(plat)*1000+$char(gold)*100+$char(silver)*10+$char(copper)
/click left merchant buy
:BuyItemsLoop
/delay 0
/if n $calc($char(plat)*1000+$char(gold)*100+$char(silver)*10+$char(copper))==$p2 /goto :BuyItemsLoop
/next p1
/press up shift
/return

| ----------------------------

Sub SellItem
/sendkey down shift
:SellItem
/finditem $p0
/if $find()==FALSE /goto :DoneSellItem
/varcalc p2 $char(plat)*1000+$char(gold)*100+$char(silver)*10+$char(copper)
/click left merchant sell
:SellItemLoop
/delay 0
/if n $calc($char(plat)*1000+$char(gold)*100+$char(silver)*10+$char(copper))==$p2 /goto :SellItemLoop
/goto :SellItem
:DoneSellItem
/sendkey up shift
/return

| ----------------------------

Sub FindCombiner
/for p1 7 downto 0
/if "$pack($p1,combine)"=="$p0" /return $p1
/next p1
/echo You do not appear to have a valid $p0 container.
/return 99

| End of routines.mac