Casterbot.mac

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

Moderator: MacroQuest Developers

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Casterbot.mac

Post by Fippy » Tue Nov 19, 2002 7:10 pm

Ok this is still a work in progress but it works right now and its a bit more usefull than last time a posted. Instructions are in following post.


Code: Select all

| casterbot.mac 
| 

#turbo 100

#define QueueEnd v60 
#define QueueItem v61 
#define CurrentCommandLine v62 
#define CurrentCommandSender v63 
#define CurrentCommandSenderTarget v64 
#define CurrentCommandName v65 
#define CurrentCommandArg1 v66 
#define CurrentCommandArg2 v67 
#define QueuedCommandSender v68 
#define QueuedCommandSenderTarget v69 
#define QueuedCommandName v70 
#define QueuedCommandArg1 v71 
#define QueuedCommandArg2 v72 
#define StunCount v73 
#define ResistCount v74 
#define TotalSpells v75 
#define CheckAlias v76 
#define AliasFound v77 
#define TotalUsers v78 
#define CheckUsers v79 
#define ActualSpell v80
#define ResistMax v81
#define StunMax v82
#define GroupMode v83
#define ActualSpellChat v84
#define GroupMember v85
#define HPWatchFlag v86

| Array references 
#define aCommandSender 1 
#define aCommandSenderTarget 2 
#define aCommandName 3 
#define aCommandArg1 4 
#define aCommandArg2 5 
#define aSpellAlias 6 
#define aSpellName 7 
#define aUsers 9 
#define aWatchHP 10

#define CAST_SUCCESS 0 
#define CAST_UNKNOWNSPELL 1 
#define CAST_RESTART 2 
#define CAST_OUTOFMANA 3 
#define CAST_OUTOFRANGE 4 
#define CAST_CANNOTSEE 5 
#define CAST_STUNNED 6 
#define CAST_RESISTED 7 



|#define mqlog echo 


| This is the spell slot that will be used to mem a spell if you dont already have it memorized 
#define PolySpellSlot 8 

| Set up number of retries is stunned or resisted 

#include spellcast.mac 
#include spellbook.mac 
#include routines.mac 

#chat tell 

sub main 

| Authorised Users 

   /mqlog Started Casterbot 
   /em glows with mystical intelligence. 

| Default recast counters

   /varset ResistMax 3
   /varset StunMax 3

| Set group mode off

   /varset GroupMode 0

   /varset a(aUsers,0) "player1" 
   /varset a(aUsers,1) "player2" 
   /varset a(aUsers,2) "player3" 
   /varset a(aUsers,3) "player4" 
   /varset a(aUsers,4) "player5" 
    
   /varset TotalUsers 5 


| Spell Aliases 

   /varset a(aSpellAlias,0) "null"  | Leave this one in 
   /varset a(aSpellName,0) "null" 

   /varset a(aSpellAlias,1) "center" 
   /varset a(aSpellName,1) "Center" 
 
   /varset a(aSpellAlias,2) "heal" 
   /varset a(aSpellName,2) "Light Healing" 

   /varset a(aSpellAlias,3) "nuke" 
   /varset a(aSpellName,3) "Furor" 

   /varset TotalSpells 4 

   
| Turn on Group HP Watch by default.   
   /varset HPWatchFlag 1 

   /varset QueueEnd 0 

:MainLoop 
   
   /doevents
   
   |If in HP Watch mode then check the groupd HP's and queue a heal if required.
   /if n $HPWatchFlag==1 /call grouphpwatch

   | Proces a command from the queue.
   /call ProcessCommand 
   
/goto :MainLoop 

/return 

sub event_chat 

   /if "$p0"=="tell" /goto :RobotChannel 
   /goto :ChatEnd 

:RobotChannel 
    /varset CheckUsers 0 
    /mqlog "$lcase("$p1")"=="$a(aUsers,$CheckUsers)" CheckUsers 
   :CheckACL    
      /if "$lcase("$p1")"=="$a(aUsers,$CheckUsers)" { 
         /mqlog $p1 is Authorised 
         /goto :UserAuthorised 
      } 
      /varadd CheckUsers 1 
      /delay 1
      /if $CheckUsers<$TotalUsers /goto :CheckACL 
    /beep 
    /goto :ChatEnd 
    
:UserAuthorised 
   /mqlog event_chat: "$p1" said "$p2" 
    
   | Save of name of command sender 
   /varset CurrentCommandSender "$p1" 

   /varset CurrentCommandLine "$p2" 
    
   | Save of name of command senders target 
   /assist $p1 
   /delay 10 
   /mqlog targeted $target(name) from $p1 assist 
   /mqlog its id is $target(id) 
   /varset CurrentCommandSenderTarget $target(id) 

   /varset CurrentCommandName "NULL" 
   /varset CurrentCommandArg1 "NULL" 
   /varset CurrentCommandArg2 "NULL" 
    
   | Split Command 
   /if $strlen("$arg(1,"$CurrentCommandLine")")>0 /varset CurrentCommandName "$lcase("$arg(1,"$CurrentCommandLine")")" 
   /if $strlen("$arg(2,"$CurrentCommandLine")")>0 /varset CurrentCommandArg1 "$lcase("$arg(2,"$CurrentCommandLine")")" 
   /if $strlen("$arg(3,"$CurrentCommandLine")")>0 /varset CurrentCommandArg2 "$lcase("$arg(3,"$CurrentCommandLine")")" 
    
   /call EnqueueCommand "$CurrentCommandSender" "$CurrentCommandSenderTarget" "$CurrentCommandName" "$CurrentCommandArg1" "$CurrentCommandArg2" 
   /mqlog EnqueueCommand "$CurrentCommandSender" "$CurrentCommandSenderTarget" "$CurrentCommandName" "$CurrentCommandArg1" "$CurrentCommandArg2" 
    
   /goto :ChatEnd 

:ChatEnd    

/return 

| ParseComand 
| 
| Accepts p0 - Sender of command 
|         p1 - Sender of commands target 
|         p2 - Command 
|         p3 - arg1 
|         p4 - arg2 
| 
sub ParseCommand 

   /if "$p2"=="cast"  /call CastCommand "$p0" "$p1" "$p3" "$p4" 
   /if "$p2"=="gotoloc"  /call GotoLocCommand "$p0" "$p3" 
   /if "$p2"=="gototarget"  /call GotoTargetCommand "$p0" "$p3" 
   /if "$p2"=="follow"  /call FollowCommand "$p0" "$p3" 
   /if "$p2"=="med"  /call MedCommand 
   /if "$p2"=="user"  /call UserCommand "$p0" "$p3" "$p4" 
   /if "$p2"=="exit" /call Exit "$p0" 
   /if "$p2"=="groupmode" /call GroupModeCommand "$p0" "$p3" 
   /if "$p2"=="hpwatch" /call HPWatchCommand "$p0" "$p3" 
   /if "$p2"=="camp" /call CampCommand "$p0" 
   /if "$p2"=="mana" /call ManaCommand "$p0" 
    
/return 


sub ProcessCommand 

    /if $QueueEnd>0 /mqlog ProcessCommand: $QueueEnd  in queue 
    /if n $QueueEnd==0 /goto :EmptyQueue 

    /varset QueuedCommandSender "$a(aCommandSender,0)" 
    /varset QueuedCommandSenderTarget "$a(aCommandSenderTarget,0)" 
    /varset QueuedCommandName "$a(aCommandName,0)" 
    /varset QueuedCommandArg1 "$a(aCommandArg1,0)" 
    /varset QueuedCommandArg2 "$a(aCommandArg2,0)" 
    
    |If it was the last command in the list set to null 
    /if n $QueueEnd==1 { 
      /varset a(aCommandSender,0) "NULL" 
      /varset a(aCommandSenderTarget,0) "NULL" 
      /varset a(aCommandName,0) "NULL" 
      /varset a(aCommandArg1,0) "NULL" 
      /varset a(aCommandArg2,0) "NULL" 
      /varset QueueEnd 0 
      /goto :EndQueue 
    } 

   :RemoveCommand 
      /varset QueueItem 0 
      :RemoveLoop 
         /mqlog Moved "$a(aCommandName,$calc($QueueItem+1))" "$a(aCommandArg1,$calc($QueueItem+1))" from $calc($QueueItem+1) to $QueueItem 
         /varset a(aCommandSender,$QueueItem) "$a(aCommandSender,$calc($QueueItem+1))" 
         /varset a(aCommandSenderTarget,$QueueItem) "$a(aCommandSenderTarget,$calc($QueueItem+1))" 
         /varset a(aCommandName,$QueueItem) "$a(aCommandName,$calc($QueueItem+1))" 
         /varset a(aCommandArg1,$QueueItem) "$a(aCommandArg1,$calc($QueueItem+1))" 
         /varset a(aCommandArg2,$QueueItem) "$a(aCommandArg2,$calc($QueueItem+1))" 
         /varadd QueueItem 1 
         /delay 1
      /if n $calc($QueueItem+1)<$QueueLength /goto :RemoveLoop 
      /varsub QueueEnd 1 

:EndQueue 
   /mqlog ProcessCommand: Parsing ParseCommand "$QueuedCommandSender" "$QueuedCommandSenderTarget" "$QueuedCommandName" "$QueuedCommandArg1" "$QueuedCommandArg2" 
   /call ParseCommand "$QueuedCommandSender" "$QueuedCommandSenderTarget" "$QueuedCommandName" "$QueuedCommandArg1" "$QueuedCommandArg2" 

:EmptyQueue 

/return 

sub EnqueueCommand 
   /varset a(aCommandSender,$QueueEnd) "$p0" 
   /varset a(aCommandSenderTarget,$QueueEnd) "$p1" 
   /varset a(aCommandName,$QueueEnd) "$p2" 
   /varset a(aCommandArg1,$QueueEnd) "$p3" 
   /varset a(aCommandArg2,$QueueEnd) "$p4" 
   /mqlog added command "$p0" "$p1" "$p2" "$p3" "$p4" at index $QueueEnd 
   /varadd QueueEnd 1 
/return 


| 
| Cast Command 
| 
sub CastCommand 
   | $p0 Sender 
   | $p1 Sender Target 
   | $p2 Spell 
   | $p3 Target 
    
   | First make sure we have nothing targeted 
   /press Esc 
    
   |Reset or stun and resist counters 
   /varset StunCount 0 
   /varset ResistCount 0 

   | Check if target was sender (me alias) or senders target (target alias) and target it 
   /mqlog $p3 
    
   /if "$p3"=="me" { 
      /mqlog target "$p0" 
      /target "$p0" 
   } else /if "$p3"=="target" { 
      /mqlog target id "$p1" 
      /target id "$p1" 
   } else { 
      /mqlog target "$p3" 
      /target "$p3" 
   } 
    
   | If we do not have mob targeted deal with the error 
   /if "$target()"!="TRUE" /goto :CastNoTarget 

   | Expand Spell alias    
   /varset CheckAlias 0 
    
   :CheckSpellAlias 
    
      | Loop through SpellAlias's array 
      /if "$lcase("$p2")"=="$a(aSpellAlias,$CheckAlias)" { 
         /varset ActualSpell "$a(aSpellName,$CheckAlias)" 
         /varset AliasFound 1 
         /mqlog "$a(aSpellAlias,$CheckAlias)" used 
         /goto :CheckSpellAliasEnd 
      } 
      /mqlog $CheckAlias<=$TotalSpells 
      /varadd CheckAlias 1 
      /delay 1
      /if n $CheckAlias<=$TotalSpells /goto :CheckSpellAlias 
      
      | Unrecognised Spell Alias so ignore command 
      /goto :CastUnknownAlias 
      
   :CheckSpellAliasEnd 

   | Start casting 
   :StartCasting 
      | Stand up and face the target 
      /stand 
      /face 
      /call Cast "$ActualSpell" 
      /mqlog Cast: Returned $return 
      
      |Deal with any error 
      /if n $return==CAST_UNKNOWNSPELL /goto :CastUnknownSpell 
      /if n $return==CAST_OUTOFRANGE /goto :CastOutOfRange 
      /if n $return==CAST_CANNOTSEE /goto :CastCanNotSee 
      /if n $return==CAST_STUNNED /goto :CastStunned 
      /if n $return==CAST_RESISTED /goto :CastResisted 
      
      /goto :CastFinished 
      
      :CastUnknownSpell 
         /mqlog Spell Not Known 
         /call MemorizeSpell "$ActualSpell" PolySpellSlot 
         /if n $return==BOOK_NOTKNOWN { 
            /tell $p0 I do not have the spell $ActualSpell in my book 
            /goto :CastFinished 
         } else { 
            /delay 1
            /goto :StartCasting 
         } 
          
      :CastOutOfRange 
         /tell $p0 target out of range whilst casting $ActualSpell 
         /goto :CastFinished 

      :CastNoTarget 
         /tell target no longer valid casting "$ActualSpell" 
         /goto :CastFinished 
      
      :CastCanNotSee 
         /tell $p0 I cannot see  Target to cast $ActualSpell      
         /goto :CastFinished 

      :CastUnknownAlias 
         /tell $p0 Spell Alias $p2 is not valid 
         /goto :CastFinished 

      :CastStunned 
         /varadd StunCount 1 
         /if n $StunCount<$StunMax /goto :StartCasting 
         /varset StunCount 0 
         /goto :CastFinished 
          
      :CastResisted 
         /varadd ResistCount 1 
         /mqlog Resisted $ResistCount times
         /if n $ResistCount<$ResistMax /goto :StartCasting 
         /varset ResistCount 0 
         /goto :CastFinished 
          
      :CastFinished
      
      |Sit Back Down 
      /stand 
      /sit 

/return 

|
| hp watch routine
|
sub grouphpwatch
   | Check Group HP's
   /for GroupMember 0 to $calc($group(count)-1)
      /doevents
      /if n $spawn($group($GroupMember),hp,pct)<61 {
         /call EnqueueCommand "$char(name)" "$group($GroupMember)" "cast" "heal" "target"
         /call EnqueueCommand "$char(name)" "$group($GroupMember)" "cast" "heal" "target"
         /mqlog Added heal for $spawn($group($GroupMember),name)
      }
   /next GroupMember
   
/return


| 
| GotoLoc Command 
| 
sub GotoLocCommand 
   | $p0 sender 
   | $p1 loc in  x,y 
   /stand 
   /varset v91 $rand(5) 
   :GotoLocLoop 
      /face loc $p1 
      /call AutoRun 1
      /delay 1
   /if n $distance($p1)>$calc(10+$v91) /goto :GotoLocLoop 
   /call AutoRun 0 
   /tell $p0 made it to loc $p1 
   /sit 
/return 

| 
| GotoTarget Command 
| 
sub GotoTargetCommand 
   | $p0 Sender 
   | $p1 Target 
   /stand 
   /varset v91 $rand(5) 
   /target $p1 
   :GotoTargLoop 
      /face 
      /call AutoRun 1
      /delay 1
   /if n $target(distance)>$calc(10+$v91) /goto :GotoTargLoop 
   /call AutoRun 0 
   /tell $p0 made it to $p1 
   /sit 
/return 

| 
| FollowCommand 
| 
sub FollowCommand 
   | $p0 target 
/return 

| 
| Med Command 
| 
sub MedCommand 
   /mqlog Medding 
   /stand 
   /sit 
/return 

| 
| User Command 
| 
sub UserCommand 
   | $p0 Sender 
   | $p1 arg 
   | $p2 target 
   /if "$lcase("$p1")"=="add" { 
      /varset a(aUsers,$TotalUsers) "$p2" 
      /varadd TotalUsers 1 
      /mqlog user $p1 added 
      /tell $p0 added user $p2 
   } 

   /if "$lcase("$p1")"=="list" { 
      /tell $p0 There are $TotalUsers authorised users as follows; 
      /for l1 0 to $calc($TotalUsers-1) 
        /delay 10 
        /tell $p0 username: $a(aUsers,$l1) 
      /next l1 
   } 
/return 

| 
| Exit Command 
| 
sub exit 
   | $p0 Sender 
   | exit macro 
   /tell $p0 OK exiting 
   /endmacro 
/return 

| 
| GroupMode Command 
| 
sub GroupModeCommand 
   | $p0 Sender 
   | $p1 arg 
   /if "$lcase("$p1")"=="on" { 
      /varset GroupMode 1  
      /tell $p0 Group mode on 
   } 

   /if "$lcase("$p1")"=="off" { 
      /varset GroupMode 0  
      /tell $p0 Group mode off
   } 
/return 

| 
| HPWatch Command 
| 
sub HPWatchCommand 
   | $p0 Sender 
   | $p1 arg 
   /if "$lcase("$p1")"=="on" { 
      /varset HPWatchFlag 1  
      /tell $p0 HP Watch mode on 
   } 

   /if "$lcase("$p1")"=="off" { 
      /varset HPWatchFlag 0  
      /tell $p0 HP Watch mode off
   } 
/return 

| 
| Med Command 
| 
sub CampCommand 
   /mqlog Camping
   /stand 
   /sit
   /tell $p0 Camping out
   /camp desktop
   /unload
/return 

| 
| Mana Command 
| 
sub ManaCommand 
   /mqlog Mana is at $char(mana,pct) pct
   /tell $p0 Mana is at $char(mana,pct) pct
/return 

uses slightly modified spellbook.mac. basically added return code to handle errors in calling script better.

Code: Select all

|** - spellbook.mac - 
** 
** This macro is an include for other macros.  It deals with memorizing 
** and forgetting spells. 
**| 


#define BOOK_MEMMED 10
#define BOOK_NOTKNOWN 11

| This function forgets a memorized spell by its spell name 
sub ForgetSpellByName 
   /if n $char(gem,"$p0")==0 /goto :EndForgetSpellByName 
   :WaitRefreshFrogetSpellByName
      /delay 0
   /if n $char(gem,"$p0")<0 /goto :WaitRefreshFrogetSpellByName
   /call ForgetSpellByNumber $char(gem,"$p0") 
   :EndForgetSpellByName 
/return 

| This function forgets a memorized spell by gem # 
sub ForgetSpellByNumber 
   /varset l0 $mouse(x) 
   /varset l1 $mouse(y) 

   /call MousetoSpellGem $p0 
|   /delay 2 
   /click right 

   :WaitForGemFreeInForgetSpellByNumber 
      /doevents 
      /if "$char(gem,$p0)"!="NULL" /goto :WaitForGemFreeInForgetSpellByNumber 

   /mouseto $l0 $l1 
/return 

| This function takes two arguments; the name of the spell to memorize and the 
| spell gem to put it in 
sub MemorizeSpell 
   | Make sure we don't already have the spell memorized! 
   /if n $char(gem,"$p0")>0 {
      /mqlog already memed
      /return BOOK_MEMMED
   }
   | Make sure we have the spell! 
   /if n $char(book,"$p0")<1 {
     /mqlog dont have spell
     /return BOOK_NOTKNOWN
   }

   | Spell book # is $l9.  Spell book page is $l8.  Spell slot is $l7. 
   | Page layout is $l6 
   /varset l9 $int($char(book,"$p0")-1) 
   /varset l8 $int($l9\5+1) 
   /varset l7 $int($l9%5) 
   /varset l6 $l8 

   :GetPageLayout 
      /if n $l6>6 /varsub l6 6 
      /if n $l6>6 /goto :GetPageLayout 

   /book $l8 

   | In case we need to open our spell book... 
   /delay 3 

   /if n $l6==1 /call MousetoSpellSlot 1 $int($l8%2) $l7 
   /if n $l6==2 /call MousetoSpellSlot 2 $int($l8%2) $l7 
   /if n $l6==3 /call MousetoSpellSlot 3 $int($l8%2) $l7 
   /if n $l6==4 /call MousetoSpellSlot 3 $int($l8%2) $l7 
   /if n $l6==5 /call MousetoSpellSlot 3 $int($l8%2) $l7 
   /if n $l6==6 /call MousetoSpellSlot 4 $int($l8%2) $l7 

   /delay 1 

   /click left 
   /delay 2 

   /call MousetoSpellGem $p1 

   /call ForgetSpellByNumber $p1 

   /click left 

   | Wait for the spell to finish memorizing 
   :WaitToFinishMemorizingSpell 
      /doevents 
      /if "$char(gem,$p1)"=="NULL" /goto :WaitToFinishMemorizingSpell 

/return 

| Moves your mouse to the appropriate spellgem 
sub MousetoSpellGem 
   /varcalc l0 $int($p0-1)*38+27 
   /mouseto 104 $l0 
/return 

| Moves your mouse to the appropriate spell slot for the given layout 
|  $p0: layout $p1: even/odd (0/1) $p2: spell slot 
sub MousetoSpellSlot 
   /if n $p0==1 /goto :Layout1InMousetoSpellslot 
   /if n $p0==2 /goto :Layout2InMousetoSpellslot 
   /if n $p0==3 /goto :Layout3InMousetoSpellslot 
   /if n $p0==4 /goto :Layout4InMousetoSpellslot 

   :Layout1InMousetoSpellslot 
      /if n $p2==0 /mouseto 202 66 
      /if n $p2==1 /mouseto 280 60 
      /if n $p2==2 /mouseto 280 128 
      /if n $p2==3 /mouseto 202 184 
      /if n $p2==4 /mouseto 280 195 
      /goto :CheckRightPageInMousetoSpellslot 

   :Layout2InMousetoSpellslot 
      /if n $p2==0 /mouseto 200 59 
      /if n $p2==1 /mouseto 276 88 
      /if n $p2==2 /mouseto 200 127 
      /if n $p2==3 /mouseto 276 161 
      /if n $p2==4 /mouseto 200 194 
      /goto :CheckRightPageInMousetoSpellslot 

   :Layout3InMousetoSpellslot 
      /if n $p2==0 /mouseto 191 63 
      /if n $p2==1 /mouseto 284 63 
      /if n $p2==2 /mouseto 238 136 
      /if n $p2==3 /mouseto 191 189 
      /if n $p2==4 /mouseto 284 189 
      /goto :CheckRightPageInMousetoSpellslot 

   :Layout4InMousetoSpellslot 
      /if n $p2==0 /mouseto 242 61 
      /if n $p2==1 /mouseto 193 124 
      /if n $p2==2 /mouseto 281 124 
      /if n $p2==3 /mouseto 202 193 
      /if n $p2==4 /mouseto 267 193 
      /goto :CheckRightPageInMousetoSpellslot 

   :CheckRightPageInMousetoSpellslot 
      /if n $p1==0 /mouseto + 161 +0 
/return

Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Tue Dec 03, 2002 12:04 pm

Ok if your gonna use this script youll have to set a few things up yourself.

Firstly add some spell aliases like so.

Code: Select all

| Spell Aliases 

   /varset a(aSpellAlias,0) "null"  | Leave this one in 
   /varset a(aSpellName,0) "null" 

   /varset a(aSpellAlias,1) "center" 
   /varset a(aSpellName,1) "Center" 

   /varset a(aSpellAlias,2) "heal" 
   /varset a(aSpellName,2) "Light Healing" 

   /varset a(aSpellAlias,3) "nuke" 
   /varset a(aSpellName,3) "Furor" 

   /varset TotalSpells 4 
As you can obviously see you add a short name for the spell and then the proper name. Dont forget the increment the subscript of the array as you add more alias's. When your done adding aliases make sure that TotalSpells is set to be one higher than the highest sunscript.

Youll also want to add some users too.

Code: Select all

| Set group mode off 

   /varset GroupMode 0 

   /varset a(aUsers,0) "player1" 
   /varset a(aUsers,1) "player2" 
   /varset a(aUsers,2) "player3" 
   /varset a(aUsers,3) "player4" 
   /varset a(aUsers,4) "player5" 
    
   /varset TotalUsers 5 
obviosly change the names here to what you want and if you add more dont forget to increase the TotalUsers variable.


The bot is controlled by tells. If your name is not on the list of users it is ignored otherwise the tell is parsed for a command. The following commands are supported at the moment:

cast <spell alias> <target> - casts a spell

<spell alias> is as you have set up in your list and <target> can be me or target.

/tell <bots name> cast heal me - will tell the bot to cast the spell with the alias heal onto the sender of the command.

/tell <bots name> cast nuke target - will tell the bot to cast the spell with the alias nuke onto the senders target.


gotoloc <x,y> - makes the bot run to the loc specified in x,y. No collision detection is done so if the bot hits a tree or building or wall it will keep on running so only use this for short runs.

gototarget <target> - doesnt work to well atm as if you use %t to call the command the it will just run to first mob that matches the first word of the name which is usually a or an.

follow <target> - Not Yet Implemented"

med - makes the bot sit down and med.

exit - makes the bit quit the bot script

groupmode - changes group mode to on or off. Doesnt actually effect anything yet but will be used for providing group feedback on mana, casting etc.

hpwatch [ON|OFF] - turns on or off hit points watch. It is on by default. hpwatch will monitor all the groups health and cast a heal if hp's drop below a certain percentage (this is currently 61% since i am testing this on lowbies)

camp - Bot will sitdown, campout and unload MQ.

mana - Bot well tell the requestor the percentage mana it has.

Ok thats all for now. Whatch out for more features.
Fippy

This is my girl. But Rizwank had her first :-)
[img]http://www.btinternet.com/~artanor/images/fairy_bounce09.gif[/img]

asta
decaying skeleton
decaying skeleton
Posts: 9
Joined: Wed Dec 25, 2002 5:30 pm

Post by asta » Sat Jan 04, 2003 6:27 pm

This is a dream come true thank you for writing it, one request could you tell me how to make "sit" or "stand" a variable?

I see it defaults to sitting mode and when using it on a shammy for slowing that isnt conducive to long life.

Macro_Explorer
orc pawn
orc pawn
Posts: 12
Joined: Mon Jan 13, 2003 11:38 am

Would this modified sub work?

Post by Macro_Explorer » Thu Jan 16, 2003 12:14 pm

I changed the grouphpwatch sub based on some ideas I got from clericbot.mac. I can not test this, and I have been doing scripting for about 4 days now so I am not sure if the syntax is correct.

Will this sub work?

Code: Select all

| 
| hp watch routine 
| 
sub grouphpwatch 
   | Check Group HP's 
   /for GroupMember 0 to $calc($group(count)-1) 
      /doevents
      | Chartype 1 = Tank - Use big heals
      | Chartype 2 = Support - Use fast medium heals
      | Chartype 3 = Caster - Use fast small heals early
      /if "$GroupClass"=="Bard" /varset Chartype 2 
      /if "$GroupClass"=="Beastlord" /varset Chartype 2 
      /if "$GroupClass"=="Cleric" /varset Chartype 2
      /if "$GroupClass"=="Druid" /varset Chartype 2
      /if "$GroupClass"=="Enchanter" /varset Chartype 3
      /if "$GroupClass"=="Magician" /varset Chartype 3
      /if "$GroupClass"=="Monk" /varset Chartype 1
      /if "$GroupClass"=="Necromancer" /varset Chartype 3
      /if "$GroupClass"=="Paladin" /varset Chartype 1
      /if "$GroupClass"=="Ranger" /varset Chartype 1
      /if "$GroupClass"=="Rogue" /varset Chartype 2
      /if "$GroupClass"=="Shadow Knight" /varset Chartype 1 
      /if "$GroupClass"=="Shaman" /varset Chartype 2
      /if "$GroupClass"=="Warrior" /varset Chartype 1
      /if "$GroupClass"=="Wizard" /varset Chartype 3
      /if n $spawn($group($GroupMember),hp,pct)<80 /if $Chartype==3 /call EnqueueCommand "$char(name)" "$group($GroupMember)" "cast" "fastheal" "target"
      /if n $spawn($group($GroupMember),hp,pct)<50 /if $Chartype==2 /call EnqueueCommand "$char(name)" "$group($GroupMember)" "cast" "heal" "target"
      /if n $spawn($group($GroupMember),hp,pct)<35 /if $Chartype==1 /call EnqueueCommand "$char(name)" "$group($GroupMember)" "cast" "completeheal" "target"
      /mqlog Added heal for $spawn($group($GroupMember),name) 
   /next GroupMember 
/return 

rishid
decaying skeleton
decaying skeleton
Posts: 8
Joined: Mon Feb 17, 2003 11:49 am

Post by rishid » Thu Feb 20, 2003 8:50 pm

Does this still work with newUI?
RishiD

User avatar
ap50
a snow griffon
a snow griffon
Posts: 425
Joined: Sun Aug 18, 2002 2:29 pm

Post by ap50 » Fri Feb 21, 2003 3:13 am

Won't matter... 3 days and MacroQuest go BOOM!
[color=yellow][size=92][b]Just because you're paranoid, it doesn't mean everyone isn't out to get you![/b][/size][/color]