Cleric.mac Basic Cleric Macro.

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Cleric.mac Basic Cleric Macro.

Post by grimjack » Tue Jun 03, 2003 9:57 pm

To not offend Dirtface, I used his code for ideas and refrence( spell gems, command names, some variable names and ideas ). This re-write (95 percent new if not more) should be much more manageable than the other mess (spaghetti city) once it's fixed up. I only have a 7th level cleric and I never play him, so bear with the bugs. Post them and I will see what I can do to fix them.

Code: Select all

| Spell gem as follow
| 1 : Superior Heal
| 2 : Celestial Healing
| 3 : Armor of Faith
| 4 : Reso
| 5 : Symbol
| 6 : Instill
| 7 : A dd spell
| 8 : complite Heal 

#turbo 75
#define MasterName v50 
#define CmdArrayNum v51 
#define CmdArraySize v52 
#define GroupMember v53
#define GroupMax v54
#define ChatInput1 v55
#define ChatInput2 v56
#define ChatInput3 v57
#define SitAfterCast v58 
#define MyXLoc v59
#define MyYLoc v60
#include SpellSub.mac 
#chat tell 


Sub Main 
   /varset MasterName $p0
   /varset a(1,0) afk
   /varset a(1,1) accept
   /varset a(1,2) reject
   /varset a(1,3) invite
   /varset a(1,4) hp
   /varset a(1,5) heal
   /varset a(1,6) ch
   /varset a(1,7) ce
   /varset a(1,8) dd
   /varset a(1,9) symbol
   /varset a(1,10) ac
   /varset a(1,11) root
   /varset a(1,12) mana
   /varset a(1,13) follow
   /varset a(1,14) break
   /varset a(1,15) evac
   /varset a(1,16) moveto
   /varset CmdArraySize 17
   /varset CmdArrayNum 0 
   /call CheckArgs $p0
   :MainLoop 
   /call CheckGrpHealth 
   /doevents
   /varset CmdArrayNum 0 
   /goto :MainLoop 
/return 

Sub CheckArgs 
   /if "$MasterName"=="" { 
     /echo Usage: /macro cleric <MasterName> 
     /endmacro 
   } 
/return 

Sub CheckGrpHealth
   /varset GroupMember 0 
   /varcalc GroupMax $group(count)-1 
   :GroupLoop
   /doevents
   /if n $spawn($group($GroupMember),hp,pct)<41 { 
      /if n $spawn($group($GroupMember),hp,pct)>=1 { 
         /if "$spawn($group($GroupMember),class)"=="Warrior" /call Tankheal 
         /if "$spawn($group($GroupMember),class)"=="Paladin" /call Tankheal 
         /if "$spawn($group($GroupMember),class)"=="Shadow Knight" /call Tankheal 
         /if "$spawn($group($GroupMember),class)"=="Monk" /call Tankheal 
         /if "$spawn($group($GroupMember),class)"=="Ranger" /call Tankheal 
       
      } 
   } 
   /if n $spawn($group($GroupMember),hp,pct)>=1 { 
      /if n $spawn($group($GroupMember),hp,pct)<41 { 
         /call CasterHeal 
      } 
   }
   /if n $GroupMember>=$GroupMax /return 
   /varadd GroupMember 1 
   /doevents
   /goto :GroupLoop 
/return 

Sub Tankheal 
         /if n $group($GroupMember)==$char(id) /press F1 
         /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember) 
         /stand 
         /g COMPLETE HEAL on %T in 10seconds 
         /call SpellSub 8 115 
         /if "$SitAfterCast"=="1" /sit on
         /press esc 
/return 

Sub Casterheal 
         /if n $group($GroupMember)==$char(id) /press F1 
         /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember) 
         /stand 
         /g Healing %T 
         /call SpellSub 2 50 
         /if "$SitAfterCast"=="1" /sit on
         /press esc 
/return 


Sub Event_Chat
   /varset ChatInput1 "$p1"
   /varset ChatInput2 "$p2"
   /if "$MasterName"~~"$ChatInput1" {
      :ArrayTime
      /if "$arg(1,"$p2")"=="$a(1,$CmdArrayNum)" {
         /call Do-$a(1,$CmdArrayNum) $ChatInput2
         /return
      }
      /varadd CmdArrayNum 1
      /if n $CmdArrayNum>=$CmdArraySize /return
      /goto :ArrayTime
   }
/return 




Sub Do-afk 
   /afk 
/return 

Sub Do-accept 
   /invite 
/return 

Sub Do-reject 
   /disband 
/return 

Sub Do-invite 
   /invite $MasterName 
/return 



Sub Do-hp 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /tell "$MasterName" HP Buff on %T
   /call SpellSub 4 65
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return 



Sub Do-heal 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /g HP Healing %T
   /call SpellSub 1 50
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return 



Sub Do-ch 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /g Complete Heal on %T. 10 Seconds.
   /call SpellSub 8 105
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return 



Sub Do-ce 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /g Celestial Healing %T
   /call SpellSub 2 45
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return 

Sub Do-dd 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /tell "$MasterName" Casting DD on %T
   /call SpellSub 2 45
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return 

Sub Do-symbol 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /g Casting Symbol on %T
   /call SpellSub 5 55
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return 


Sub Do-ac 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /tell Casting AC Buff on %T
   /call SpellSub 3 85
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return  


Sub Do-root 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   /stand
   /g Rooting %T
   /call SpellSub 6 40
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return  

Sub Do-mana 
   /dismount 
   /press F1 
   /g "$char(mana,pct)"m 
   /press esc 
   /press esc 
   /sit on 
/return 

Sub Do-follow 
   /target $MasterName
   /face 
   /follow 
/return 

Sub Do-break
   /press right
/return

Sub Do-moveto 
   /sit off
   /varset countdown 0 
   /varset MyXLoc $char(x) 
   /varset MyYLoc $char(y) 
   /if n $strlen("$arg(1,"$p1"))>0 {
      /if "$arg(1,"$p1")"=="$char(name)" {
         /press F1
      }else{
         /target $arg(1,"$p1")
      }
   }
   /if n "$strlen("$arg(1,"$p1"))"<="0" { 
      /assist $MasterName
      /delay 3
   }
   :gotopointloop 
   /if $target()==FALSE { 
      /sendkey up up
      /return
   } 
   /face fast
   /if n $target(distance)>15 /sendkey down up
   /if n $target(distance)<=15 {
      /sendkey up up
      /return
   }
   /face fast
   /if n $countdown>=3 { 
      /call Detectobst 
      /varset countdown 0 
   }
   /varadd countdown 1 
   /goto :gotopointloop 
   }
   /sendkey up up 
   /face
/return 

Sub Detectobst 
   /if n $MyXLoc==$char(x) /if $MyYLoc==$char(y) /call Hitobst 5 
   /varset MyXLoc $char(x) 
   /varset MyYLoc $char(y) 
/return 


sub Hitobst 
   /sendkey up up 
   /sendkey down down  
   /if n $rand(99)>50 { 

      /delay 2s
      /sendkey up down
      /sendkey down Right 
      /delay $p0  
      /sendkey up Right 
      /sendkey down up 
      /delay 2 
      /sendkey up up 
   } else { 
      /delay 2
      /sendkey up down
      /sendkey down left 
      /delay $p0  
      /sendkey up left 
      /sendkey down up 
      /delay 2s 
      /sendkey up up       
   } 
   /sendkey up down 
   /sendkey up Right 
   /sendkey up Left 
   /sendkey down up 
/return 

Sub Do-evac
   /call Do-moveto evac $MasterName
   || move to master for evac
/return 
Last edited by grimjack on Fri Jun 06, 2003 2:48 pm, edited 18 times in total.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Tue Jun 03, 2003 11:12 pm

wtb druid version of this ....lvl 65ish ...thx kk la~


..hehe

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Tue Jun 03, 2003 11:21 pm

Moved to other thread.
Last edited by grimjack on Thu Jun 05, 2003 11:02 am, edited 1 time in total.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Thu Jun 05, 2003 12:15 am

Ok...first, I'm not terribly good at macro scripting, but I took what was given in this thread and adjusted it (at least I hope I did) to work with druid.

HOWEVER, I am getting some really funky error messages. Essentially, I'm getting a message on all /varset and /varadd calls (ie, I'm getting a syntax error on all /varset and /varadd calls).

For example, if I try just typing /macro druid ...I get this:

Code: Select all

Usage: /varset <v#|p#|#|t#|a(#,#)> <value>
[MacroQuest] Usage:  /macro Druid.mac <v10>
...the current macro has ended...blah blah

And, this is what I'm using :)

Code: Select all

| Spell gem as follow 
| 1 : Cheal
| 2 : Nuke
| 3 : QHeal
| 4 : Snare
| 5 : Pot9
| 6 : Regen
| 7 : DS
| 8 : Root


#define $GroupClass $spawn($group($GroupMember),class) 
#define MasterName v10 
#define CmdArrayNum v11 
#define CmdArraySize v12 
#define GroupMember v13 
#define GroupMax v14 
#define ChatInput1 v15 
#define ChatInput2 v16 
#define ChatInput3 v17 

#include SpellSub.mac 
#chat tell 


Sub Main 
   /varset MasterName $p0 
   /varset a(1,0) afk 
   /varset a(1,1) accept 
   /varset a(1,2) reject 
   /varset a(1,3) invite 
   /varset a(1,4) hp 
   /varset a(1,5) heal 
   /varset a(1,6) ch 
   /varset a(1,7) snare 
   /varset a(1,8) nuke
   /varset a(1,9) ds 
   /varset a(1,10) regen 
   /varset a(1,11) root 
   /varset a(1,12) mana 
   /varset a(1,13) follow 
   /varset a(1,14) sit
   /varset a(1,15) stand
   /varset a(1,16) invis
   /varset CmdArraySize 17
   /varset CmdArrayNum 0 
   /call CheckArgs $p0 
   :MainLoop 
   /call CheckGrpHealth 
   /doevents 
   /varset CmdArrayNum 0 
   /goto :MainLoop 
/return 

Sub CheckArgs 
   /if "$MasterName"=="" { 
     /echo Usage: /macro Druid.mac <MasterName> 
     /endmacro 
   } 
/return 

Sub CheckGrpHealth 
   /varset GroupMember 0 
   /varcalc GroupMax $group(count)-1 
   :GroupLoop 
   /if n $spawn($group($GroupMember),hp,pct)<41 { 
      /if n $spawn($group($GroupMember),hp,pct)!<1 { 
         /if "$GroupClass"=="Warrior" /call Tankheal 
         /if "$GroupClass"=="Paladin" /call Tankheal 
         /if "$GroupClass"=="Shadow Knight" /call Tankheal 
         /if "$GroupClass"=="Monk" /call Tankheal 
         /if "$GroupClass"=="Ranger" /call Tankheal 
        
      } 
   } 
   /if n $spawn($group($GroupMember),hp,pct)<41 { 
      /call CasterHeal 
   } 
   /if n $GroupMember>=$GroupMax /return 
   /varadd $GroupMember 1 
   /goto :GroupLoop 
/return 

Sub Tankheal 
         /if n $group($GroupMember)==$char(id) /press F1 
         /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember) 
         /stand 
         /g CHeal on %T in 10 seconds! 
         /call SpellSub 1 115 
         |/sit 
         /press esc 
/return 

Sub Casterheal 
         /if n $group($GroupMember)==$char(id) /press F1 
         /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember) 
         /stand 
         /g Healing %T
         /call SpellSub 3 50 
         |/sit 
         /press esc 
/return 


Sub Event_Chat 
   /varset ChatInput1 "$p1" 
   /varset ChatInput2 "$p2" 
   /if "$MasterName"~~"$ChatInput1" { 
      :ArrayTime 
      /if "$ChatInput2"~~"$a(1,$CmdArrayNum)" { 
         /call Do-$a(1,$CmdArrayNum) $ChatInput2 
         /return 
      } 
      /varadd CmdArrayNum 1 
      /if n $CmdArrayNum>=$CmdArraySize /return 
      /goto :ArrayTime 
   } 
/return 




Sub Do-afk 
   /afk 
/return 

Sub Do-accept 
   /invite 
/return 

Sub Do-reject 
   /disband 
/return 

Sub Do-invite 
   /invite $MasterName 
/return 



Sub Do-hp 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName" 
   /stand 
   /tell "$MasterName" Casting Pot9 on %T 
   /call SpellSub 5 65 
   |/sit 
   /press esc 
/return 



Sub Do-heal 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName" 
   /stand 
   /g Healing %T 
   /call SpellSub 3 50 
   |/sit 
   /press esc 
/return 



Sub Do-ch 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName"  
   /stand 
   /g Druid CHeal on %T in 10 seconds! 
   /call SpellSub 1 105 
   |/sit 
   /press esc 
/return 



Sub Do-snare 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName"  
   /stand 
   /tell "$MasterName" Casting Snare on ~ %T ~
   /call SpellSub 4 45 
   |/sit 
   /press esc 
/return 

Sub Do-nuke 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName"  
   /stand 
   /tell "$MasterName" Nuking %t 
   /call SpellSub 2 65 
   |/sit 
   /press esc 
/return 

Sub Do-ds 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName" 
   /stand 
   /tell "$MasterName" Damage Shield to ~ %T ~
   /call SpellSub 7 55 
   |/sit 
   /press esc 
/return 



Sub Do-regen 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName" 
   /stand 
   /tell "$MasterName" Regen to ~ %T ~
   /call SpellSub 6 85 
   |/sit 
   /press esc 
/return  


Sub Do-root 
   /if "$p1"!="" { 
      /if "$p1"=="$char(name)" { 
         /press F1 
      }else{ 
         /target $p1 
      } 
   } 
   /if "$p1"=="" /assist "$MasterName" 
   /stand 
   /tell "$MasterName" Rooting ~ %T ~
   /call SpellSub 8 40 
   |/sit 
   /press esc 
/return  

Sub Do-mana 
   /dismount 
   /press F1 
   /tell "$MasterName" "$char(mana,pct)"m
   /press esc 
   /press esc 
   |/sit on 
/return 

Sub Do-follow 
   /sit off
   /target $p1 
   /face 
   /follow 
/return 

Sub Do-sit 
   /sit on
/return 

Sub Do-stand 
   /sit off
/return 

Sub Do-invis
   /sit off
   /alt act 80
/return 

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

/varset and /varadd.

Post by grimjack » Thu Jun 05, 2003 2:52 am

Moved to other thread
Last edited by grimjack on Thu Jun 05, 2003 11:03 am, edited 6 times in total.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Thu Jun 05, 2003 3:12 am

Moved to other thread
Last edited by grimjack on Thu Jun 05, 2003 11:03 am, edited 1 time in total.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Thu Jun 05, 2003 4:00 am

Well..that wasn't hte only error I got ..when I used it correctly (ie, /macro druid.mac whomever'. Then, it would start up fine...but, whenver I'd try to use a command ....it would issue the command, but then spam me with the syntax of /varadd this time ...just boom, boom, boom ...endless spam of that syntax error until I /endmacro.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Thu Jun 05, 2003 4:08 am

Moved to other thread.
Last edited by grimjack on Thu Jun 05, 2003 11:03 am, edited 1 time in total.

Amadeus
The Maestro
The Maestro
Posts: 2036
Joined: Sat Jun 29, 2002 3:51 pm

Post by Amadeus » Thu Jun 05, 2003 5:17 am

This looks superb :) ..I'll have to try it tomorrow. I spent tonight looking at the changes (MQ-wise) on the test server.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

New thread

Post by grimjack » Thu Jun 05, 2003 7:22 am

Moved to other thread.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update

Post by grimjack » Thu Jun 05, 2003 2:54 pm

Updated code.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Update

Post by grimjack » Thu Jun 05, 2003 4:40 pm

Another minor update.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Jun 06, 2003 8:30 am

Hey Grim, instead of a new post for every update just edit the original. Then at the bottom put an edit log:

EDIT Fixed casting CH on mob; they liked it, my party didn't.

And so on.
MQ2: Think of it as Evolution in action.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Fri Jun 06, 2003 9:49 am

Mckorr wrote:Hey Grim, instead of a new post for every update just edit the original. Then at the bottom put an edit log:

EDIT Fixed casting CH on mob; they liked it, my party didn't.

And so on.
No problem at all. I had thought people would want to see when the code was updated. I did not think of how annoying it would be to people who don't use the script.

Thanks
GrimJack

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Fri Jun 06, 2003 9:54 am

Not annoying as such, but makes it a lot easier to see the changes without having to scroll down a bunch, find out you did a minor change, then scroll back up to copy and paste the script. Keep going the way you are and you'll have 8 pages of basically empty posts.

Also makes it easier for you to find new questions about your script, since that will be the last post and it won't be a mile down on the list.
MQ2: Think of it as Evolution in action.