Can someone help "debug" this clericbot script?

Help section 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

Can someone help "debug" this clericbot script?

Post by Draekz » Mon Sep 30, 2002 2:55 pm

Code: Select all

| - clericAH.mac - 
| By powerspike 
| Basic group auto heal script 
|edited by Draekz
#include spellsub.mac 

Sub Main 
   /press ESC 
   /press F1 
   /if "$target()"=="TRUE" /varset v7 0 
   /press ESC 
   /press F2 
   /if "$target()"=="TRUE" /varset v7 1 
   /press ESC 
   /press F3 
   /if "$target()"=="TRUE" /varset v7 2 
   /press ESC 
   /press F4 
   /if "$target()"=="TRUE" /varset v7 3 
   /press ESC 
   /press F5 
   /if "$target()"=="TRUE" /varset v7 4 
   /press ESC 
   /press F6 
   /if "$target()"=="TRUE" /varset v7 5 
   /press ESC 
   :LoopStart 

      /delay 1 
         |/echo $v7 -- 
         /for v40 0 to $v7 
            /delay 5 
            /if n $v40==0 /press F1 
            /if n $v40==1 /press F2 
            /if n $v40==2 /press F3 
            /if n $v40==3 /press F4 
            /if n $v40==4 /press F5 
            /if n $v40==5 /press F6 
            /varset v59 $target(hp,pct) 
            | the if statement checks to see if HP are under 50% on the target if so stand heal and sit 
               /if n $v59<=48 { /goto :Heal

                     } else /if n $v59>=90 { 
               /delay 0             
            } 
         /next v40 
   /goto :LoopStart 
   /return 
               
             :Heal
             /if n $target(class)=="Enchanter"  /goto :Casters
             /if n $target(class)=="Magician"   /goto :Casters
             /if n $target(class)=="Wizard"      /goto :Casters
            /if n $target(class)=="Druid"         /goto :Casters
            /if n $target(class)=="Shaman"    /goto :Casters
            /if n $target(class)=="Cleric"         /goto :Casters

           /else if n $target(class)=="Monk", "Warrior", "Shadow Knight", "Paladin" /goto :CHeal

/return

            :Casters
             /delay 5
             /sit off
             /gsay SHealing $target(name)
            /cast "Superior Heal"
            /delay 5
            /sit on

/next v40
/goto :LoopStart
/return
            
              
                :CHeal
                /delay 5
                /sit off 
               /gsay Complete Healing $target(name) 
           |THis casts Complete Heal 
               /cast "Complete Heal"
             |This is Delay between beginning the CHeal cast and the time when it sits down
               /delay 10 
               /sit on

/next v40
/goto :LoopStart
/return 

I havent tested it with the "$target(class)" thing yet and wondered if anyone who already knew a lot about scripting these macros, could tell me an easier way to do it? or if thats even right (and will work).

Any help would be appreciated :) Just starting to try and get a grip on this scripting stuff.

This script originally used spellsub.mac, but i didnt see much sense in using it (mebbe you can point out why i should use it with an example :))

Anyway, Thanks for any help! Its much appreciated!

Draekz

S_B_R
a lesser mummy
a lesser mummy
Posts: 72
Joined: Tue Jul 30, 2002 11:12 am

Post by S_B_R » Mon Sep 30, 2002 4:50 pm

Well first thing I notice is when you use the /delay command you need to realize that /delay is measured in 10ths of a second. so you either need to multiply all your /delay's by 10 or add an "s" after the number, for example

Code: Select all

/delay 10s
Also your /if statements don't need the "n" and this line:

Code: Select all

/else if n $target(class)=="Monk", "Warrior", "Shadow Knight", "Paladin" /goto :CHeal
won't work.
Last edited by S_B_R on Mon Sep 30, 2002 4:56 pm, edited 2 times in total.
[b]dd if=/dev/zero of=/dev/hda[/b]

S_B_R
a lesser mummy
a lesser mummy
Posts: 72
Joined: Tue Jul 30, 2002 11:12 am

Post by S_B_R » Mon Sep 30, 2002 4:52 pm

oh, also, SpellSub.mac handles fizzles, interupts, and other events that may cause your spell to fail.
[b]dd if=/dev/zero of=/dev/hda[/b]

S_B_R
a lesser mummy
a lesser mummy
Posts: 72
Joined: Tue Jul 30, 2002 11:12 am

Post by S_B_R » Mon Sep 30, 2002 6:04 pm

Code: Select all

:Heal
/if $target(class)=="Enchanter" {
   /goto :Casters
   } else /if $target(class)=="Magician" {
      /goto :Casters
   } else /if $target(class)=="Wizard" {
      /goto :Casters
   } else /if $target(class)=="Druid" {
      /goto :Casters
   } else /if $target(class)=="Shaman" {
      /goto :Casters
   } else /if $target(class)=="Cleric" {
      /goto :Casters
   } else {
      /goto :CHeal 
}
/return
[b]dd if=/dev/zero of=/dev/hda[/b]

User avatar
DeathSpiral
a ghoul
a ghoul
Posts: 95
Joined: Thu Aug 22, 2002 6:31 pm

Post by DeathSpiral » Mon Sep 30, 2002 8:01 pm

More succintly written (now featuring Necromancers too!)...

Code: Select all

:Heal
   /if $target(class)=="Enchanter"   /goto :Casters
   /if $target(class)=="Magician"    /goto :Casters
   /if $target(class)=="Wizard"      /goto :Casters
   /if $target(class)=="Necromancer" /goto :Casters
   /if $target(class)=="Druid"       /goto :Casters
   /if $target(class)=="Shaman"      /goto :Casters
   /if $target(class)=="Cleric"      /goto :Casters
   /goto :CHeal
I am orc pawn, hear me yell for centurians...

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

lol

Post by Draekz » Mon Sep 30, 2002 11:18 pm

haha sorry I even forgot that in mine too :P I knew i was missing something ;) thanks

If anyone has anymore ideas to add to it, please do :) I appreciate the help so far S_B_R..

I didnt think the melee thing i set up would work but wasnt sure :)

Thx again that helps tremendously :)

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

Post by Draekz » Mon Sep 30, 2002 11:59 pm

Oh one more question!

After i finished editing the clericbot macro after the help i recieved..im sure it works, but I was wondering, do I have to call the SubEvent "SpellSub" or is it just automatically activated in the script when one of the spellsub comments are put on the screen? such as "Insufficient Mana".

In other words, will the OOM phrase make spellsub automatically kick in? or do i have to put some sorta call code in my clericbot.mac to make it work?

Thanks :)

Draekz

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

Post by Draekz » Tue Oct 01, 2002 1:10 am

Well! Here is my finished product :)

Thanks to S_B_R for the corrections of course :P I would love to call it my own but quite frankly, it isnt...although the ideas used in this and the fact that i understand how it works should help me get on my feet with macro scripting :P

Anyway, if anyone see's anything wrong with this script, lemme know :P I havent had a chance to test it (well i did..but since i have 3 computers, i forgot to put the altered one onto the computer i was playing eq on and thought it was broken LOL)

But i dont think its broken but i'll leave that up to you :)

In the future i hope to add buffs, where if the gropu member says "Valour down" or whathaveyou, my cleric will pop up if he has more then 60 percent mana and buff him

I think i can do it but will have to scour the forums to see if there is a command to do Mana percentile.

Anyway here's the code

Code: Select all

| - clericAH.mac - 
| By powerspike 
| Basic group auto heal script
| Altered by Draekz 
#include spellsub1.mac 

Sub Main 
   /press ESC 
   /press F1 
   /if "$target()"=="TRUE" /varset v7 0 
   /press ESC 
   /press F2 
   /if "$target()"=="TRUE" /varset v7 1 
   /press ESC 
   /press F3 
   /if "$target()"=="TRUE" /varset v7 2 
   /press ESC 
   /press F4 
   /if "$target()"=="TRUE" /varset v7 3 
   /press ESC 
   /press F5 
   /if "$target()"=="TRUE" /varset v7 4 
   /press ESC 
   /press F6 
   /if "$target()"=="TRUE" /varset v7 5 
   /press ESC 
   

           :LoopStart 

      /delay 1
 
|/echo $v7 -- 

      /for v40 0 to $v7 
        /delay 5 
        /if n $v40==0 /press F1 
        /if n $v40==1 /press F2 
        /if n $v40==2 /press F3 
        /if n $v40==3 /press F4 
        /if n $v40==4 /press F5 
        /if n $v40==5 /press F6 
        /varset v59 $target(hp,pct) 

|the IF statement checks to see if HP are under 50% on the target if so 

stand heal and             |sit 

        /if n $v59<=40 {/goto :Heal}
   else /if n $v59>=90 {/delay 0} 
        
        /next v40 
        /goto :LoopStart 
 
/return 
               
         :Heal 
   
   /if $target(class)=="Enchanter" {/goto :Casters}
       else /if $target(class)=="Magician" {/goto :Casters}
       else /if $target(class)=="Wizard" {/goto :Casters} 
       else /if $target(class)=="Druid" {/goto :Casters} 
       else /if $target(class)=="Shaman" {/goto :Casters} 
       else /if $target(class)=="Cleric" {/goto :Casters}
       else /if $target(class)=="Necromancer" {/goto :Casters}
       else {/goto :CHeal}

/return
           
         :Casters

   /delay 5
   /sit off
   /gsay SHealing $target(name)
   /cast "Superior Healing"
   /delay 5s
   /sit on
   
/return
            
              
         :CHeal
 
   /delay 5
   /sit off 
   /gsay Complete Healing $target(name) 
   /cast "Complete Healing"
   /delay 10s 
   /sit on

/return 

Samefudge
orc pawn
orc pawn
Posts: 20
Joined: Thu Sep 12, 2002 4:41 pm

Post by Samefudge » Tue Oct 01, 2002 9:40 am

This is in several scripts, should give you an idea how to do it.

Code: Select all

Sub Event_MedTime
   /sit
   :GetMana
   /if n $char(mana,pct)<95 /goto :GetMana
   /sit off
/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 » Tue Oct 01, 2002 10:06 am

Oh hey thanks Fudge ;)

Thats great :) I Honestly wouldnt have known what to look for even if i did look at the search page. This makes it a lot easier :) Since the buffs are just based on text outputted by other group members, it shouldnt be difficult to add a buff section to it :)

Much appreciated!

Draekz