Goto page Previous  1, 2 General A dumber dumbed down guide to MQ and MQemu
Reply
I like the skeleton example.

Is there a flag to identify mobs that are currently attacking me?
Or should I capture text from the melee window to see who is attacking me? It wouldn't have to be target specific, ie. if there are 2 mobs named Froglok attacking me, attacking either one of them fills the purpose.

Is there a flag to tell if I am currently under attack?

Or could I simply set it to attack any NPC in melee range?

Perhaps something like.

/declare attacking bool global
Sub Main
:loop
/varset attacking true
/stick
/goto :loop
/return

btw,

What does /return do?
What does Sub Main do?


Thanks!
Fri Jun 18, 2010 11:52 am
The methods for detecting that your under attack ar very limited. You can target a mob. Then check Me.TargetOfTarget.ID == Me.ID that isn't very practicle for your plan though caus you'd have to have your macro constantly swaping targets.

I would do a range thng probably.... Kill everything in 100 range.... The alternative might be to set a chat event for you being hit like you said. Here is the small downside... Chat will only give the mobs short name(long name is like a_rat000). Think kael arena. There are 2 types of POZ. Protector of zek, and A protector of zek. Poz and apoz. Say poz hits you... You record his name in the macro and it does a /target poz.... It could snag the apoz near vindicator and go running across the zone.

I've never done anything with combat detection unfortunately.

If you are in control of it.... Hitting a hot key to kill everything I would go the radius path...

Macros get run 1 line at a time and can bounce around from subsection to subsection. Sub main is the first line, the entry point.

Sub main
/say 1
/call test
/say 3
/return

sub test
/say 2
/return

that will count 1 2 3 in order. Sometimes people call it the cursor... Think the blinking line in notepad or dos. When any macro starts there is an understood /call main. That gets run basically. That makes /say 1 the first line run. The /call test sends the cursor to sub test, where /say 2 is run. The /return will "return" the cursor back to where it was at befor sub test, Where it will run the say 3. Then it will encounter the return of sub main. Since the cursor didn't exist before sub main this return will just end the macro.
Fri Jun 18, 2010 1:51 pm
Project Lead
Just wondering... earlier you said "The macroquest core. Macroquest.exe is closed source, we can't see how it works BUT it loads mq2main.dll which we do have the code for. "

Isn't this the source code to macroquest that works with unpatched Titanium?
http://www.macroquest2.com/downloads/MQ2-20051101.zip

I was confused by your statement that it was closed source, since if you play on Live for example, you have to compile a new MQ2 after nearly every patch day (if I'm reading things right).
Fri Jun 18, 2010 2:00 pm
Actually, your check target example would work I think...

Sub Main

/target NPC |targets nearest NPC
If Me.TargetOfTarget.ID == Me.ID Then call Sub_fight
If Me.TargetOfTarget.ID == Me.ID Then End
Return

Sub Fight
/turn on attack
/auto kick or punch or bash
/When mob dies, go to Sub Main


The problem with the 100 radius is, if you run to fight a mob at the edge, you might run another 100 after that mob and daisy-chain your way down the dungeon without wanting to.
Fri Jun 18, 2010 2:21 pm
Macroquest2.exe is closed source it automatically loads mq2main.dll which is open source and contains all the info that changes from client to client.

I think there is a way to check a radius using coordinates.... Might poke through the manual and see... Like NearestSpawn[radius 100 x 300 y 500] I'm not positive on that, but if so you could save your loc when you first fire your hotkey command

/varset myx ${Me.X}

I'll go get on my work pc and check
Fri Jun 18, 2010 3:13 pm
Project Lead
Try
radius 100 loc 250 333
or maybe
range 100 loc 828 8282

${NearestSpawn[1 range 100]} would be the first spawn within 100, change it to 2 for next...

In the manual look up the /for command for an easy way to loop through counting things like that. I can elaborate on t with examples if you need
Fri Jun 18, 2010 3:27 pm
Project Lead
Goto page Previous  1, 2 General A dumber dumbed down guide to MQ and MQemu
Reply