New Group Autoheal script or modded genbot one? (request)

Macro requests from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

New Group Autoheal script or modded genbot one? (request)

Post by Draekz » Wed Aug 20, 2003 5:19 pm

Is there a chance that someone could modify one of the longer genbot scripts to make it a simple group auto healer?

I just want it to simply be a group hp watcher, so that it stands heals and sits without having to do anything (that way i can relax and read instead of being bored watching the screen)

Anyway, thanks for any suggestions!

Draekz

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

Post by Imperfect » Wed Aug 20, 2003 7:39 pm

This is the macro Plazmic uses with is cleric when we are hunting.

Code: Select all


//Stuff added to give credit where it is due. Yay Plazmic and your macro

#turbo
#chat tell

#event CantSee "You cannot see your target"
#event HitsYou "s YOU for "
#event HitsYou " YOU, but misses."
#event Fizzle "Your spell fizzles!"
#event Fizzle "You haven't recovered yet..."
#event Fizzle "Spell recovery time not yet met."
#event Fizzle "Your spell is interrupted."

#define MANABUFFER 30

#define MASTERNAME <name of master>

#define CASTTIMER t0
#define CASTNEXTTIMER t1
#define NEXTOUCHTIMER t2
#define NEXTHOTTIMER t3
#define MANATIMER t4

#define OKTOCAST v80
#define FIZZLECHECK v82

#define HOTSPELL v74
#define HOTHP v75
#define HOTDUR v76
#define HEALHP v77
#define HEALSPELL v78

Sub Main
   /varset v99 0
   /varset OKTOCAST 1
   /varset v0 0
   /varset MANATIMER 1
   :Loop
      /doevents
      /if n $char(ability,"sense heading")>0 /doability "sense heading"

      /if n $OKTOCAST==0 /goto :SkipHealing
      /varset l6 $group(lowhp)
      /varset l7 $spawn($l6,hp,pct)
      /varset l8 $spawn($l6,class)
      /varset l9 0
      
      /if n $l7>60 /goto :SkipHealing
      /if n $l7<40 /varset l9 3

      /if "$l8"=="Enchanter" /if n $l7<50 /varset l9 1
      /if "$l8"=="Wizard" /if n $l7<50 /varset l9 1
      /if "$l8"=="Magician" /if n $l7<50 /varset l9 1
      /if "$l8"=="Necromancer" /if n $l7<50 /varset l9 1

      /if "$l8"=="Cleric" /if n $l7<60 /varset l9 2
      /if "$l8"=="Druid" /if n $l7<60 /varset l9 2
      /if "$l8"=="Shaman" /if n $l7<60 /varset l9 2

      /if "$l8"=="Cleric" /if n $l7<30 /varset l9 1
      /if "$l8"=="Druid" /if n $l7<30 /varset l9 1
      /if "$l8"=="Shaman" /if n $l7<30 /varset l9 1

      /if n $l9==3 /if n $char(mana,cur)<$int($spell("Complete Healing",mana)+MANABUFFER) /varset l9 1
      /if n $l9==1 /if n $char(mana,cur)<$int($spell("Divine Light",mana)+MANABUFFER) /varset l9 2
      /if n $l9==2 /if n $char(mana,cur)<$int($spell("Celestial Healing",mana)+MANABUFFER) /varset l9 0

      /if n $l9==3 /call CastSpell $l6 "Complete Healing"
      /if n $l9==2 /call CastSpell $l6 "Celestial Healing"
      /if n $l9==1 /call CastSpell $l6 "Divine Light"
      /if n $l9==2 /if n $OKTOCAST==0 /varset NEXTHOTTIMER 18s
      :SkipHealing

      /doevents
      /if n $char(hp,pct)<10 /call GetOutOfDodge
   /goto :Loop
/return

Sub Event_Chat
   /if "$p0"!="MASTERNAME" /return
   /if "$p2"~~"sit" /call Do_Sit $p0
   /if "$p2"~~"come" /call Do_Come $p0
   /if "$p2"~~"gate" /call Do_Gate $p0
   /if "$p2"~~"mana" /tell $p0 $char(mana,pct)m ($char(mana,cur)/$char(mana,max))
   /if "$p2"~~"help" /tell $p0 Help: sit, come, gate, mana
/return

Sub Do_Sit
  /if $char(state)==STAND {
     /tell $p0 Sitting down
     /sit
  }
/return

Sub Do_Come
   /target $p0
   /if $target(type)!=PC /return
   /tell $p0 Coming to you
   /gotoxy target
   /face fast heading $target(heading)
   /if $char(state)==STAND /sit
/return

Sub Do_Gate
   /tell $p0 Gating
   /gate
/return

Sub GetOutOfDodge
   /gate
   /delay 30s
   /sit
   /delay 2s
   /camp
/endmacro

Sub Event_Timer
   /if t$p0==CASTNEXTTIMER /varset OKTOCAST 1
  /if t$p0==MANATIMER {
     /gsay $char(mana,pct)m
     /varset MANATIMER 3m
  }
 /return

Sub ClearBadTargets
   /if $target(type)==CORPSE /target clear
   /for l0 0 to 5
      /if n $target(id)==$group($l0) /target clear
   /next l0
/return

Sub Event_HitsYou
   /if n $char(hp,pct)<10 /call GetOutOfDodge
   /if n $NEXTOUCHTIMER>0 /return
   /varset NEXTOUCHTIMER 12s
   /tell MASTERNAME Ouch, I'm getting whacked by $target(name,clean)!
   /target clear
/return

Sub Event_Fizzle
   /varset FIZZLECHECK 1
/return

Sub CastSpell
   | $p0: id to cast on 
   | $p1: spell to cast

   | $l0: Was sitting?
   | $l1: Real target
   /if $char(state)==STUN /return
   /varset l0 0
   /varset l1 $target(id)
   /varset l2 0
   :DoCast
   /varset OKTOCAST 1
   /if n $char(mana,cur)<$int($spell("$p1",mana)+MANABUFFER) /goto :Exit
   /if n $l2==0 /gsay Casting $p1 on << $spawn($p0,name,clean) >>
   /varset l2 1
   /sendkey up up
   /sendkey up down
   /varset OKTOCAST 0
   /varset FIZZLECHECK 0
   /target id $p0
   /if $char(state)==SIT /varset l0 1
   /if n $l0==1 /stand
   /cast "$p1"
   /varset CASTTIMER $int($spell("$p1",casttime)*10+5)
   /if n $l1!=0 /target id $l1
   /if n $l1==0 /target clear
   /if $target()==TRUE /call ClearBadTargets
   /varset l1 $target(id)
   :WaitCast
      /doevents
   /if n $FIZZLECHECK==0 /if n $CASTTIMER>0 /goto :WaitCast
   /if n $FIZZLECHECK==0 /goto :Exit
   /delay 1
   /goto :DoCast
   
   :Exit
   /if n $l1==0 /target clear
   /if n $l1!=0 /call ClearBadTargets
   /if n $l0==1 /sit
   /varset CASTNEXTTIMER $int($spell("$p1",recasttime)*10+5)
/return

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Thu Aug 21, 2003 1:35 pm

Nicely done! Thanks Imperfect, pretty much exactly what i was looking for :) appreciate it!

Draekz

User avatar
Ravena666
a ghoul
a ghoul
Posts: 101
Joined: Fri Aug 23, 2002 2:57 am

Post by Ravena666 » Thu Aug 21, 2003 5:08 pm

:shock: :idea: Imperfect :idea: :shock:

awwwsome!
~~ SPOON ~~
~~ SPORK ~~

dawnoffatex
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sun Aug 10, 2003 8:24 pm

Post by dawnoffatex » Thu Aug 21, 2003 5:54 pm

ok, i set this up, loaded it etc, started the macro without defining the master, and it reported mana periodically and did nothing else.

I defined the master, and then every time i start it , it reports mana and "the current macro has ended" :\ help?

User avatar
Ravena666
a ghoul
a ghoul
Posts: 101
Joined: Fri Aug 23, 2002 2:57 am

Post by Ravena666 » Thu Aug 21, 2003 6:14 pm

post what part of code is messing up on you and ill dink with it
~~ SPOON ~~
~~ SPORK ~~

dawnoffatex
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sun Aug 10, 2003 8:24 pm

Post by dawnoffatex » Thu Aug 21, 2003 6:44 pm

im assuming its

#define MASTERNAME <name of master> //edit this

but I also tweaked with the spells it calls forth, only changed divine light to supernal remedy

EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Thu Aug 21, 2003 9:46 pm

dawnoffatex wrote: #define MASTERNAME <name of master> //edit this
lets assume your character's ,which you will be controlling the bot with, name is Smurf then the line shoud be

Code: Select all

#define MASTERNAME Smurf
you must delete the non valid comment

Code: Select all

//edit this
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

dawnoffatex
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sun Aug 10, 2003 8:24 pm

Post by dawnoffatex » Thu Aug 21, 2003 10:28 pm

hmmm, yea i did that, and it still stays inactive, let me double test right now, will report back in a min

dawnoffatex
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sun Aug 10, 2003 8:24 pm

Post by dawnoffatex » Thu Aug 21, 2003 10:37 pm

This is what it looks like right now

Code: Select all

//Stuff added to give credit where it is due. Yay Plazmic and your macro 

#turbo 
#chat tell 

#event CantSee "You cannot see your target" 
#event HitsYou "s YOU for " 
#event HitsYou " YOU, but misses." 
#event Fizzle "Your spell fizzles!" 
#event Fizzle "You haven't recovered yet..." 
#event Fizzle "Spell recovery time not yet met." 
#event Fizzle "Your spell is interrupted." 

#define MANABUFFER 30 

#define MASTERNAME Blueballs~

#define CASTTIMER t0 
#define CASTNEXTTIMER t1 
#define NEXTOUCHTIMER t2 
#define NEXTHOTTIMER t3 
#define MANATIMER t4 

#define OKTOCAST v80 
#define FIZZLECHECK v82 

#define HOTSPELL v74 
#define HOTHP v75 
#define HOTDUR v76 
#define HEALHP v77 
#define HEALSPELL v78 

Sub Main 
   /varset v99 0 
   /varset OKTOCAST 1 
   /varset v0 0 
   /varset MANATIMER 1 
   :Loop 
      /doevents 
      /if n $char(ability,"sense heading")>0 /doability "sense heading" 

      /if n $OKTOCAST==0 /goto :SkipHealing 
      /varset l6 $group(lowhp) 
      /varset l7 $spawn($l6,hp,pct) 
      /varset l8 $spawn($l6,class) 
      /varset l9 0 
      
      /if n $l7>60 /goto :SkipHealing 
      /if n $l7<40 /varset l9 3 

      /if "$l8"=="Enchanter" /if n $l7<50 /varset l9 1 
      /if "$l8"=="Wizard" /if n $l7<50 /varset l9 1 
      /if "$l8"=="Magician" /if n $l7<50 /varset l9 1 
      /if "$l8"=="Necromancer" /if n $l7<50 /varset l9 1 

      /if "$l8"=="Cleric" /if n $l7<60 /varset l9 2 
      /if "$l8"=="Druid" /if n $l7<60 /varset l9 2 
      /if "$l8"=="Shaman" /if n $l7<60 /varset l9 2 

      /if "$l8"=="Cleric" /if n $l7<30 /varset l9 1 
      /if "$l8"=="Druid" /if n $l7<30 /varset l9 1 
      /if "$l8"=="Shaman" /if n $l7<30 /varset l9 1 

      /if n $l9==3 /if n $char(mana,cur)<$int($spell("Complete Healing",mana)+MANABUFFER) /varset l9 1 
      /if n $l9==1 /if n $char(mana,cur)<$int($spell("Supernal Remedy",mana)+MANABUFFER) /varset l9 2 
      /if n $l9==2 /if n $char(mana,cur)<$int($spell("Celestial Healing",mana)+MANABUFFER) /varset l9 0 

      /if n $l9==3 /call CastSpell $l6 "Complete Healing" 
      /if n $l9==2 /call CastSpell $l6 "Celestial Healing" 
      /if n $l9==1 /call CastSpell $l6 "Supernal Remedy" 
      /if n $l9==2 /if n $OKTOCAST==0 /varset NEXTHOTTIMER 18s 
      :SkipHealing 

      /doevents 
      /if n $char(hp,pct)<10 /call GetOutOfDodge 
   /goto :Loop 
/return 

Sub Event_Chat 
   /if "$p0"!="MASTERNAME" /return 
   /if "$p2"~~"sit" /call Do_Sit $p0 
   /if "$p2"~~"come" /call Do_Come $p0 
   /if "$p2"~~"gate" /call Do_Gate $p0 
   /if "$p2"~~"mana" /tell $p0 $char(mana,pct)m ($char(mana,cur)/$char(mana,max)) 
   /if "$p2"~~"help" /tell $p0 Help: sit, come, gate, mana 
/return 

Sub Do_Sit 
  /if $char(state)==STAND { 
     /tell $p0 Sitting down 
     /sit 
  } 
/return 

Sub Do_Come 
   /target $p0 
   /if $target(type)!=PC /return 
   /tell $p0 Coming to you 
   /gotoxy target 
   /face fast heading $target(heading) 
   /if $char(state)==STAND /sit 
/return 

Sub Do_Gate 
   /tell $p0 Gating 
   /gate 
/return 

Sub GetOutOfDodge 
   /gate 
   /delay 30s 
   /sit 
   /delay 2s 
   /camp 
/endmacro 

Sub Event_Timer 
   /if t$p0==CASTNEXTTIMER /varset OKTOCAST 1 
  /if t$p0==MANATIMER { 
     /gsay $char(mana,pct)m 
     /varset MANATIMER 3m 
  } 
/return 

Sub ClearBadTargets 
   /if $target(type)==CORPSE /target clear 
   /for l0 0 to 5 
      /if n $target(id)==$group($l0) /target clear 
   /next l0 
/return 

Sub Event_HitsYou 
   /if n $char(hp,pct)<10 /call GetOutOfDodge 
   /if n $NEXTOUCHTIMER>0 /return 
   /varset NEXTOUCHTIMER 12s 
   /tell MASTERNAME Ouch, I'm getting whacked by $target(name,clean)! 
   /target clear 
/return 

Sub Event_Fizzle 
   /varset FIZZLECHECK 1 
/return 

Sub CastSpell 
   | $p0: id to cast on 
   | $p1: spell to cast 

   | $l0: Was sitting? 
   | $l1: Real target 
   /if $char(state)==STUN /return 
   /varset l0 0 
   /varset l1 $target(id) 
   /varset l2 0 
   :DoCast 
   /varset OKTOCAST 1 
   /if n $char(mana,cur)<$int($spell("$p1",mana)+MANABUFFER) /goto :Exit 
   /if n $l2==0 /gsay Casting $p1 on << $spawn($p0,name,clean) >> 
   /varset l2 1 
   /sendkey up up 
   /sendkey up down 
   /varset OKTOCAST 0 
   /varset FIZZLECHECK 0 
   /target id $p0 
   /if $char(state)==SIT /varset l0 1 
   /if n $l0==1 /stand 
   /cast "$p1" 
   /varset CASTTIMER $int($spell("$p1",casttime)*10+5) 
   /if n $l1!=0 /target id $l1 
   /if n $l1==0 /target clear 
   /if $target()==TRUE /call ClearBadTargets 
   /varset l1 $target(id) 
   :WaitCast 
      /doevents 
   /if n $FIZZLECHECK==0 /if n $CASTTIMER>0 /goto :WaitCast 
   /if n $FIZZLECHECK==0 /goto :Exit 
   /delay 1 
   /goto :DoCast 
    
   :Exit 
   /if n $l1==0 /target clear 
   /if n $l1!=0 /call ClearBadTargets 
   /if n $l0==1 /sit 
   /varset CASTNEXTTIMER $int($spell("$p1",recasttime)*10+5) 
/return 
Exactly the same, only it has the modified MASTER, it still remains inactive, only reporting mana every once in awhile, while grouped with its "master" despite master dropping below 50,40,30, and even 20 life

Edit: Valerian likes code brackets.
Last edited by dawnoffatex on Thu Aug 21, 2003 11:52 pm, edited 1 time in total.

User avatar
Slice
a hill giant
a hill giant
Posts: 189
Joined: Wed Oct 30, 2002 2:52 pm

Post by Slice » Thu Aug 21, 2003 11:26 pm

If that is your real characters name in the script, edit it out with a fake name.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Thu Aug 21, 2003 11:48 pm

This might help but I am not sure...

For /if statements using

Code: Select all

 /if "$l8"=="Enchanter" /if n $l7<50 /varset l9 1
sometimes doesn;t work for me for whatever reason.

Whenever I need to use something like this I always nest them:

Code: Select all

/if "$l8"=="Enchanter" {
   /if n $l7<50
      /varset l9 1
   }
}
Not saying it will work 100% but it helps on some of my macro's sometimes.

*** Deleted the rest, obviously I am mis-informed.

I've never used a define involving a specified value like that before. It feels strange to use define in a comparison without the $ in front.

I'm going to expeeriment with that a bit so I don't talk gibberish the next time I see something like that.

What about the timers? if you have #define ThisTimer t1 would you need to use $ThisTimer for comparisons?
Last edited by wassup on Fri Aug 22, 2003 5:19 am, edited 3 times in total.

dawnoffatex
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sun Aug 10, 2003 8:24 pm

Post by dawnoffatex » Thu Aug 21, 2003 11:51 pm

not my real chars name, and wtf did you just post above me lol

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Post by wassup » Fri Aug 22, 2003 12:00 am

** Edited out, I was confused
Last edited by wassup on Fri Aug 22, 2003 4:39 pm, edited 1 time in total.

dawnoffatex
a lesser mummy
a lesser mummy
Posts: 41
Joined: Sun Aug 10, 2003 8:24 pm

Post by dawnoffatex » Fri Aug 22, 2003 12:28 am

so then your saying the initial code itself is flawed? In which case, it needs to be re-written in accordance with what you posted above, which then dictates that i didnt screw anything up, i was just using something warped? And if all these are true, someone care to edit it? :)