Fleshing out a Mino Hero script and have a problem

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

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

Fleshing out a Mino Hero script and have a problem

Post by wassup » Sat May 24, 2003 11:01 pm

I am working on some tradeskill scripts (mind you this is just the beginning of what I am working on) and with the following macro I am getting:

Couldn't find a comparison operator in 2.00

Here is the code:

Code: Select all

| - Hero.mac -

#define Delay v40
#define CaskX v41
#define CaskY v42
#define CaskCount v43

#event CombineFail "You lacked the skills to fashion the items together."
#event CombineSucceed "You have fashioned the items together to create something new!"

Sub Main

   /varset Delay 5
   /varset CaskX 173
   /varset CaskY 55
   /varset CaskCount 1

   /sendkey down ctrl

   :CombineLoop
|Get first malt
   /mouseto 24 55
   /click left
   /delay Delay
   /mouseto 97 55
   /click left
   /delay Delay

|Get second malt
   /mouseto 24 87
   /click left
   /delay Delay
   /mouseto 97 87
   /click left
   /delay Delay

|Get third malt
   /mouseto 24 118
   /click left
   /delay Delay
   /mouseto 97 118
   /click left
   /delay Delay

|Get yeast
   /mouseto 24 150
   /click left
   /delay Delay
   /mouseto 97 150
   /click left
   /delay Delay

|Get first water
   /mouseto 24 182
   /click left
   /delay Delay
   /mouseto 97 182
   /click left
   /delay Delay

|Get second water
   /mouseto 53 55
   /click left
   /delay Delay
   /mouseto 129 55
   /click left
   /delay Delay

|Get first short beer
   /mouseto 53 87
   /click left
   /delay Delay
   /mouseto 129 87
   /click left
   /delay Delay

|Get second short beer
   /mouseto 53 118
   /click left
   /delay Delay
   /mouseto 129 118
   /click left
   /delay Delay

|Get first cask
   /mouseto $CaskX $CaskY
   /click left
   /delay Delay
   /mouseto 129 150
   /click left
   /delay Delay

|Click Combine Button
   /doevents flush
   /mouseto 111 213
   /click left
   /delay 5

|Test the combine
   /doevents
   /if n $CaskCount < 10 /goto :CombineLoop
   /endmacro
/return

Sub Event_CombineFail 
      /mouseto CaskX CaskY
      /click left
      /delay Delay
      /call Destroy
/return 

Sub Event_CombineSucceed 
     /call Destroy
     /call Destroy
     /varadd CaskY 30
     /varadd CaskCount 1
     /if n $CaskCount == 6 {
         /varset CaskX 203
         /varset CaskY 55
     }

/return

sub Destroy
    /mouseto 472 219
    /click left
    /delay Delay
/return
If anyone has any ideas on what the error is I would appreciate some help.

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

Post by Mckorr » Sat May 24, 2003 11:55 pm

First, "/delay Delay"? I'm not sure that will work, but at the very least you shouldn't use a function name as a variable name. All kinds of potential for confustion there.
MQ2: Think of it as Evolution in action.

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

Post by wassup » Sun May 25, 2003 12:07 am

Mckorr wrote:First, "/delay Delay"? I'm not sure that will work, but at the very least you shouldn't use a function name as a variable name. All kinds of potential for confustion there.
I'll give that a try... I just added that in so I didn't have to edit a large number of lines. It's much easier to change one value.

*EDIT

I changed the delay to numeric values throughout the script but I still get the smae error.

Pigeon
orc pawn
orc pawn
Posts: 22
Joined: Fri May 16, 2003 9:43 pm

Post by Pigeon » Sun May 25, 2003 12:37 am

/if n $CaskCount < 10 /goto :CombineLoop

Code: Select all

   /if n $CaskCount<10 /goto :CombineLoop 
etc etc. Take out all the spaces in comparasins.

Also, should be /delay $Delay, not /delay Delay.

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

Post by wassup » Sun May 25, 2003 1:35 am

Pigeon wrote:
/if n $CaskCount < 10 /goto :CombineLoop

Code: Select all

   /if n $CaskCount<10 /goto :CombineLoop 
etc etc. Take out all the spaces in comparasins.

Also, should be /delay $Delay, not /delay Delay.
Thanks much... the comparison thing was really confusing me.

I didn't think about the /delay Delay issue. It wasn;t causing any problems but I will make the change and go from there.

anOrcPawn00
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sat May 10, 2003 6:15 am

Post by anOrcPawn00 » Sun May 25, 2003 3:41 am

/delay $Delay
should work, but bad form to use function names as variable names in general. but the idea is good to use a define or variable to make it easy to adjust throughout the script