Page 1 of 1

a simple invis every 9-10 minutes mac?

Posted: Fri Jul 02, 2004 8:00 pm
by 3djoker
just curious if there is a way to have a lvl 57 mage cast the long duration invis every 9-10 minutes?

im not going to pretend i know the first thing bout coding, becuase i don't. i'm just looking for something to cast invis every 10 minutes to refresh it while i wait for a spawn, so i don't need to do it. or when im 2 boxing, so i can just sit the mage in for some exp.

thanx a ton in advance......


*flame my ass= on*

Posted: Fri Jul 02, 2004 9:03 pm
by Space-Boy

Code: Select all

#include spellcast.inc 

#event attacked "#*#hits you#*#" 
#event tell "#*#tells you#*#" 
#event tell "#*#told you#*#" 

Sub Main 

   :loop 
   /doevents 
   /if (${Me.Buff[Gather Shadows].Duration}<3) { 
     /call cast "Gather Shadows" 
   } 
   /goto :loop 
/return 

Sub Event_tell 
  /beep
/return 


Sub Event_attacked 
   /beep 
   /beep 
   /pause 3 
   /beep 
   /beep 
/return 
usage would be /mac invis

Posted: Fri Jul 02, 2004 9:44 pm
by 3djoker
actually for mage it would be...

Code: Select all

#include spellcast.inc 

#event appear "#*#You appear#*#" 
#event attacked "#*#hits you#*#" 
#event tell "#*#tells you#*#" 
#event tell "#*#told you#*#" 

Sub Main 

   :loop 
   /doevents 
   /if (!${Me.Buff["Veil of Elements"]}) { 
     /call cast "Veil of Elements" 
   } 
   /goto :loop 
/return 

Sub Event_tell 
   /tell ${Param0} got a tell 
/return 

Sub Event_appear 
   /tell ${Param0} appeared, recasting 
   /beep 
/return 

Sub Event_attacked 
   /tell ${Param0} Im being attacked help! 
   /beep 
   /beep 
   /pause 3 
   /beep 
   /beep 
/return 
but did try it, got some error though....

i started it with no invis. it casted invis like it should but right after invis was cast, i got this error......

Code: Select all

Failed to parse /if condition '(veil of elements)', non-numeric encountered

invis.mac@12 (main):if (!${Me.Buff["Improved Invisibility"]}) {
the current macro has ended

iny idea what happened?

Posted: Fri Jul 02, 2004 9:58 pm
by Space-Boy
gonna log my enchanter in with random duration invis to figure it out =) will edit the original post with working version gimme a few

Posted: Fri Jul 02, 2004 10:08 pm
by 3djoker
thanx a ton man.

Posted: Fri Jul 02, 2004 10:23 pm
by Space-Boy
edited for use w/ necro or sk, change spell names, and i couldnt get tells working for some reason but at least the beeps work!! =) will re invis when tehre are 12 seconds left on spell, (when its flashing)

good enough right?

editted out some of the events, no need for them

Posted: Fri Jul 02, 2004 10:29 pm
by s16z
Tells don't work because Param0 doesn't exist in the subs, it's a parameter to the Main routine. You need to save it somewhere in another variable and use that.

Posted: Sat Jul 03, 2004 6:12 am
by 3djoker
works like a charm :)

now can i have permission to add a lil stuff to it to enhance it and give me some hands on at coding?

Posted: Sat Jul 03, 2004 11:10 am
by fearless
You can only edit your own posts unless you are an admin.

Posted: Sat Jul 03, 2004 12:46 pm
by 3djoker
thats not what i meant.
i just wanted permission to use his base code and alter it for my own personal benefits.

Posted: Sat Jul 03, 2004 1:17 pm
by aChallenged1
Isn't posting your code here pretty much permission to use as you see fit?

Posted: Sun Jul 04, 2004 3:02 pm
by blueninja
3djoker wrote: i started it with no invis. it casted invis like it should but right after invis was cast, i got this error......

Code: Select all

Failed to parse /if condition '(veil of elements)', non-numeric encountered

invis.mac@12 (main):if (!${Me.Buff["Improved Invisibility"]}) {
the current macro has ended

iny idea what happened?
Me.Buff returns a "buff" type object. The default type cast is string, Use ${Me.Buff["Improved Invisibility"].ID} instead.

Posted: Mon Jul 05, 2004 2:31 am
by Chill
while you could use ID as a boolean to see if its there or not, it would be better to use duration, like in the top post:

Code: Select all

/if (${Me.Buff[Gather Shadows].Duration}<3)
For a mage that would be:

Code: Select all

/if (${Me.Buff[veil of elements].Duration}<3)
This will allow you to re-invis just before invis fades, rather than after you become visable.

Note that .Duration is in 6-second tics.

Posted: Mon Jul 05, 2004 6:38 pm
by blueninja
That will bork when you don't have the buff on you though since you can't compare NULL to 3. Best way is to first test ID then Duration.[/code]