hillgiant.mac

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

Pinch
decaying skeleton
decaying skeleton
Posts: 1
Joined: Tue Dec 24, 2002 5:42 pm

hillgiant.mac

Post by Pinch » Tue Dec 24, 2002 5:52 pm

This is my first time writing a macro, so I would appreciate some input. This code is designed to help me target a hill giant not being attacked, face it, and relay some info about it back to me. Is there some way to target the next HG in a series of HGs? And can I make the code forget, in the next loop thru, the current HG, if its health is below 100? I've tried a couple different things, but all i've accomplished is instant desktop-crash. Any help is appreciated, thanks.

Code: Select all

#turbo
Sub Main
:HG
   /target nopcnear 100 npc "hill giant"
   /delay 5
   /if n $target(hp,pct)!=100 {
      /goto :NextHG
   } else { 
      /Goto :FoundHG
:NextHG
   /target nopcnear 200 npc "hill giant"
   /delay 5
   /if n $target(hp,pct)!=100 {
      /goto :NextHGA
   } else { 
      /Goto :FoundHG
:NextHGA
   /target nopcnear 300 npc "hill giant"
   /delay 5
   /if n $target(hp,pct)!=100 {
      /goto :NextHGB
   } else {  
      /Goto :FoundHG
:NextHGB
   /target nopcnear 400 npc "hill giant"
   /delay 5
   /if n $target(hp,pct)!=100 {
      /goto :NextHGC
   } else { 
      /Goto :FoundHG
:NextHGC
   /target nopcnear 500 npc "hill giant"
   /delay 5
   /if n $target(hp,pct)!=100 {
      /goto :NextHGD
   } else { 
      /Goto :FoundHG
:NextHGD
   /target nopcnear 700 npc "hill giant"
   /delay 5
   /if n $target(hp,pct)!=100 {
      /goto :NextHGEnd
   } else { 
      /Goto :FoundHG
:NextHGEnd
/goto :HG
:FoundHG
/face
/echo DIST $target(distance) SPEED $target(speed)  LEVEL $target(level) ID $target(id)
/endmacro

Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

I think

Post by Malachi » Tue Dec 24, 2002 8:46 pm

I think that you may have 1 simple error in your script...well, maybe more than one but one that I see from a glance.

/target will always target the closest target matching your stipulations, so radius 100/200/...50,000 will always return the closest, simply changing the radius is not the way to make it cycle mobs.

There are about three threads currently discussing how to go about doing what you want to do.

Interestingly, I have noticed that if I /target something not typically within my range, it still shows the actual HP of the target. For example, last night I targeted a PC who was near the N ruins in DL, and did so from the druid circle. From there it showed me that his hp's were about 50%. If I *click* on an npc, like an HG in rathe for example, if it's out of range I can't see its hps change, but if I /target it, it does. Interesting, eh?

I just thought I'd throw that out there.
~Malachi
~Oh danny boy, the pipes the pipes are calling.~

User avatar
SingleServing
a hill giant
a hill giant
Posts: 195
Joined: Tue Dec 17, 2002 11:00 pm

Re: I think

Post by SingleServing » Thu Dec 26, 2002 6:21 am

Malachi wrote:I think that you may have 1 simple error in your script...well, maybe more than one but one that I see from a glance.

/target will always target the closest target matching your stipulations, so radius 100/200/...50,000 will always return the closest, simply changing the radius is not the way to make it cycle mobs.
I have found this to not always be true, as a matter of fact I have had to rewrite some code due to problems with targeting the closest ie

Code: Select all

/varset Maxrange 100
:IncRange
/varadd MaxRange 10
/who npc radius $MaxRange
/if target(name)==NULL /goto :IncRange
I have been unsuccessful in determiining the problem behind this bug as of yet...
[color=DarkBlue]Everything,[/color] [color=DarkBlue][b]is[/b][/color] [color=black]black[/color] [color=DarkBlue]and[/color] [color=white]white[/color][color=DarkBlue], when you zoom out it looks[/color] [color=gray]grey[/color][color=DarkBlue].[/color]

Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

I'm not sure

Post by Malachi » Thu Dec 26, 2002 11:34 am

I'm not positive, I think variables are case specific, lol.

Therefore, your Maxrange remains set to 100, while MaxRange (which is undefined, probably getting some error here) tries to add 10....it might just be locking up or hogging system resources.

Hope I'm right and it's that easy to fix....

Altho...that's still just gonna go up in increments of 10 till it locates the closest mob...which isn't what Pinch wanted....

~Malachi
~Oh danny boy, the pipes the pipes are calling.~

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Dec 26, 2002 2:29 pm

Salutations,
MQ# is not case sensitive

Malachi
a hill giant
a hill giant
Posts: 227
Joined: Tue Nov 19, 2002 1:29 am
Contact:

Doh....

Post by Malachi » Thu Dec 26, 2002 4:14 pm

Okies, I've been working a lot more w/ perl than anything else recently, and perl is case sensitive....

Hehe.

~Malachi
~Oh danny boy, the pipes the pipes are calling.~