Help section from before the user variable changes that broke all macros
Moderator: MacroQuest Developers
-
driftinsupra
- Official loudmouth

- Posts: 212
- Joined: Tue Jan 28, 2003 9:25 pm
Post
by driftinsupra » Fri Sep 05, 2003 4:00 am
Ok I wrote a subroutine to cast lich on myself...wait till I had %40 mana and then break lich: here is my coded:
Code: Select all
Sub LichCasting
:manaloop
/if n $char(hp,pct)>=60 {
/if n $char(mana,pct)<=50 {
/if n $char(buff,"Lich)==0 {
/stand
/call Cast "Lich"
/sit
}
/goto :manaloop
}
/if n $char(buff,"Lich")==1 {
/click left buff1x buff1y
/click left buff1x buff1y
/delay 20
}
/if n $char(buff,"Lich")==2 {
/click left buff2x buff2y
/click left buff2x buff2y
/delay 20
}
/if n $char(buff,"Lich")==3 {
/click left buff3x buff3y
/click left buff3x buff3y
/delay 20
}
/if n $char(buff,"Lich")==4 {
/click left buff4x buff4y
/click left buff4x buff4y
/delay 20
}
/if n $char(buff,"Lich")==5 {
/click left buff5x buff5y
/click left buff5x buff5y
/delay 20
}
/if n $char(buff,"Lich")==6 {
/click left buff6x buff6y
/click left buff6x buff6y
/delay 20
}
}
:lichlessmana
/if n $char(mana,pct)<=50 {
/delay 10
/goto :lichlessmana
}
/return
The problem I am having is that this will only break the lich if it is buff slot 4....the mouse pointer wont even move if lich is any other biff slots. I have double and triple checked the coords I have saved in variables that I am using to locate the buff slots. I cant seem to find a reason why it would ignore anything but slot 4...Anyone got any advice?
-
grimjack
- Macro Author

- Posts: 525
- Joined: Thu Nov 07, 2002 6:51 am
-
Contact:
Post
by grimjack » Fri Sep 05, 2003 4:23 am
Try adding some debuging to your macro.
Also you should post where you set the variables. I know you said you double and tripple checked but it would help to see how you have it in your macro. I'm guesing you are not really using variables to store the values of the buff slot coordinates since you don't use $buff1x. I would guess that you are using #define to replace the buff1x with the actual number instead of a variable but I can't be sure without seeing it.
example:
#define buff1x 432
/echo buff1x
vs
#define buff1x v20
/varset buff1x 432
/echo $buff1x
Code: Select all
Sub LichCasting
:manaloop
/echo Litch is in buff slot $char(buff,"Lich)
/if n $char(hp,pct)>=60 {
/if n $char(mana,pct)<=50 {
/if n $char(buff,"Lich)==0 {
/stand
/call Cast "Lich"
/sit
}
/goto :manaloop
}
/echo Litch is in buff slot $char(buff,"Lich)
/if n $char(buff,"Lich")==1 {
/echo Matched litch buff to slot 1
/echo Clicking buff1x buff1y
/click left buff1x buff1y
/click left buff1x buff1y
/delay 20
}
/if n $char(buff,"Lich")==2 {
/echo Matched litch buff to slot 2
/echo Clicking buff2x buff2y
/click left buff2x buff2y
/click left buff2x buff2y
/delay 20
}
/if n $char(buff,"Lich")==3 {
/echo Matched litch buff to slot 3
/echo Clicking buff3x buff3y
/click left buff3x buff3y
/click left buff3x buff3y
/delay 20
}
/if n $char(buff,"Lich")==4 {
/echo Matched litch buff to slot 4
/echo Clicking buff4x buff4y
/click left buff4x buff4y
/click left buff4x buff4y
/delay 20
}
/if n $char(buff,"Lich")==5 {
/echo Matched litch buff to slot 5
/echo Clicking buff2x buff2y
/click left buff5x buff5y
/click left buff5x buff5y
/delay 20
}
/if n $char(buff,"Lich")==6 {
/echo Matched litch buff to slot 6
/echo Clicking buff6x buff6y
/click left buff6x buff6y
/click left buff6x buff6y
/delay 20
}
}
:lichlessmana
/echo doing litchless mana
/if n $char(mana,pct)<=50 {
/delay 10
/goto :lichlessmana
}
/return
Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.
Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.
My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack
-
driftinsupra
- Official loudmouth

- Posts: 212
- Joined: Tue Jan 28, 2003 9:25 pm
Post
by driftinsupra » Fri Sep 05, 2003 7:27 am
Ok this is how I have the coordinates saved:
[/code]
#define buff1x 650
#define buff1y 40
#define buff2x 650
#define buff2y 84
#define buff3x 650
#define buff3y 128
#define buff4x 650
#define buff4y 172
#define buff5x 650
#define buff5y 216
#define buff6x 650
#define buff6y 260
-
grimjack
- Macro Author

- Posts: 525
- Joined: Thu Nov 07, 2002 6:51 am
-
Contact:
Post
by grimjack » Fri Sep 05, 2003 9:31 am
Did you run it with the debug that I added? It may point you in the right direction.
Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.
Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.
My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack
-
driftinsupra
- Official loudmouth

- Posts: 212
- Joined: Tue Jan 28, 2003 9:25 pm
Post
by driftinsupra » Fri Sep 05, 2003 12:47 pm
Wierd...after adding those 2 lines of code it works flawlessly everytime