Charmed pet health and invis macro request

Have a macro idea but not sure where to start? Ask here.

Moderator: MacroQuest Developers

DeathOfRats
orc pawn
orc pawn
Posts: 15
Joined: Wed Sep 24, 2003 8:49 am

Post by DeathOfRats » Fri Oct 08, 2004 6:21 pm

Well, I haven't fully debugged your version Lum, but I did notice you didn't include the spellcast.inc

I included it, but it actually didn't change the fact that nothing seems to happen. I put a /popup just after the start (which happened), but during charm testing I had to manually break the pet on all occasions.

I don't have more time tonight, but I will put a bunch more popups in to see where it is sticking at.

Lum
a lesser mummy
a lesser mummy
Posts: 68
Joined: Thu Sep 16, 2004 10:12 am

Post by Lum » Fri Oct 08, 2004 9:29 pm

I havent used spellcast or spell routine much, its why i added in delays all over, Ive done other simple macros with casting that dont require it.

DeathOfRats
orc pawn
orc pawn
Posts: 15
Joined: Wed Sep 24, 2003 8:49 am

Post by DeathOfRats » Sat Oct 09, 2004 4:12 am

I just wanted to walk through the code to try and get the hang of it....

Code: Select all


#event rootresist "#*#has resisted your Greater Fetter spell#*#" 
#event nukeresist "#*#has resisted your Insanity spell#*#"
#event charmresist "#*#has resisted your Command of Druzzil spell#*#"
|Creates an event named xxxresist that happens when the condition occurs

sub main | beginning of macro
:newpet   | subroutine called newpet
/if (${Me.Pet.ID}) {
  /goto :loop  | Checks to see if I have a pet, if I do...it goes to subroutine loop
}
:newpet2 |subroutine called newpet2
/if (${Target.ID}) {    |this routine works only if I have something targetted
  /if (${Target.ID!=${Me.ID}&&${Target.PctHPs}<5) {   |If the target is me, and the mob I am killing is less than 5% hitpoints, proceed.
    /popup "Nuking target, Inadequate pet!" | onscreen message
    /e Killing an invalid pet, ${Target.Name} | message that comes up in MQ UI chat screen
    /cast "Greater Fetter"
    /delay 4.1s
    /doevents rootresist
    /cast "Insanity"
    /delay 8.4s
    /doevents nukeresist
    /if (${Target.ID}) {
    /goto :newpet2
    }
  }
  /if (${Target.ID}!=${Me.ID}&&${Target.PctHPs}>5) {
    /popup "Valid pet targetted, Attempting to Charm"
    /e Attempt to charm ${Target.Name}
    /cast "Command of Druzzil"
    /delay 7.4s
    /doevents charmresist
    /goto :newpet
  }
}
/goto :newpet
:loop
/if (${Me.Pet.PctHPs}<5) {
  /target ${Me.Pet}
  /cast item "Item Name"
  |Need to change this Delay value to the casting time of your clicky invis.
  |Or you need to change /cast item "Item Name" to /cast "Improved Invisibility"
  |If using improv invis, change delay to /delay 6.3s
  /delay 1s
  /goto :newpet2
}
/goto :newpet
/return

sub Event_rootresist
/popup Root resisted, Recasting.
/cast "Greater Fetter"
/delay 4.1s
/return

sub Event_nukeresist
/popup Nuke resisted, Nuking again.
/cast "Insanity"
/delay 8.4s
/return

sub Event_charmresist
/popup Charm resist! Casting again.
/cast "Command of Druzzil"
/delay 7.4s
/return

Grr, I wanted to go through it all but my stupid work break is too short!

DeathOfRats
orc pawn
orc pawn
Posts: 15
Joined: Wed Sep 24, 2003 8:49 am

Post by DeathOfRats » Sat Oct 09, 2004 7:37 am

Tried again this lunchtime, putting /popup (subroutine) at the start of each subroutine.

No starting message this time (strange), but when I eventually *had* to click my invis item, it called up newpet2 subroutine and didn't do anything I could physically see.

No messages again after this.

The following is the exact full code I have inside my hoh.mac file

Code: Select all

#turbo
#event rootresist "#*#has resisted your Greater Fetter spell#*#"
#event nukeresist "#*#has resisted your Insanity spell#*#"
#event charmresist "#*#has resisted your Command of Druzzil spell#*#"
#include spellcast.inc

sub main
/popup Starting
:newpet
/if (${Me.Pet.ID}) {
  /goto :loop
}
:newpet2
/popup newpet2
/if (${Target.ID}) {
  /if (${Target.ID!=${Me.ID}&&${Target.PctHPs}<5) {
    /popup "Nuking target, Inadequate pet!"
    /e Killing an invalid pet, ${Target.Name}
    /cast "Greater Fetter"
    /delay 4.1s
    /doevents rootresist
    /cast "Insanity"
    /delay 8.3s
    /doevents nukeresist
    /if (${Target.ID}) {
    /goto :newpet2
    }
  }
  /if (${Target.ID}!=${Me.ID}&&${Target.PctHPs}>5) {
    /popup "Valid pet targetted, Attempting to Charm"
    /e Attempt to charm ${Target.Name}
    /cast "Command of Druzzil"
    /delay 7.3
    /doevents charmresist
    /goto :newpet
  }
}
/goto :newpet
:loop
/popup loop
/if (${Me.Pet.PctHPs}<5) {
  /target ${Me.Pet}
  /cast item "Boots of the Mosquito"
  |Need to change this Delay value to the casting time of your clicky invis.
  |Or you need to change /cast item "Item Name" to /cast "Improved Invisibility"
  |If using improv invis, change delay to /delay 6.3s
  /delay 1s
  /goto :newpet2
}
/goto :newpet
/return

sub Event_rootresist
/popup Root resisted, Recasting.
/cast "Greater Fetter"
/delay 4.1s
/return

sub Event_nukeresist
/popup Nuke resisted, Nuking again.
/cast "Insanity"
/delay 8.3s
/return

sub Event_charmresist
/popup Charm resist! Casting again.
/cast "Command of Druzzil"
/delay 7.3s
/return

/return

Lum
a lesser mummy
a lesser mummy
Posts: 68
Joined: Thu Sep 16, 2004 10:12 am

Post by Lum » Sat Oct 09, 2004 4:59 pm

Code: Select all

:newpet2 
/popup newpet2 
/if (${Target.ID}) { 
  /if (${Target.ID!=${Me.ID}&&${Target.PctHPs}<5) { 
I need to add a } after the second Target.ID

Code: Select all

/if (${Target.ID}!=${Me.ID}&&${Target.PctHPs}<5) { 
I have horrible typing, this may be whats wrong.

also the operator != means does not equal, your noted macro above says equals :P

all the edits are from typos :shock:

DeathOfRats
orc pawn
orc pawn
Posts: 15
Joined: Wed Sep 24, 2003 8:49 am

Post by DeathOfRats » Sat Oct 09, 2004 6:08 pm

Tried again but realised that this is something that is going to require an on/off trigger in game to work.

It may be complicated, but the way I had hoped for it to work was to have the macro running in the background full-time. What actually happens is that as soon as I target something, it tries to charm it. Since the chance of charm landing without tash is remote, this tends to lead me to be running around all over the damn place :D

So I think perhaps some sort of trigger conditions such as "has been charmed" to start the macro up, and "you have gained experience" as the end trigger for it to wait at the start again would be best perhaps?

Lum
a lesser mummy
a lesser mummy
Posts: 68
Joined: Thu Sep 16, 2004 10:12 am

Post by Lum » Sun Oct 10, 2004 4:07 am

as for a fix to running "full time" it may be easier to make 2 social hotkeys, 1 for starting, one for /endmacro :P

Its still possible to add in things in the charm subroutine such as Root it, tash it, then charm etc, just involves adding more appropriate spells and delays.

You could also use events, one to manually trigger the event and have that sub send you to start the charm process and also add an event for EXP message to start the macro over.

As for me not using spell_routine or spellcast still, I havent dealt with it and Been looking over this macro when i had the free time, not much time to go over those includes.

DeathOfRats
orc pawn
orc pawn
Posts: 15
Joined: Wed Sep 24, 2003 8:49 am

Post by DeathOfRats » Sun Oct 10, 2004 10:10 am

Yeah, the idea of events is the one that appeals most. I don't really know how to implement it though, my best guess is to add:

#event Charmed " (charmed message here) "
#event XP gain " you have gained experience "

Then immediately at the start, just after sub main you would put something like:

if Charmed then begin

problem would be looking for the experience gain event, which is basically a goto start routine.

LOL, I know exactly what I want but I don't have the knowledge to implement it.

Lum
a lesser mummy
a lesser mummy
Posts: 68
Joined: Thu Sep 16, 2004 10:12 am

Post by Lum » Sun Oct 10, 2004 6:05 pm

if you get some code working at least, maybe its time to put it into the macro help section :P

Easy explanation of an event:
the #event tag is triggered bby the text in it, and when you /doevents if its triggered it goes to the "sub Event_(name of event)" and untriggers the event.

its like adding an /if "This text" has gone by, do the commands in the sub routine

and reading the manual always helps when going through a macro

zanlez
orc pawn
orc pawn
Posts: 10
Joined: Thu Sep 16, 2004 8:58 am

Post by zanlez » Mon Dec 20, 2004 7:59 pm

I'm gonna sit down and start working on what you've done to make it a auto charm macro using circle or whatever. Would like some help with it.

Oh. There aren't any out yet are there? been looking all night

Ashmodai
orc pawn
orc pawn
Posts: 16
Joined: Thu Dec 16, 2004 3:55 am

Post by Ashmodai » Fri Jan 07, 2005 5:07 pm

I notice you're targeting your pet before casting your item clicky on the Boots. You should probably be targeting yourself.