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
-
Stogar
- a lesser mummy

- Posts: 58
- Joined: Mon Oct 13, 2003 12:02 pm
Post
by Stogar » Mon Oct 20, 2003 4:03 pm
Does this look correct
Just an example that if pet exists then tell it to attack.
-
Tuffy
- a lesser mummy

- Posts: 33
- Joined: Thu Oct 02, 2003 9:20 am
Post
by Tuffy » Mon Oct 20, 2003 4:29 pm
I think it should be like this:
I've been wronge a lot here lately though.
-
Falco72
- a hill giant

- Posts: 215
- Joined: Fri Sep 26, 2003 3:24 am
Post
by Falco72 » Mon Oct 20, 2003 4:31 pm
Are you sure? I think $char(pet) reports the id of the pet if it exist or 0 if not. So in your example the code should be:
-
Scrime
- a ghoul

- Posts: 86
- Joined: Sun Sep 21, 2003 5:48 pm
-
Contact:
Post
by Scrime » Tue Oct 21, 2003 8:04 am
I prefer the numeric comparison
-
Stogar
- a lesser mummy

- Posts: 58
- Joined: Mon Oct 13, 2003 12:02 pm
Post
by Stogar » Tue Oct 21, 2003 9:39 am
Actually I have see both in different macros, and is why I asked. I tested mine when I got home and it seemed to work erratically.
I added it to the hunter.mac to test in the attack sub. Ended up just putting a /pet attack after the /attack on. Not very creative but it worked.
I did do alot of looking at necrofarm.mac that I think scrime originally wrote, but I haven't found a conversion for. I have a necro and a shaman I'd like to have the pet do the grunt work of farming.
Thanks for the input.
-
Scrime
- a ghoul

- Posts: 86
- Joined: Sun Sep 21, 2003 5:48 pm
-
Contact:
Post
by Scrime » Tue Oct 21, 2003 12:08 pm
Yeah, I need to convert that macro. I'm a slacker. *hangs his head in shame*
-
Mckorr
- Developer

- Posts: 2326
- Joined: Fri Oct 18, 2002 1:16 pm
- Location: Texas
Post
by Mckorr » Tue Oct 21, 2003 12:54 pm
/if $char(pet)==1
is the same thing as
/if $char(pet)!=0
In the first you are saying "if TRUE", and in the second you are saying "if NOT FALSE". Logically they are the same statement.... well, in boolean logic anyway :)
MQ2: Think of it as Evolution in action.
-
Scrime
- a ghoul

- Posts: 86
- Joined: Sun Sep 21, 2003 5:48 pm
-
Contact:
Post
by Scrime » Tue Oct 21, 2003 1:03 pm
$char(pet) returns the spawn id of the pet though, so /if $char(pet)==1 is not true unless the pet's spawn id is indeed 1.
In this case $char(pet)==1 is not the boolean logical invert of $char(pet)!=0
-
Mckorr
- Developer

- Posts: 2326
- Joined: Fri Oct 18, 2002 1:16 pm
- Location: Texas
Post
by Mckorr » Tue Oct 21, 2003 1:09 pm
Ah, gotcha. Can you tell I never play a pet class?
MQ2: Think of it as Evolution in action.