macro wont work

Need help running MacroQuest 1? Too bad! Use MQ2.

Moderator: MacroQuest Developers

Tammera
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 27, 2003 6:13 pm

macro wont work

Post by Tammera » Wed Oct 08, 2003 7:31 am

ive been trying to start a macro and nothing happens, no error message or anything just nothing.

chimaera
a lesser mummy
a lesser mummy
Posts: 37
Joined: Fri Aug 01, 2003 4:14 pm

Post by chimaera » Wed Oct 08, 2003 8:13 am

I think you could be a little more vague, if you tried. Perhaps instead of
ive been trying to start a macro and nothing happens, no error message or anything just nothing.
you could just make it like this:
Nothing happens! Help!
The point is, its hard to guess at what you're doing wrong when you give us nothing to look at. Perhaps if you post the macro you're trying to run, and tell us what your macroquest.ini file looks like, we could help...

Tammera
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 27, 2003 6:13 pm

Post by Tammera » Wed Oct 08, 2003 8:55 am

im sorry i know it was vague i didnt know what else to write. im not sure what the ini is but from looking around all i could see was this.

Code: Select all

[MacroQuest]
MacroPath=.\Macros
LogPath=.\Logs
DebugSpewToFile=0
FilterSkills=0
FilterTarget=0
FilterMoney=0
FilterFood=0
FilterMacro=1
FilterEncumber=0
FilterDebug=0

[Filter Names]

[Telnet Server]
Enabled=1
LocalOnly=0
Port=3459
Welcome=MacroQuest telnet server
Password=macroquest

[Aliases]
/exp=/echo $char(exp)% experience...
/bind=/doability "Bind Wound"
/gmlist=/who all gm
/mana=/echo Current Mana: $char(mana,cur) -- Max Mana: $char(mana,max)
/hp=/echo Current Health: $char(hp,cur) -- Max Health: $char(hp,max)
/mousepos=/echo Your mouse is at $mouse(X) , $mouse(Y)

macro is
/macro forage <-- is what i typed in the folder is.

Code: Select all

|---------------------------- 
| Forager with ini file support and 
| statistic gathering and reporting 
| version 2.1 

| Set this define to the desired .ini file 
| Requires a blank .ini file to start. The marco will 
| populate the .ini file automatically for any zone 
| and default to keeping the item. Then just change 
| the values in the .ini file to 0 for an item to be 
| automatically destroyed (requires FastItemDestroy 
| be turned on in the options window) 

#define INIFile "e:\macros\forage.ini" 
#turbo 

Sub Main 
  /declare ForageDelay global 
  /declare EnableShowStats global 
  /declare EnableWriteLog global 
  /declare EnableClear global 

| ##### User set variables ##### 
  /varset ForageDelay 1010         | The delay between forage attempts 
  /varset EnableShowStats 1        | Set to 1 to show foraging statistics 
  /varset EnableWriteLog 0         | Set to 1 to write statistics to MQLog 
  /varset EnableClear 0            | Set to 1 to clear before writing stats 
| ##### User set variables ##### 

  /declare ForageAttempts global 
  /declare ForageSuccess global 
  /declare ForageFailure global 
  /declare ForageKeeps global 
  /declare ForageDestroys global 
  /declare NumItem global 
  /declare Index global 
  /declare ItemArray array2 

  /varset ForageAttempts 0 
  /varset ForageSuccess 0 
  /varset ForageFailure 0 
  /varset ForageKeeps 0 
  /varset ForageDestroys 0 
  /varset NumItem 0 

:Continue 
  /varset Index 0 
  /call Forage 
  /if "$cursor(name)"=="NULL" { 
    /varadd ForageFailure 1 
  } else { 
    /varadd ForageSuccess 1 
    /call CheckItem 
    /call HandleItem 
    /beep 
  } 

  /if @EnableShowStats==1 /call ShowStats 
  /if @EnableWriteLog==1 /call LogStats 
  /delay @ForageDelay 
  /goto :Continue 

/return 

| ########## Subroutines ########## 

Sub Forage 
  /doability Forage 
  /varadd ForageAttempts 1 
  /delay 15 
/return 

Sub LogStats 
  /declare xy local 
  /call CalculateRates 
  /if @EnableClear==1 /mqlog clear 
  /mqlog ############################################# 
  /mqlog Attempts = $int(@ForageAttempts) 
  /mqlog Success  = $int(@ForageSuccess)  [$int($calc(@ForageSuccess/@ForageAttempts*100))%] 
  /mqlog Failures = $int(@ForageFailure)  [$int($calc(@ForageFailure/@ForageAttempts*100))%] 
  /mqlog Keeps    = $int(@ForageKeeps)    [$int($calc(@ForageKeeps/@ForageAttempts*100))%] 
  /mqlog Destroys = $int(@ForageDestroys) [$int($calc(@ForageDestroys/@ForageAttempts*100))%] 
  /mqlog [Idx] [Item] [Keep] [Qty] [%] 
  /mqlog ------------------------------------------- 
  /if n @NumItem>0 { 
    /for xy 1 to @NumItem 
       /mqlog [$int(@xy)] [@ItemArray(0,@xy)] [$int(@ItemArray(1,@xy))] [$int(@ItemArray(2,@xy))] [$int($calc(@ItemArray(2,@xy)/@ForageAttempts*100))%] 
    /next xy 
  } 
/return 

Sub ShowStats 
  /declare xy local 
  /if @EnableClear==1 /clear 
  /echo Attempts = $int(@ForageAttempts) 
  /echo Success  = $int(@ForageSuccess)  [$int($calc(@ForageSuccess/@ForageAttempts*100))%] 
  /echo Failures = $int(@ForageFailure)  [$int($calc(@ForageFailure/@ForageAttempts*100))%] 
  /echo Keeps    = $int(@ForageKeeps)    [$int($calc(@ForageKeeps/@ForageAttempts*100))%] 
  /echo Destroys = $int(@ForageDestroys) [$int($calc(@ForageDestroys/@ForageAttempts*100))%] 
  /echo [Idx] [Item] [Keep] [Qty] [%] 
  /echo ------------------------------------------- 
  /if n @NumItem>0 { 
    /for xy 1 to @NumItem 
      /echo [$int(@xy)] [@ItemArray(0,@xy)] [$int(@ItemArray(1,@xy))] [$int(@ItemArray(2,@xy))] [$int($calc(@ItemArray(2,@xy)/@ForageAttempts*100))%] 
    /next xy 
  } 
/return

Sub CheckItem 
  /declare xy local 
  /if @NumItem==0 { 
    /varset NumItem 1 
    /call AddToArray 
    /varset Index 1 
  } else { 
    /for xy 1 to @NumItem 
      /if "@ItemArray(0,@xy)"=="$cursor(name)" /varset Index @xy 
    /next xy 
    /if @Index==0 { 
      /varadd NumItem 1 
      /call AddToArray 
    } else { 
      /varadd ItemArray(2,@Index) 1 
    } 
  } 
/return 

Sub AddToArray 
    /varset ItemArray(0,@NumItem) "$cursor(name)" 
    /varset ItemArray(1,@NumItem) $ini("INIFile","$zone","$cursor(name)") 
    /if "@ItemArray(1,@NumItem)"=="NOTFOUND" { 
      /varset ItemArray(1,@NumItem) 1 
      /ini "INIFile" "$zone" "$cursor(name)" 1 
    } 
    /varset ItemArray(2,@NumItem) 1 
/return 

Sub HandleItem 
  /if @ItemArray(1,@Index)==0 { 
    /varadd ForageDestroys 1 
    /click left destroy 
  } else { 
    /varadd ForageKeeps 1 
    /autoinv 
  } 
/return 
thats just one example

thanks

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

Post by Mckorr » Wed Oct 08, 2003 10:37 am

FilterMacro=1

Change that to a zero. Right now you are filtering out all MQ output so that it will only show up in a telnet session.
MQ2: Think of it as Evolution in action.

Tammera
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 27, 2003 6:13 pm

Post by Tammera » Wed Oct 08, 2003 11:59 am

ok hmm changed that and now i get this kind of stuff :(

Couldn't parse '/declare ForageDelay global'
[Wed Oct 08 16:55:14 2003] Couldn't parse '/declare EnableShowStats global'
[Wed Oct 08 16:55:15 2003] Couldn't parse '/declare EnableWriteLog global'
[Wed Oct 08 16:55:15 2003] Couldn't parse '/declare EnableClear global'
[Wed Oct 08 16:55:15 2003] Ending macro: Usage: /varset <v#|p#|l#|t#|a(#,#)> <value>
[Wed Oct 08 16:55:15 2003] forage.mac@24 (Main): /varset ForageDelay 1010 | The delay between forage attempts
[Wed Oct 08 16:55:15 2003] Cleared the following: Timers Vars Arrays
[Wed Oct 08 16:55:15 2003] The current macro has ended.



Couldn't parse '/declare ShowStats global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare EndOnTrivial global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare dly global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare abt global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare FinishedProduct global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare DesiredSuccesses global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare ErrorAtCombine global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare CombineErrorCounter global'
[Wed Oct 08 16:54:43 2003] Couldn't parse '/declare SkillTrivialCounter global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare SkillFailCounter global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare SkillSuccessCounter global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare SuccessRate global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare TotalAttempts global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare SkillUpRate global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare SkillUpCounter global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare CombInt global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare CombStr global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare TotalComp global'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare l0 local'
[Wed Oct 08 16:54:44 2003] Couldn't parse '/declare a array'
[Wed Oct 08 16:54:44 2003] Ending macro: Usage: /varset <v#|p#|l#|t#|a(#,#)> <value>
[Wed Oct 08 16:54:44 2003] ts.mac@116 (SetDefaults): /varset ShowStats 1
[Wed Oct 08 16:54:44 2003] ts.mac@34 (Main): /call SetDefaults
[Wed Oct 08 16:54:45 2003] Cleared the following: Timers Vars Arrays
[Wed Oct 08 16:54:45 2003] The current macro has ended.

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

Post by Mckorr » Wed Oct 08, 2003 12:21 pm

You're using an outdated version of MQ, one from before the big change in variable handling. Prior to the "big change" variables were declared using #define, not /declare. Update your source code and recompile. Make sure you do a Build -> Clean before you recompile.
MQ2: Think of it as Evolution in action.

Tammera
orc pawn
orc pawn
Posts: 12
Joined: Wed Aug 27, 2003 6:13 pm

Post by Tammera » Wed Oct 08, 2003 12:31 pm

lol wow that went straight over my head (i r thick) but thanks ill see if i can get someone to do that for me :)

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

Post by Mckorr » Wed Oct 08, 2003 12:53 pm

In the latest version of MacroQuest there was a big change in how variables are handled.

Your macro uses the new system. From the error messages you are using a version of MQ that uses the old system. You need an uptodate version of MQ to use that script.
MQ2: Think of it as Evolution in action.

Waxxedazz
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat May 31, 2003 7:09 pm

new system

Post by Waxxedazz » Mon Oct 13, 2003 12:49 am

so in my macros all "#define" should be changed to "/declare"? I downloaded the latest MQ from the download page off the main menu. I get an error every time I try to run a macro. I usually ends up with "bad variable in /var function" as the error. then ends the macro. Thi only started reciently so im guessin this is the same thing. I did a build clean and still does the same thing. Happens with all macros that I can tell. I recomp[iled twice to make sure it wasnt just me missing something. Gunna try to start off fresh with new folder and compile that way. Will check back here after im done. Thanks in advance.

Waxxedazz
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat May 31, 2003 7:09 pm

im going to bed now...

Post by Waxxedazz » Mon Oct 13, 2003 12:56 am

Id like to not even talk about what I did but I will so maybe other people wont feel bad if they did it... I opened the latest.zip, extracted into my MQ folder and compiled... it put all the new files in my macroquest folder so I was compiling the old MQ since my new MQ was in a diff folder. I need to change the bulb in :idea: ...

Waxxedazz
a lesser mummy
a lesser mummy
Posts: 47
Joined: Sat May 31, 2003 7:09 pm

same prob

Post by Waxxedazz » Mon Oct 13, 2003 2:28 am

im still getting the same problem with the bad variable in /var function while running any macro. any ideas?

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Mon Oct 13, 2003 3:27 am

Waxx, there are several changes in the new version, only changing all your defines to /declare won't do it.

You may want to go through one of the macros in the Depot, see if one of them can be modified to suit your needs. At least for me, learning how to do something is much easier by picking apart someone elses work and seeing how it was all put together.

If that doesn't work, try posting your macro in the Macro Help forum, and we can give you pointers on what needs to be fixed still.