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
-
Gumby
- a ghoul

- Posts: 99
- Joined: Sat Jan 24, 2004 5:27 pm
Post
by Gumby » Sun Jan 25, 2004 12:25 pm
Hello,
I'm in the process of writing my first sets of scripts, and have run across something thing I've been unable to figure out directly and haven't been able to find reference to in the forums.
I understand that anything that requires window focus won't happen in the background and the script will simply hang until it receives focus and then will happily continue processing; however, /sendkey does this on my install, but in looking through the genbot threads the statement was made it runs in the background just peachy beyond Archery (I haven't tried it myself) and yet it makes use of /sendkey extensively for some of it's movement routines. Is there something I missed?
Thanks,
G
-
Sparky421
- decaying skeleton

- Posts: 7
- Joined: Wed Jan 21, 2004 5:32 pm
Post
by Sparky421 » Mon Jan 26, 2004 12:57 am
I am dealing with the same problem atm. I have taken bits and pieces from grimjack's hunter.mac and blackbelt's raid monk script to make a script that will beat on a mob as my druid agro kites it. Currently I am running both accounts on one machine so the monk will be without focus. I will post the code below and if someone can clue me in on what changes need to be made to allow it to function without focus, or let me know that it is not currently possible to do it with MQ functionality I would greatly appreciate it.
Code: Select all
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event Hitme "hits YOU for "
#Event Engage "ENGAGE"
#turbo 90
Sub Main
/declare RangeLong global
/declare RangeMax global
/declare RangeMin global
/declare FastRange global
/declare MyXLOC global
/declare MyYLOC global
/declare ObstCount global
/declare doengage global
/varset doengage 0
/varset RangeMax 12
/varset RangeMin 10
/varset FastRange 14
/varset ObstCount 0
:Wait
/assist XXXXXXX
/delay 5
/if "$target() "=="FALSE" {
/target XXXXXXX
/face nopredict
/goto :Wait
}
/if "$target(type)"!="NPC" {
/face nopredict
/goto :Wait
}
/tell XXXXXXX I have %t as my target
/stand
:attackcall
/if n $target(distance)<=15;
/doevents
/if n @doengage==1 {
/goto :Attack
} else {
/goto :attackcall
}
/goto :Wait
:attack
/tell XXXXXX attacking %t
/call MoveToMob
/call CombatSub
/call ResetSub
/doability "Feign Death"
/goto :Wait
/return
Sub Event_Engage
/varset doengage 1
/return
Sub Event_Hitme
/attack off
/doability "Feign Death"
/delay 1s
/stand
/attack on
/return
Sub MoveToMob
/face fast
/if n $target(distance)>=@FastRange /call Fastmove
/if n $target(distance)>@RangeMax {
/press up
}
/if n $target(distance)<@RangeMin {
/press down
}
/return
Sub Fastmove
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
:fastmoveloop
/if $target()=="FALSE" {
/sendkey up up
/if $combat=="TRUE" {
/attack off
/return
}
}
/face fast
/if n $target(distance)>@FastRange {
/sendkey down up
}
/if n $target(distance)<=@FastRange {
/sendkey up up
/return
}
/varadd ObstCount 1
/if n @ObstCount>=3 {
/call CheckObst
}
/goto :fastmoveloop
/return
sub CombatSub
/attack on
:combatloop
/doevents
/face fast
/doability "Flying Kick"
/call MoveToMob
/face fast
/if n $target(id)==0 /varset TargetDead 1
/if n @TargetDead!=1 /goto :combatloop
/sendkey up up
/delay 2s
/return
sub CheckObst
/if n @MyXLOC==$char(x) /if n @MyYLOC==$char(y) /call HitObst 5
/varset MyXLOC $char(x)
/varset MyYLOC $char(y)
/varset ObstCount 0
/return
sub HitObst
/sendkey up up
/sendkey down down
/if n $rand(99)>50 {
/delay 3s
/sendkey up down
/sendkey down Right
/delay @Param0
/sendkey up Right
/sendkey down up
/delay 3s
/sendkey up up
} else {
/delay 3s
/sendkey up down
/sendkey down left
/delay @Param0
/sendkey up left
/sendkey down up
/delay 3s
/sendkey up up
}
/sendkey up down
/sendkey up Right
/sendkey up Left
/sendkey down up
/return
sub ResetSub
/sendkey up up
/press esc
/press esc
/press esc
/press esc
/press alt
/press shift
/press ctrl
/varset doengage 0
/varset ObstCount 0
/delay 1s
/return
-Sparky421
-
Sparky421
- decaying skeleton

- Posts: 7
- Joined: Wed Jan 21, 2004 5:32 pm
Post
by Sparky421 » Mon Jan 26, 2004 2:05 am
native...
-Sparky421
-
cronic
- a grimling bloodguard

- Posts: 536
- Joined: Wed Nov 26, 2003 11:01 pm
Post
by cronic » Mon Jan 26, 2004 3:39 am
The only way I've found to use the commands that require window focus is to use EQW. I can /press and /sendkey perfectly while minimized in EQW.
cronic
-
Gumby
- a ghoul

- Posts: 99
- Joined: Sat Jan 24, 2004 5:27 pm
Post
by Gumby » Tue Jan 27, 2004 3:34 pm
Thank you for the replies. Yes it was using a native EQ window rather than using EQW... will give EQW a shot.
G
-
Sparky421
- decaying skeleton

- Posts: 7
- Joined: Wed Jan 21, 2004 5:32 pm
Post
by Sparky421 » Tue Jan 27, 2004 5:14 pm
Thanks cronic eqw worked for me. Now I just need to find a way to get the melee char to follow a snared mob better. Currently the combat script in hunter.mac has me hitting about 25% of the time if Im lucky. Also the code I posted above has a flaw in it... you need to
at the top and....
somewhere just under Sub Main but within the active loop.
I will post the fixed code in a new post and see if I can get some help comming up with a better way to track a moving snared mob from behind with a greater chance of staying within combat range. Thanks again cronic!
-Sparky421