Bug with Alert lists ??

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Bug with Alert lists ??

Post by Fippy » Thu Sep 12, 2002 11:53 am

Ok I have the following code to decide which mob I want to target.

Code: Select all


#define KSRadius v51

sub main
| Setup Alerts for the most important mobs here (rare)
|
   /alert clear 1
   /alert add 1 npc cyclops

| Setup Alerts for the next most important mobs here (uncommon)
|

   /alert clear 2
   /alert add 2 npc giant
   /alert add 2 npc dry
   /alert add 2 npc ronin
   /alert add 2 npc scrounge

| Setup Alerts for the next most important mobs here (common)
|
   /alert clear 3 
   /alert add 3 npc asp
   /alert add 3 npc coyote
   /alert add 3 npc mummy
   /alert add 3 npc Snake
   /alert add 3 npc madman
   /alert add 3 npc tarantula
   /alert add 3 npc ghoul  
   /alert add 3 npc rattlesnake
   /alert add 3 npc jackal
   /alert add 3 npc puma
   /alert add 3 npc scarab
   /alert add 3 npc zombie
   /alert add 3 npc asp
   /alert add 3 npc orc
   /alert add 3 npc skeleton


| Setup Alerts for Scary mobs here
|
   /alert clear 4
   /alert add 4 npc terrorantula

  /varset KSRadius 60
   /call GetTarget

/return

sub GetTarget 
   :Acquire
      /if "$alert(1)"=="TRUE" {
         /target npc alert 1 noalert 4 nopcnear $KSRadius
      } else /if "alert(2)"=="TRUE" { 
         /target npc alert 2 noalert 4 nopcnear $KSRadius
      } else {
         /target npc alert 3 noalert 4 nopcnear $KSRadius }
      
      /varset MyTarget $target(id)
      /doevents
      /echo $target(id)
   /if n $target(id)==0 /goto :Acquire
/return 
As you can see in this example I picked SRo mobs as everyone is familiar with the need :-)

But it just doesnt seem to work properly. If you run the script and there are no mobs that match alert 1 or alert 2 then it should target a mob that matches alert 3 but it doesnt, it just targets nothing and says There are no ')' around here ???

What am i doing wrong ?

Fippy.
Last edited by Fippy on Tue Sep 17, 2002 7:39 am, edited 1 time in total.

User avatar
rizwank
Huggle Police
Huggle Police
Posts: 524
Joined: Tue Jul 23, 2002 12:07 am
Contact:

Post by rizwank » Thu Sep 12, 2002 4:45 pm

OT: Wasting time with Jboots is kinda wrong :p

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Thu Sep 12, 2002 7:36 pm

It aint actually for farming Sro though it could be I guess the final script is just for general Component farming for tradeskills. I only used Sro mobs as an example. Who needs Jboots when ya got run speed 3 :-)

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Tue Sep 17, 2002 7:37 am

This looks like a bug. I have been playing around with different ideas but I can't figure out a way of doing this logic any other way.

Code: Select all

 :Acquire
      /if "$alert(1)"=="TRUE" { 
         /target npc alert 1 noalert 4 nopcnear $KSRadius 
      } else /if "alert(2)"=="TRUE" { 
         /target npc alert 2 noalert 4 nopcnear $KSRadius 
      } else { 
         /target npc alert 3 noalert 4 nopcnear $KSRadius } 
      
      /varset MyTarget $target(id) 
      /doevents 
      /echo $target(id) 
   /if n $target(id)==0 /goto :Acquire 
all the $alert(x) statement perform as expected. If i type in each of the target statements they all perform as expected. When put together in this program flow it doesnt work.

I have tried it on my WinXPPro PC and My Win2K PC, both under EQW (since i cant get MQ to work without running under EQW) with the same results. It seems to work fine if there is at least one mob in each alert category otherwise it just fails and targets nothing.

Can anybody think of a different way of doing the logic without /if's ? or at least confirm its broken for them too?

Fippy (The frustrated)

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

Post by L124RD » Tue Sep 17, 2002 8:18 am

Salutations,
Whe!

Code: Select all

 :Acquire
      /if "$alert(1)"=="TRUE" {
         /target npc alert 1 noalert 4 nopcnear $KSRadius
      } else /if "alert(2)"=="TRUE" {
         /target npc alert 2 noalert 4 nopcnear $KSRadius
      } else {
         /target npc alert 3 noalert 4 nopcnear $KSRadius 
      }
      /varset MyTarget $target(id)
      /doevents
      /echo $target(id)
   /if n $target(id)==0 /goto :Acquire 
Try that... You had a syntax err with the last curly bracket you used.

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Tue Sep 17, 2002 10:07 am

God I am stupid. Thanks for pointing that out L12. I was having a 'stare at it for too long and just cant see the problem' moment lol.

Fippy

gingertips
a hill giant
a hill giant
Posts: 230
Joined: Wed Jun 26, 2002 3:47 am
Location: Tseu-Qorcam

Post by gingertips » Tue Sep 17, 2002 2:40 pm

dang those curly brackets! i spent a week looking at a macro til i realised i had the same!!!