Page 1 of 4

Shaman Bodyguard

Posted: Wed Nov 22, 2006 2:08 am
by xnad
I am currently working on a shaman robot who act like my puppy that will keep following me, heal me and buff me ( upon request ). The macro is briefly done but it not seems to be efficiency as I donno how to handle the spell cast as my shaman may keep moving to follow the plee, is anyone have a better idea on this?

I will keep maintain this macro till everyone who have a shaman happy :)

Code: Select all

|----------------------------------------------------------------------------------------
| Shaman Bodyguard 0.1
|
| Created by the God of Cat
|
| Usage : 	/mac bodyguard <plee> <percentage to heal>
| Example : 	/mac bodyguard Gimp 50
|
|		Spell Recommendation :
|
|		Gem 1 "Duration Heal" 
|		Gem 2 "Instant Heal" 
|		Gem 3 "Focus"
|		Gem 4 "Sta"
|		Gem 5 "Panther"
|		Gem 6 "Haste"
|		Gem 7 "Gate"
|		Gem 8 "Canni"
|		Gem 9 "Whatever" 	 
|
| If you have any good idea, please do not hesitate to drop me a mail or tell in game
|----------------------------------------------------------------------------------------

#turbo 40 
#include spellcast.inc
#chat tell

|----------------------------------------------------------------------------------------
| Main Loop
|----------------------------------------------------------------------------------------

Sub Main

| Variable declaration
   /declare plee 	string outer ${Param0}
   /declare healhps 	int outer ${Param1}
   /declare assist	bool outer TRUE
   /declare follow	bool outer TRUE
   /declare mobid 	int outer
   /declare incoming 	string outer Attacking

| Spell declaration
   /declare healspell 	string outer Yoppa's Mending
   /declare hotspell	string outer Spiritual Sereity
   /declare cannispell	string outer Pained Memory
   /declare focusspell 	string outer Talisman of Wunshi
   /declare hastespell	string outer Talisman of Celerity

| Marco Syntax Check
   /if (!${Defined[Param0]}) {
      /echo You didn't name your PL'ee
      /echo Usage: /mac bodyguard <plee> <percentage to heal>
      /echo Ex: /mac bodyguard gimp 50
      /endmacro
   }

   /if (!${Defined[Param1]}) {
      /echo You didn't define when to heal
      /echo Usage: /mac bodyguard <plee> <percentage to heal>
      /echo Ex: /mac bodyguard gimp 50
      /endmacro
   }
  
| Main Loop
:mainloop
   /call movement
   /call check
   /call combat
   /call remote
   /doevents
/goto :mainloop

|----------------------------------------------------------------------------------------
| Movement Control
| 
| Shaman will stay with 200 range of plee where most spell can land within this range
|----------------------------------------------------------------------------------------

sub movement

:movement
   /target ${plee}
   /if (${Target.ID} && ${Target.Distance}>=200 && $(follow)) {
      /target ${plee}
      /follow
      /delay 5s
      /keypress left
      /keypress right
      /goto :movement
   }   
   /doevents

/return
   
|----------------------------------------------------------------------------------------
| Various Checking
|
| 1) Mana and Health
| 2) Buff
|----------------------------------------------------------------------------------------

sub check
   :check
      /call canni
      /call heal1
      /call heal2
      /call pleedead
   /goto :check
/return

   sub canni
      /if (${Me.PctHPs}>50 && ${Me.PctMana}<50) {
      /call cast "${cannispell}" gem8 nodismount
      } else {
      /gsay Low on Mana and no guts to Eat myself... Let me med some
      }
   /return
   
   sub heal1
   :hotplee
      /target ${plee}
      /if (${Target.ID} && ${Target.PctHPs}<90 && ${Target.Distance}<=100) {
         /target ${plee}
         /gsay HoT on %T
         /call cast "${hotspell}" gem1 nodismount
         /goto :hotplee
      }
   /doevents
   /return  
   
   sub heal2
   :healplee
      /target ${plee}
      /if (${Target.ID} && ${Target.PctHPs}<${healhps} && ${Target.Distance}<=100) {
         /target ${plee}
         /gsay Healing %T
         /call cast "${healspell}" gem2 nodismount
         /goto :healplee
      }
   }
   /doevents
   /return 

   sub pleedead
   :pleedead
      /target ${plee}
      /if (${Target.ID} && ${Target.PctHPs}=0) {
         /gsay Fuck why die??!
         /delay 1s
         /gsay Now tell me I should flee or what..?
         /goto :pleedead
      }
   /doevents
   /return  
   
|----------------------------------------------------------------------------------------
| Remote control module
|
| Shaman will follow the order made by Plee by tell
|
| Command List :
|
| Assist off -	Stop slow the mob even with attack sign and hold pet
| Assist on -	Start slow the mob on attack sign and send pet ( Default )
| Camp - 	Camp immediately
| Focus - 	Cast HP Buff on plee
| Follow - 	Start following plee ( Default )
| Gate -	Gate back to bind point
| Haste -	Cast Haste on plee
| Help -	Display list of command available
| Stay -	Stop following plee
| 
|----------------------------------------------------------------------------------------

sub remote
   /if (!${ChatType.Equal[TELL] && ${ChatSender.Equal[${plee}]}]}) /return
   /call command
   }
/return

sub command

   /if (${ChatText.Equal[Assist off]}) {
   /varset assist FALSE
   /pet back
   /delay 1s
   /pet hold
   /return
   }

   /if (${ChatText.Equal[Assist on]}) {
   /varset assist TRUE
   /return
   }

   /if (${ChatText.Equal[Camp]}) {
   /gsay Camping now, protect me for 30second or HGC!
   /camp
   /endmacro
   /return
   }

   /if (${ChatText.Equal[Focus]}) {
   /target ${plee}
   /call cast "${focusspell}" gem3 nodismount
   /return
   }

   /if (${ChatText.Equal[Follow]}) {
   /varset follow TRUE
   /return
   }
  
   /if (${ChatText.Equal[Gate]}) {
   /call cast "gate" gem7 nodismount
   /endmacro
   /return
   }   
   
   /if (${ChatText.Equal[Haste]}) {
   /target ${plee}
   /call cast "${hastespell}" gem4 nodismount
   /return
   }   

   /if (${ChatText.Equal[Help]}) {
   /reply Here is the list of command available :
   /delay 1s
   /reply Assist on, Assist off, Camp, Focus, Follow, Gate, Haste, Help, Stay
   /return
   }   

   /if (${ChatText.Equal[Stay]}) {
   /varet follow FALSE
   /return
   }   

/return

|----------------------------------------------------------------------------------------
| Combat Module
|
| If you do not have slow stick clicky, change it to use spell instead
| If you do not want to summon pet, comment out the /pet command
|----------------------------------------------------------------------------------------

sub combat
   :slow
   /if (${ChatText.Equal[${incoming}]} && ${assist}) {
      /assist ${plee}
      /delay 1s
      /target ID ${mobid}
      /if (${Target.ID} && ${Target.PctHPs}<99 && ${Target.Distance}<200) {
         /target ID ${mobid}
         /echo Casting Slow and sending pet
	 /pet attack
         /itemnotify mainhand rightmouseup
         /doevents
         /goto :slow
      }   
   }
   /doevents
   /return
/return

/return

Posted: Fri Nov 24, 2006 9:39 pm
by xnad
Made some modification, now should work properly, but now it will spam cast HoT unless the hp passed certain amount, any possible way to check if HoT is casted and still effiective?

Code: Select all

|---------------------------------------------------------------------------------------- 
| Shaman Bodyguard 1.0 
| 
| Created by the God of Cat 
| 
| Usage :    /mac bodyguard <plee> <percentage> 
| Example :    /mac bodyguard Gimp 50 
| 
|      Spell Recommendation : 
| 
|      Gem 1 "Duration Heal" 
|      Gem 2 "Instant Heal" 
|      Gem 3 "Focus" 
|      Gem 4 "Sta" 
|      Gem 5 "Panther" 
|      Gem 6 "Haste" 
|      Gem 7 "Gate" 
|      Gem 8 "Canni" 
|      Gem 9 "Whatever"     
| 
| If you have any good idea, please do not hesitate to drop me a mail or tell in game 
|---------------------------------------------------------------------------------------- 

#turbo 40 
#include spellcast.inc 
#chat tell 
#chat group 

|---------------------------------------------------------------------------------------- 
| Main Loop 
|---------------------------------------------------------------------------------------- 

Sub Main 

| Variable declaration 
   /declare plee    string outer ${Param0} 
   /declare healhps    int outer ${Param1} 
   /declare follow   bool outer TRUE 
   /declare incoming    string outer Incoming 

| Spell declaration 
   /declare healspell    string outer Yoppa's Mending 
   /declare hotspell   string outer Spiritual Serenity 
   /declare cannispell   string outer Pained Memory 
   /declare focusspell    string outer Talisman of Wunshi 
   /declare hastespell   string outer Talisman of Celerity 
   /declare mightspell   string outer Talisman of Might 
   /declare sensespell   string outer Talisman of Sense 
   /declare staspell   string outer Talisman of Fortitude 
   /declare sowspell   string outer Spirit of Bih`Li 

| Marco Syntax Check 
   /if (!${Defined[Param0]}) { 
      /echo You didn't name your PL'ee 
      /echo Usage: /mac bodyguard <plee> <percentage> 
      /echo Ex: /mac bodyguard gimp 50 
      /endmacro 
   } 

   /if (!${Defined[Param1]}) { 
      /echo You didn't define when to heal 
      /echo Usage: /mac bodyguard <plee> <percentage> 
      /echo Ex: /mac bodyguard gimp 50 
      /endmacro 
   } 
  
| Main Loop 
/echo Macro Started 
:mainloop 
   /call movement 
   /call check 
/goto :mainloop 

|---------------------------------------------------------------------------------------- 
| Movement Control 
| 
| Shaman will stay with 200 range of plee where most spell can land within this range 
|---------------------------------------------------------------------------------------- 

sub movement 

:movement 
   /target ${plee} 
   /if (${Target.Distance}>200 && ${follow}) /stick 10 
   /delay 10s 
   /stick off 
/return 
    
|---------------------------------------------------------------------------------------- 
| Various Checking 
| 
| 1) Mana and Health 
| 2) Buff 
|---------------------------------------------------------------------------------------- 

sub check 
      /doevents 
      /call canni 
      /call heal1 
      /call heal2 
      /call pleedead 
      /doevents 
/return 

   sub canni 
      /if (${Me.PctHPs}>50 && ${Me.PctMana}<50) { 
      /call cast "${cannispell}" gem8 nodismount 
      } 
   /return 
    
   sub heal1 
      /target ${plee} 
      /if (${Target.PctHPs}<90>70 && ${Target.Distance}<=100) { 
         /gsay HoT on %T 
         /call cast "${hotspell}" gem1 nodismount 
      } 
   /return  
    
   sub heal2 
      /target ${plee} 
      /if (${Target.PctHPs}<${healhps} && ${Target.Distance}<=100) { 
         /gsay Healing %T 
         /call cast "${healspell}" gem2 nodismount 
      } 
   } 
   /return 

   sub pleedead 
      /target ${plee} 
      /if (${Target.PctHPs}==0) { 
         /gsay Fuck why die??! 
         /delay 1s 
         /gsay Now tell me I should flee or what..? 
      } 
   /return  
    
|---------------------------------------------------------------------------------------- 
| Remote control module 
| 
| Shaman will follow the order made by Plee by tell 
| 
| Command List : 
| 
| Back -   Back Pet 
| Camp -    Camp immediately 
| Focus -    Cast HP Buff on plee 
| Follow -    Start following plee ( Default ) 
| Gate -   Gate back to bind point 
| Haste -   Cast Haste on plee 
| Help -   Display list of command available 
| Might -   Cast Talisman of Might 
| Sense -   Cast Talisman of Sense 
| SoW -   Cast Spirit of Bih`Li 
| Stamina -Cast Talisman of Fortitude 
| Stay -   Stop following plee 
| 
|---------------------------------------------------------------------------------------- 

Sub Event_Chat(string ChatType,string ChatSender,string ChatText) 

   /if (${ChatText.Equal[${incoming}]}) { 
   /assist ${plee} 
   /delay 3s 
   /echo Casting Slow and sending pet 
   /pet attack 
   /delay 3s 
   /itemnotify mainhand rightmouseup 
   /delay 5s 
   /target ${plee} 
   /return 
   } 

   /if (${ChatText.Equal[SoW]}) { 
   /target ${plee} 
   /call cast "${sowspell}" gem7 nodismount 
   /return 
   }    

   /if (${ChatText.Equal[Stamina]}) { 
   /target ${plee} 
   /call cast "${staspell}" gem6 nodismount 
   /return 
   }    

   /if (${ChatText.Equal[Sense]}) { 
   /target ${plee} 
   /call cast "${sensespell}" gem4 nodismount 
   /return 
   }    

   /if (${ChatText.Equal[Might]}) { 
   /target ${plee} 
   /call cast "${mightspell}" gem5 nodismount 
   /return 
   }    

   /if (${ChatText.Equal[Back]}) { 
   /pet back 
   /delay 1s 
   /pet hold 
   /return 
   } 

   /if (${ChatText.Equal[Camp]}) { 
   /say Camping now, protect me for 30second or HGC! 
   /camp 
   /endmacro 
   /return 
   } 

   /if (${ChatText.Equal[Focus]}) { 
   /target ${plee} 
   /call cast "${focusspell}" gem3 nodismount 
   /return 
   } 

   /if (${ChatText.Equal[Follow]}) { 
   /varset follow TRUE 
   /return 
   } 
  
   /if (${ChatText.Equal[Gate]}) { 
   /call cast "gate" 
   /say Gating, bye bye~~ 
   /endmacro 
   /return 
   }    
    
   /if (${ChatText.Equal[Haste]}) { 
   /target ${plee} 
   /call cast "${hastespell}" gem8 nodismount 
   /return 
   }    

   /if (${ChatText.Equal[Help]}) { 
   /reply Here is the list of command available : Back, Camp, Focus, Follow, Gate, Haste, Help, Might, Stamina, Sense, SoW, Stay 
   /return 
   }    

   /if (${ChatText.Equal[Stay]}) { 
   /varet follow FALSE 
   /return 
   }    

/return 

Posted: Tue Nov 28, 2006 12:22 am
by xnad
recently i have tried to add a new variable to check if HoT casted to stop the Spam heal by the macro I wrote, however, i have encouter some problem, lets see :

Code: Select all

   sub heal1 

   /declare hotcast bool local FALSE

   :hotplee 
      /target ${plee} 
      /if (${Target.ID} && !${hotcast} && ${Target.PctHPs}<90 && ${Target.Distance}<=100) { 
         /target ${plee} 
         /gsay HoT on %T 
         /call cast "${hotspell}" gem1 nodismount 
         /varset hotcast TRUE
         /timed 420 /varset hotcast FALSE
         /goto :hotplee 
      } 
   /doevents 
   /return 
However, when the macro running, it said the if statement could not be execute, is there something wrong I made with the syntax or ..? Any help would be appreciate ( or I should move this question to other topic of the board? ), thanks in advance.

Posted: Tue Nov 28, 2006 1:05 pm
by Auronin
...

Posted: Tue Nov 28, 2006 1:57 pm
by fearless
Actually Auronin, you want the goto inside the if. As you have it, you create an endless loop and no way to exit it.

Further, for the love of god, stop issuing target commands when there is no need for it. Target data is sent to the soe servers, only use target when you need to. If you already have ${plee} targeted, why issue a second target command two lines later?

This is how I would do it:

Code: Select all

   sub heal1

| TIMER - not INT, an int won't count down.
| Check to see if hotcast is defined already, declare it if it is not.
   /if (!${Defined[hotcast]}) /declare hotcast timer outer

| Start a loop
   :hotplee

| If my current target is not the plee, target the plee
      /if (!${Target.ID}==${Spawn[pc ${plee}].ID}) /target id ${Spawn[pc ${plee}].ID}

| Built in sanity check, make sure we give it enough time to get the right target
| before further evaluation
      /delay 2s ${Target.ID}==${Spawn[pc ${plee}].ID}

| If I have a target and it is the right target and the hotcast timer has expired and 
| my target is not healthy enough and they are in range, I best start healing them
| NOTE: You can now use ${Spell[${hotspell}].myRange} for your range check instead
| or relying on some random number.  IE ${Target.Distance}<=${Spell[${hotspell}].myRange}
      /if (${Target.ID} && (${Target.ID}==${Spawn[pc ${plee}].ID}) && !${hotcast} && ${Target.PctHPs}<90 && ${Target.Distance}<=100) {

| I spent all my time above here making sure that I have the right target
| why the heck do I need to do it again?
|         /target ${plee}

         /gsay HoT on %T
         /call cast "${hotspell}" gem1 nodismount

| I set the timer to the duration of my HOT spell here
| Consider using some sort of check here from spell_routines.  
| IE /if cast was successful, THEN set the timer
         /varset hotcast 42s

| Start this loop over just to make sure everything took, there are other significantly
| better ways to do this, but this works for now
         /goto :hotplee
      }

| Process a doevents, I am not overly fond of doing one here because I do another one 
| in just a few lines after I return to whatever called me.
   /doevents

| CYA
   /return 

Posted: Wed Nov 29, 2006 1:08 am
by xnad
Thanks fearless and auronin :) Feel loved that someone actually reading the thread and giving help when needed ^^ Now grant me more energy to further modify the macro

So I should use the following

Code: Select all

      /if (!${Target.ID}==${Spawn[pc ${plee}].ID}) /target id ${Spawn[pc ${plee}].ID} 
instead of using this to reduce sending target command to server?

Code: Select all

/tar ${plee}

Posted: Wed Nov 29, 2006 9:19 am
by fearless
yes

It does two things, checks to see if you have the right target, in particular, the right pc. What happens when you use this and the plee is a bstlord? If you just use a blind /targ somebst, you will often target the pet.

With something like the new target line, it checks that you have a pc targeted, if not, it will target the pc.

Posted: Wed Dec 06, 2006 9:40 pm
by chrisj
Edited: stupid question

im probably in wrong thread..

Posted: Sun Dec 31, 2006 9:31 am
by bigluv17
but i appreciate everyones work and it is helping me learn and create these allthough i am a struggling newbie but one day hoope to grasp and create these for myself .. so ty ty

Re: Shaman Bodyguard

Posted: Mon Aug 04, 2025 7:03 am
by xyilla

Re: Shaman Bodyguard

Posted: Mon Aug 04, 2025 7:04 am
by xyilla

Re: Shaman Bodyguard

Posted: Mon Aug 04, 2025 7:05 am
by xyilla

Re: Shaman Bodyguard

Posted: Mon Aug 04, 2025 7:06 am
by xyilla

Re: Shaman Bodyguard

Posted: Mon Aug 04, 2025 7:07 am
by xyilla

Re: Shaman Bodyguard

Posted: Mon Aug 04, 2025 7:08 am
by xyilla