Macro problems

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

fsck

Macro problems

Post by fsck » Wed Nov 19, 2003 1:12 am

Hi, I'm having some problems with this macro. I've had my macro writing friend have a look at it and he made the code a bit easier to read, but couldn't fix it.

Code: Select all

|Lazy raid wizard v0.1 BETA, by Fsck 
|This uses an ini file to store your tanks names and how many concussions to use for each 
|one. Additionally it will Harvest when required. 
|It will not work with 100% MR mobs(MM, Emp, Seru) because concussion is resisted, Later I 
|will release a delay version for those fights 
|pre-use edit the provided ini file to contain your tanks' names and the amount of 
|concussions to use per nuke for each tank 
| 
|To use /macro LazyRaid.mac <your tank's name> <nuke name> 
|v0.2 will contain 

#include routines.mac 
#turbo 75 

#event fizzle "Your spell fizzles!" 
#event OOM "Insufficient Mana to cast this spell" 

Sub main 

| ---- VARIABLES ---- 
/declare tankname global | tanks name to assist 
/declare nukename global | Name of nuke to use 
/declare concs global | number of concussions needed per nuke 
/declare concnumber global | 

/varset tankname @Param0 
/varset nukename @Param1 
/varset concs $ini("D:\MQ\Macros\tanks.ini","@Tankname","concs") 

:top 
/assist @tankname 
/delay 10 
/if "$target(type)"!="NPC" /goto :top 

/if n $target(hp,pct)<98 /goto :top 
/echo Target Acquired: $target(name) 
/cast item "Staff of Temperate Flux" 
/delay 10 
/echo Waiting for aggro to be established 

:nuke 
/if "$target(type)"=="NPC" { 
/echo Nuking $target(name) 
/cast "@nukename" 
/varset concnumber 0 
} 

/goto :concussion 

:concussion 
/cast "Concussion" /varadd "@concnumber" 1 
/if "@concnumber"=="@concs" { 
/goto :nuke 
} 
/if "@concnumber"!="@concs" { 
/goto :concussion 
} 
/return 
Sub event_fizzle 

/if "@concnumber"=="@concs" /goto :nuke 
else /goto :concussion 
} 
/return 

Sub event_OOM 

/echo Out of Mana, Casting Harvest. 
/cast "Harvest" 
/delay 21s 
/echo Harvest Cast, Casting Harvest of Druzzil 
/alt 172 
/delay 12s 
/echo Harvest and Harvest of Druzzil done. Casting Modrod. 
/cast item "Rod of Mystical Transvergence" 
/goto :nuke 
/return 

|end of LazyRaid.mac
it uses an ini file like this

Code: Select all


[Name]
concs=2

any suggestions?

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 » Wed Nov 19, 2003 1:49 am

Describe the problem...

Your statement doesn't give an idea of what may be going wrong.

Also, you ar emore liekly to get help if you register... but thsi isn't that big a deal with this macro.

I looked at it a little, and noticed a few things.

1. Using events does no good if you don't use /doevents
2. I *think* putting comments at the end of a line causes problems.

Here is your macro slightly edited. Not sur eif it will fix all of your problems, but it's a start:

Code: Select all

|Lazy raid wizard v0.1 BETA, by Fsck 
|This uses an ini file to store your tanks names and how many concussions to use for each 
|one. Additionally it will Harvest when required. 
|It will not work with 100% MR mobs(MM, Emp, Seru) because concussion is resisted, Later I 
|will release a delay version for those fights 
|pre-use edit the provided ini file to contain your tanks' names and the amount of 
|concussions to use per nuke for each tank 
| 
|To use /macro LazyRaid.mac <your tank's name> <nuke name> 
|v0.2 will contain 

#include routines.mac 
#turbo 75 

#event fizzle "Your spell fizzles!" 
#event OOM "Insufficient Mana to cast this spell" 

Sub Main 

  | ---- VARIABLES ----
  | tanks name to assist
  /declare tankname global

  | Name of nuke to use
  /declare nukename global

  | number of concussions needed per nuke
  /declare concs global
  /declare concnumber global

  /varset tankname @Param0 
  /varset nukename @Param1 
  /varset concs $ini("D:\MQ\Macros\tanks.ini","@[color=cyan]t[/color]ankname","concs") 

  :top 
  /assist @tankname 
  /delay 10 
  /if "$target(type)"!="NPC" /goto :top 
  /echo Waiting for aggro to be established 
  /if n $target(hp,pct)[color=cyan]>[/color]98 /goto :top
  /echo Target Acquired: $target(name) 
  /cast item "Staff of Temperate Flux" 
  /delay 10 

  :nuke
  [color=cyan]/doevents flush[/color]
  /if "$target(type)"=="NPC" { 
    /echo Nuking $target(name) 
    /cast "@nukename"
    [color=cyan]/doevents[/color]
    /varset concnumber 0 
  } 

  /goto :concussion 

  :concussion 
  /cast "Concussion"
  [color=cyan]/doevents[/color]
  /varadd "@concnumber" 1 
  /if "@concnumber"=="@concs" /goto :nuke 
  /if "@concnumber"!="@concs" /goto :concussion 
/endmacro

Sub event_fizzle 
  /if "@concnumber"=="@concs" /goto :nuke 
  /goto :concussion 
/return 

Sub event_OOM 
   /echo Out of Mana, Casting Harvest. 
   /cast "Harvest" 
   /delay 21s 
   /echo Harvest Cast, Casting Harvest of Druzzil 
   /alt 172 
   /delay 12s 
   /echo Harvest and Harvest of Druzzil done. Casting Modrod. 
   /cast item "Rod of Mystical Transvergence" 
   /goto :nuke 
/return

Circuit Flux

Here ya go

Post by Circuit Flux » Thu Nov 20, 2003 1:28 am

Code: Select all

|Lazy raid wizard v0.3 BETA, by Fsck 
|Edited and revised by Circuit Flux
|This uses an ini file to store your tanks names and how many concussions to use for each 
|one. Additionally it will Harvest when required. 
|It will not work with 100% MR mobs(MM, Emp, Seru) because concussion is resisted, Later I
|will release a delay version for those fights 
|pre-use edit the provided ini file to contain your tanks' names and the amount of
|concussions to use per nuke for each tank 
|
|To use /macro LazyRaid.mac <your tank's name> <nuke name> 
|v0.3 will contain 

#include routines.mac 
#turbo 75 

#event fizzle "Your spell fizzles!" 
#event OOM "Insufficient Mana to cast this spell" 

Sub main 

| ----  VARIABLES ----
/declare tankname global     | tanks name to assist
/declare nukename global     | Name of nuke to use
/declare concs global        | number of concussions needed per nuke
/declare concnumber global   | 
/declare mobhp global        | mob hp % for comparison
/declare tempvar global	     | temp variable for misc uses
/Declare assisthealth global | safe health to start nuking

/varset assisthealth 98


   /echo "Lazy Raid Wizard v0.3 BETA Starting" 
   /varset tankname @Param0 
   /varset nukename @Param1 
   /varset concs $ini("tanks.ini","@Tankname","concs") 
   /echo "@tankname is assist tank." 
   /varset tempvar 0 
   /if n @sneakhide==1 { 
      /doability "Sneak" 
      /doability "Hide" 
   } 
   /goto :top
   /goto :nuke 
/return 




:top 
   /assist @tankname 
   /delay 10 
   /if "$target()"=="FALSE" { 
      /target @tankname 
      /goto :top 
   } 
   /if "$target(type)"!="NPC" { 
      /goto :top 
   } 
   /if n @tempvar!="$target(hp,pct)" /echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance). 
   /varset tempvar "$target(hp,pct)"
	
   /if n @mobhp>=@assisthealth{ 
	/goto :top
	} else { 
		/echo Target Acquired: $target(name,clean) 
		/cast item "Staff of Temperate Flux" 
		/delay 10 
		/echo Waiting for aggro to be established 
		/goto :nuke
		}

 
/goto :top

:nuke 
/doevents flush	
/if "$target(type)"=="NPC" { 
		/echo Nuking $target(name,clean). It is a level $target(level) $target(race).
	/cast "@nukename" 
	/varset concnumber 0 
	/doevents	
	/goto :concussion
		}
/return
 
 
:concussion 
	/cast "Concussion" 
	/doevents
	/varadd "@concnumber" 1 
	/if "@concnumber"=="@concs" {
		/goto :nuke 
	} else { /if "@concnumber"!="@concs" /goto :concussion 
	}
    
/goto :top 



Sub Event_fizzle 

/if "@concnumber"=="@concs" { 
    /goto :nuke 
}else { /goto :concussion 
} 
/return 

Sub Event_OOM 

/echo Out of Mana, Casting Harvest. 
/cast "Harvest" 
/delay 21s 
/echo Harvest Cast, Casting Harvest of Druzzil 
/alt 172 
/delay 12s 
/echo Harvest and Harvest of Druzzil done. Casting Modrod. 
/cast item "Rod of Mystical Transvergence" 
/goto :nuke 
/return 

|end of LazyRaid.mac
I think that should work right there, but I am not a wizzy so I cant personally test it :P

Good luck!

Circuit Flux

Actually...

Post by Circuit Flux » Thu Nov 20, 2003 6:17 am

Untested but...

Code: Select all

|Lazy raid wizard v0.3 BETA, by Fsck 
|Edited and revised by Circuit Flux 
|This uses an ini file to store your tanks names and how many concussions to use for each 
|one. Additionally it will Harvest when required. 
|It will not work with 100% MR mobs(MM, Emp, Seru) because concussion is resisted, Later I 
|will release a delay version for those fights 
|pre-use edit the provided ini file to contain your tanks' names and the amount of 
|concussions to use per nuke for each tank 
| 
|To use /macro LazyRaid.mac <your tank's name> <nuke name> 
|v0.3 will contain 

#include routines.mac 
#turbo 75 

#event fizzle "Your spell fizzles!" 
#event OOM "Insufficient Mana to cast this spell" 

Sub main 

| ---- VARIABLES ---- 
/declare tankname global 
| tanks name to assist 
/declare nukename global 
| Name of nuke to use 
/declare concs global 
| number of concussions needed per nuke 
/declare concnumber global 
| number of concs cast 
/declare mobhp global 
| mob hp % for comparison 
/declare tempvar global 
| temp variable for misc uses 
/Declare assisthealth global 
| safe health to start nuking 

/varset assisthealth 98 


/echo "Lazy Raid Wizard v0.3 BETA Starting" 
/varset tankname @Param0 
/varset nukename Ice Meteor 
|/varset concs @Param1 
/varset concs $ini(tanks.ini,@tankname,concs) 
/echo "@tankname is assist tank." 
/varset tempvar 0 
/if n @sneakhide==1 { 
/doability "Sneak" 
/doability "Hide" 
} 
/goto :top 
/goto :nuke 
/return 




:top 
/assist @tankname 
/delay 10 
/if "$target()"=="FALSE" { 
/target @tankname 
/goto :top 
} 
/if "$target(type)"!="NPC" { 
/goto :top 
} 
/if n @tempvar!="$target(hp,pct)" /echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance). 
/varset tempvar "$target(hp,pct)" 

/if n "@mobhp">="@assisthealth" { 
/goto :top 
} else { 
/echo Target Acquired: $target(name,clean) 
/cast item "Staff of Temperate Flux" 
/delay 3s 
/echo Waiting for aggro to be established 
/goto :nuke 
} 


/goto :top 

:nuke 
/doevents flush 
/if "$target(type)"=="NPC" { 
/echo Nuking $target(name,clean). It is a level $target(level) $target(race). 
/cast "Ice Meteor" 
/delay 10s 
/varset concnumber 0 
/doevents 
/goto :concussion 
} 
/return 


:concussion 
/cast "Concussion" 
/delay 7s 
/doevents 
/varadd concnumber 1 
/if n "@concnumber"=="@concs" /goto :nuke 
/if n "@concnumber"!="@concs" /goto :concussion 

/goto :top 



Sub Event_fizzle 

/if n "@concnumber"=="@concs" /goto :nuke 
/if n "@concnumber"!="@concs" /goto :concussion 
/return 

Sub Event_OOM 

/echo Out of Mana, Casting Harvest. 
/cast "Harvest" 
/delay 21s 
/echo Harvest Cast, Casting Harvest of Druzzil 
/alt 172 
/delay 12s 
/echo Harvest and Harvest of Druzzil done. Casting Modrod. 
/cast item "Rod of Mystical Transvergence" 
/goto :nuke 
/return 

|end of LazyRaid.mac