archery macro repair

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

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

archery macro repair

Post by bclark » Tue Apr 27, 2004 10:09 am

I have been using an autofire macro for archery for quite a while now. I know the latest changes (mqdata) have broken the /if , but wanted to see if anyone had a simple fix for this wonderful macro. Any and all help is truly appreciated.

Code: Select all

#turbo

Sub Main

   /echo Autofire ON
   :Loop
      /if $target(type)==NPC {
         /if $char(casting)==FALSE {
            /press Num_0
            /delay 1
         }
         /goto :Loop
      } else {
         /echo No NPC targeted
      }
      /echo Autofire OFF
/return
Last edited by bclark on Tue Apr 27, 2004 3:29 pm, edited 2 times in total.

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

Post by loadingpleasewait » Tue Apr 27, 2004 12:27 pm

Simple fix.

go use the archery macro I just posted in the Macro Depot.

Simple? heres a link..

http://macroquest2.com/phpBB2/viewtopic.php?t=6667
LOADING PLEASE WAIT...

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue Apr 27, 2004 1:29 pm

Code: Select all

[code]YOU PUT CODE IN HERE[/code]
And it goes into an easy to read window here.

simple eh?

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 2:46 pm

I would prefer to simply get this macro working. it would check if target was an npc, archery til target was dead OR esc to clear target, and would then end the macro. with an assist key, pause, then /macro arch it was super smooth and simple. I am not looking for a macro that runs full time, just the duration of combat

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Tue Apr 27, 2004 2:54 pm

Ignoring the fact that you refuse to edit your first post and use the god damn code brackets....

Code: Select all

/if $target(type)==NPC { 
/if $char(casting)==FALSE { 
http://macroquest2.com/phpBB2/viewtopic.php?t=6179
Read paragraph #4... no, read the whole thing.

http://macroquest2.com/phpBB2/viewtopic.php?t=6022
Read.

Code: Select all

/if (${Me.Casting.ID}) /echo I'm casting
/if (!${Me.Casting.ID}) /echo I'm not casting
Here is your hint. Figure out how these work, see above links, and you've got a good damn start into writing macros.
As a last step. ATTEMPT TO WRITE IT YOURSELF. Then post, in fucking code brackets, your attempt and we all might be a little more inclined to help.

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 2:58 pm

Thanks for the helpful tips Preoct. If I hadnt added the [code] brackets i think we would have all been lost. /bow

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 3:04 pm

The topics linked do indeed seem helpful in my quest to troubleshooting and rewriting this code. Thanks much

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 3:21 pm

ok well im toying with the syntax of the new coding and think i am getting closer. here is what I have currently.

Code: Select all

#turbo

Sub Main

   /echo Autofire ON
   :Loop
   /if (${Target.ID} && ${Target.Type.Equal[NPC]})=
            /keypress Num_0
            /delay 1
            /goto :Loop
      else {
   /if (${Target.Type.NotEqual[NPC]}) { 
         /end
         /echo No NPC targeted
      }
      /echo Autofire OFF
/return
its erroring out on the first /if line. from what i can tell its needing a command at the end of the /if (conditions). so perhaps /if (conditions)=/ranged? I am still testing and massaging the syntax around but any help would still be appreciated
Last edited by bclark on Tue Apr 27, 2004 3:29 pm, edited 1 time in total.

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 3:28 pm

i actually broke this down to its most basic and think i am VERY close =) anyways, it now ends the macro if there is no target (basically, no npc targetted). if i target an npc and run macro its shooting an arrow at the npc but then the macro is ending. Im sure its just an issue of setting up a :loop and else line in the code but im not sure on the syntax or placement once again. heres the basic code

Code: Select all

#turbo

Sub Main

   /echo Autofire ON
   /if (${Target.ID} && ${Target.Type.Equal[NPC]}) /ranged
   /if (${Target.Type.NotEqual[NPC]}) /end
   /echo No NPC targeted
   /echo Autofire OFF
/return

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 3:43 pm

OK, this seems as far as I can get at the moment. The macro starts fine, checks and ensures target is an npc etc, BUT it seems to continue doing the loop i added even once the target is dead. if i target another npc it starts shooting again til dead versus if there is no npc targetted, simply ending the macro. any further assistance is much appreciated.

Code: Select all

#turbo

Sub Main

   /echo Autofire ON
   :Loop
   /if (${Target.ID} && ${Target.Type.Equal[NPC]}) {
            /ranged
            }
            /goto :loop
      } else {
   /if (${Target.Type.NotEqual[NPC]}) {
   /end
   /echo No NPC targeted
   }
   /echo Autofire OFF
/return

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Tue Apr 27, 2004 4:03 pm

You dont lose your target when they die?

by the way empty #turbo does nothing

Code: Select all

Sub Main

   /echo Autofire ON
   :Loop
   /delay 1
   /if (${Target.ID} && ${Target.Type.Equal[NPC]} && ${Target.State.NotEqual[DEAD]}) {
            /ranged
            }
            /goto :loop
      } else {
   /if (${Target.Type.NotEqual[NPC]}) {
   /end
   /echo No NPC targeted
   }
   /echo Autofire OFF
/return 
that should work
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Tue Apr 27, 2004 4:04 pm

Or just keep it looping at all times like this:

Code: Select all

Sub Main 
/echo Autofire Macro Started

:WaitForTarget
    /echo Waiting for target.
:WaitForTargetLoop
    /if (${Target.ID} && ${Target.Type.Equal[NPC]}) /goto :FoundTarget
    /delay 1
/goto :WaitForTargetLoop

:FoundTarget
    /echo Target [ ${Target.CleanName} ] Found, Starting Ranged Attack.
:FoundTargetLoop
    /if (!${Target.ID} || !${Target.Type.Equal[NPC]}) /goto :WaitForTarget
    /ranged 
    /delay 5
/goto :FoundTargetLoop
/return 

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 4:16 pm

Lax thank you for the post. I tried your code as well, and it too will attack ranged on an npc and /echo autofire on...However, once the target is dead and/or I press escape to clear target (effectively target type non npc) the macro does not end. That is basically where I was stuck with my code as well. ml2517 thanks for your post as well, altho I am looking for a macro that terminates at death of npc.

bclark
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Feb 22, 2004 7:29 pm

Post by bclark » Tue Apr 27, 2004 4:19 pm

Another note for Lax....If i target myself and run the code you posted (or my code for that matter) autofire does indeed turn on, which it should BUT should go to } else { and terminate the macro since no npc was targetted. this is not occurring so it seems the code is not getting out of the loop.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Tue Apr 27, 2004 6:35 pm

Ok give this a shot then:

Code: Select all

Sub Main 
/echo Autofire Macro Started 

:WaitForTarget 
    /echo Waiting for target. 
:WaitForTargetLoop 
    /if (${Target.ID} && ${Target.Type.Equal[NPC]}) /goto :FoundTarget 
    /delay 1 
/goto :WaitForTargetLoop 

:FoundTarget 
    /echo Target [ ${Target.CleanName} ] Found, Starting Ranged Attack. 
:FoundTargetLoop 
    /if (!${Target.ID} || !${Target.Type.Equal[NPC]}) {
        /echo Autofire Macro Stopped
        /endmacro
    } else {
        /ranged 
        /delay 5 
        /goto :FoundTargetLoop 
    }
/return