genbot.mac - Bot for any class scirpts.

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

Moderator: MacroQuest Developers

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Tue Jul 15, 2003 9:02 pm

Possible to make macro useable by more than one master?

Buff Bitch for say 4 ppl?
I think it is possible. You should learn how to code and give it a try.

I'll get ya started.

Code: Select all

Sub Main 
   /if n $strlen("$p0")<=0 { 
     /echo Usage: /macro generic <Master Name> 
     /endmacro 
   } 
   /varset MasterName1 $p0 
   /varset MasterName2 $p1
   /varset MasterName3 $p2 
   /varset MasterName4 $p3 
   /varset MasterName5 $p4 
   /varset MasterName6 $p5   
   /varset IsHealer 0 
   /varset IsPally 0 
   /varset RangeMin 10 
   /varset RangeMax 12 
   /varset FastRange 15 
   /varset Combatstatus 0 
   /varset SitAfterCast 0 
Maybe change this to

Code: Select all

Sub Main 
   /if n $strlen("$p0")<=0 { 
     /echo Usage: /macro generic <Master Name> 
     /endmacro 
   } 
   /varset MasterName $p0 
   /varset IsHealer 0 
   /varset IsPally 0 
   /varset RangeMin 10 
   /varset RangeMax 12 
   /varset FastRange 15 
   /varset Combatstatus 0 
   /varset SitAfterCast 0 


Code: Select all

|botcore.inc 
|Bot core module 
|version 1.03 

#chat tell 
#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 
#define IsHealer v61 
#define countdown v62 
#define CmdList v63 
#define RangeMin v70 
#define RangeMax v71 
#define FastRange v72 
#define Combatstatus v73 
#define Remem v75 
#define MyClass v76 
#define IsPally v77 
#define Fail v94 
#define DoAgain v95 
#define StartCast v96 
#define SpellSlot v97 
#define SpellName v98 
#define CastTime v99 
#define CTimer t39 
And this would look like this

Code: Select all

|botcore.inc 
|Bot core module 
|version 1.03 

#chat tell 
#define MasterName1 v81 
#define MasterName2 v82
#define MasterName3 v83 
#define MasterName4 v84 
#define MasterName5 v85 
#define MasterName6 v86
#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 
#define IsHealer v61 
#define countdown v62 
#define CmdList v63 
#define RangeMin v70 
#define RangeMax v71 
#define FastRange v72 
#define Combatstatus v73 
#define Remem v75 
#define MyClass v76 
#define IsPally v77 
#define Fail v94 
#define DoAgain v95 
#define StartCast v96 
#define SpellSlot v97 
#define SpellName v98 
#define CastTime v99 
#define CTimer t39 


Code: Select all

Sub Event_Chat 
   /varset CmdArrayNum 0 
   /if "$MasterName"=="$p1" { 
      :ArrayTime 
      /if "$arg(1,"$p2")"=="$a(1,$CmdArrayNum)" { 
         /call Do-$a(1,$CmdArrayNum) $p2 
         /return 
      } 
      /varadd CmdArrayNum 1 
      /if n $CmdArrayNum>=$CmdArraySize /return 
      /goto :ArrayTime 
   } else { 
       /tell $MasterName $p1 told me: $p2 
   } 
/return 
Maybe change to

Code: Select all

Sub Event_Chat 
   /varset CmdArrayNum 0 
   /if "$MasterName1"=="$p1" /goto :ArrayTime
   /if "$MasterName2"=="$p1" /goto :ArrayTime
   /if "$MasterName3"=="$p1" /goto :ArrayTime
   /if "$MasterName4"=="$p1" /goto :ArrayTime
   /if "$MasterName5"=="$p1" /goto :ArrayTime
   /if "$MasterName6"=="$p1" /goto :ArrayTime
 /tell $MasterName1 $p1 told me: $p2 
/return 
  :ArrayTime 
      /if "$arg(1,"$p2")"=="$a(1,$CmdArrayNum)" { 
         /call Do-$a(1,$CmdArrayNum) $p2 
         /return 
      } 
      /varadd CmdArrayNum 1 
      /if n $CmdArrayNum>=$CmdArraySize /return 
      /goto :ArrayTime 
     } 


I think this will work. Kinda off the cuff here. you will need to test it and clean it up some, but shouldnt be to bad.

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

MasterName

Post by grimjack » Wed Jul 16, 2003 12:35 am

You need to keep the MasterName variable or it will break the subs that aquire targets using it. Just have it set it to $p1 in Sub Event_Chat.

Something like this:

Code: Select all

Sub Main
   /if n $strlen("$p0")<=0 {
     /echo Usage: /macro generic <Master Name>
     /endmacro
   }
   /if n $strlen("$p1")<=0 {
      /varset MName1 $p0
      /varset MName2 NULL
      /varset MName3 NULL
      /varset MName4 NULL
      /varset MName5 NULL
      /varset MName6 NULL 
   } else /if n $strlen("$p2")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 NULL
      /varset MName4 NULL
      /varset MName5 NULL
      /varset MName6 NULL 
   } else /if n $strlen("$p3")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 NULL
      /varset MName5 NULL
      /varset MName6 NULL 
   } else /if n $strlen("$p4")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 $p3
      /varset MName5 NULL
      /varset MName6 NULL 
   } else /if n $strlen("$p5")<=0 {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 $p3
      /varset MName5 $p4
      /varset MName6 NULL 
   } else {
      /varset MName1 $p0
      /varset MName2 $p1
      /varset MName3 $p2
      /varset MName4 $p3
      /varset MName5 $p4
      /varset MName6 $p5   
   }
   /varset IsHealer 0
   /varset IsPally 0
   /varset RangeMin 10
   /varset RangeMax 12
   /varset FastRange 15
   /varset Combatstatus 0
   /varset SitAfterCast 0

Code: Select all

|botcore.inc
|Bot core module
|version 1.03

#chat tell
#define MasterName v50
#define MName1 v81
#define MName2 v82
#define MName3 v83
#define MName4 v84
#define MName5 v85
#define MName6 v86
#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
#define IsHealer v61
#define countdown v62
#define CmdList v63
#define RangeMin v70
#define RangeMax v71
#define FastRange v72
#define Combatstatus v73
#define Remem v75
#define MyClass v76
#define IsPally v77
#define Fail v94
#define DoAgain v95
#define StartCast v96
#define SpellSlot v97
#define SpellName v98
#define CastTime v99
#define CTimer t39

Code: Select all

Sub Event_Chat
   /varset CmdArrayNum 0
   /if "$MName1"=="$p1" /goto :SetupTime
   /if "$MName2"=="$p1" /goto :SetupTime
   /if "$MName3"=="$p1" /goto :SetupTime
   /if "$MName4"=="$p1" /goto :SetupTime
   /if "$MName5"=="$p1" /goto :SetupTime
   /if "$MName6"=="$p1" /goto :SetupTime
   /tell $MName1 $p1 told me: $p2
   /return
   :SetupTime
   /varset MasterName $p1
   :ArrayTime
   /if "$arg(1,"$p2")"=="$a(1,$CmdArrayNum)" {
      /call Do-$a(1,$CmdArrayNum) $p2
      /return
   }
   /varadd CmdArrayNum 1
   /if n $CmdArrayNum>=$CmdArraySize /return
   /goto :ArrayTime
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Wed Jul 16, 2003 3:16 am

Yea, What he said :lol:

Wishbringer
Contributing Member
Contributing Member
Posts: 230
Joined: Thu Nov 14, 2002 7:00 am

Post by Wishbringer » Wed Jul 16, 2003 1:49 pm

nice, thanks, will try it out

Shocks
a ghoul
a ghoul
Posts: 101
Joined: Tue Feb 18, 2003 3:26 pm
Contact:

Issue Im having

Post by Shocks » Thu Jul 17, 2003 12:12 pm

I am using this macro. I have edited it a bit to suite me. My main issue is when I turn on auto healing for my shaman what happens is that it checks everyones health fine. I get the msg "Greater Healing on Target Name" then it enters the botspell.inc casts the spell boom. Then Directly after that I get the next msg " Greater Healing on Target Name". What is going on is that it runs the Tank heal then directly after runs the caster heal.
After this it will not heal anyone. Im pretty sure the macro is getting stuck somewhere but im not nearly that good at code. Although I am getting much better. Here are the changes that I have made to the macro.


This is where I changed the heal to my lower lvl heals.
Sub Tankheal
/if n $group($GroupMember)==$char(id) /press F1
/if n $group($GroupMember)!=$char(id) /target id $group($GroupMember)
/stand
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||| Edit Edit heal message
||| Edit Spell to auto cast on Melee
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/g Greater Healing on %t
/call SpellSub "Greater Healing"
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/if "$SitAfterCast"=="1" /sit on
/press esc
/return


|||Heal called when healing a non tank.
Sub Casterheal
/if n $group($GroupMember)==$char(id) /press F1
/if n $group($GroupMember)!=$char(id) /target id $group($GroupMember)
/stand
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||| Edit Edit heal message
||| Edit Spell to auto cast on Non Melee
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/g Greater Healing on %t
/call SpellSub "Greater Healing"
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/if "$SitAfterCast"=="1" /sit on
/press esc
/return
This change was in botspell.inc to fix some delay issues.

/varset CTimer "$CastTime"s
/varadd CTimer 2
I am also hoping that someone can help me get this line of code working.


Sub Do-buff

/load loadbuffs <---- Seems to lock after this. This is to
load my buff list.
/delay 25s
/target Target1
/delay 6
/call spellsub Talisman of the Beast
/call spellsub Spirit of Bear
/call spellsub Spirit of Monkey
/call spellsub Inner Fire
/call spellsub Spirit of Cat
/target Target2
/delay 6
/call spellsub Talisman of the Beast
/call spellsub Spirit of Bear
/call spellsub Spirit of Monkey
/call spellsub Inner Fire
/call spellsub Spirit of Cat
/sit
/return
One more thing. Im getting a really wierd error when I use the aftercastsit command. I dont know what it says right now but I will edit and change this msg tonight when I get home.

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Thu Jul 17, 2003 5:14 pm

I have had the same issue. Im working on it some, but im also working on getting to 65 asap because my guild is in PoTime and i wanna be there!!

Anyways. One way i got not to spam the heal more than once was to put a timer in when that particular heal was cast. If you have more than one heal loaded up then you can have multiple timers and if that heal isnt available try the next one.

I'll post what i have in a few minutes.

macrotoon
a ghoul
a ghoul
Posts: 106
Joined: Wed Sep 18, 2002 4:38 pm

Post by macrotoon » Thu Jul 17, 2003 5:29 pm

This is in bothealer.inc

Code: Select all


Sub PalGroupheal 
         /if n $GHealTimer!=0 /return
         /stand 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
||| Edit Edit heal message 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
         /if n $Combatstatus==1 /g Attempting GROUP HEAL for 660 Pt heal 
         /if n $Combatstatus==0 /g GROUP HEAL COMING 
         /call SpellSub "Healing Wave of Prexus" 
         /varset GHealTimer 315
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
         /if "$SitAfterCast"=="1" /sit on 
         /press esc 
/return 

Sub PallyHeal
         /if n $HealTimer!=0 /return
         /if n $Combatstatus==1 /return 
         /if n $group($GroupMember)==$char(id) /press F1 
         /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember) 
         /stand 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
||| Edit Edit heal message 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
         /if n $Combatstatus==0 /g Celestial Cleansing on %t 
         /call SpellSub "Celestial Cleansing" 
         /varset HealTimer 315 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
         /if "$SitAfterCast"=="1" /sit on 
         /press esc 
/return

Sub PallyLayHands
         /if n $Combatstatus==0 /return 
         /if n $LOHTimer!=0 /return
         /if n $group($GroupMember)==$char(id) /press F1 
         /if n $group($GroupMember)!=$char(id) /target id $group($GroupMember) 
         /stand 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
||| Edit Edit heal message 
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
         /doability "107"
         /varset v88 1
         /doevents
|||  This part will set a 10 minute timer so you dont spam the group with no 
|||  LOH UP
         /if $return==99 {
         /g Sorry LoH is down at the moment
         /varset LOHTimer 6000
         /return
         }
         /g Tunare giveth me the powa to present Lay Hands for %t
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 
         /if "$SitAfterCast"=="1" /sit on 
         /press tab
/return
This is in the botcore.inc

Code: Select all

#define LOHTimer t37
#define HealTimer t38
#define CTimer t39 


The bad part is i too get stuck in a loop and have to /endmacro then i can restart it again.

Im still trying to figure that one out.

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

Loop

Post by grimjack » Fri Jul 18, 2003 3:55 am

I'll see if I can find what's wrong. I don't have any healer characters so it may be tough.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

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

Debug.

Post by grimjack » Fri Jul 18, 2003 4:24 am

Try out this inc for your spellsub. Post if any of the debug messages are coming back wrong(spell slot, cast time, ect). I made a few minor adjustments as well but nothing that should fix or break anything. I can't test this where I am and I probably won't sign on at all this week.

Code: Select all

|botspell.inc
|Bot spell routines and some spell commands.
|
|Version 1.08 with debug
|
|Commands included in this module:
|sn        Cast spell by spell name.
|mana      Report current mana to master.
|evac      Evac
|loadlist   Load spell favorite list by name.
|aftercastsit   Toggle sit after cast on/off
|
|Must have a spell favorite list named default

#event Collapse "Your gate is too unstable, and collapses."
#event FollowOff "You are no longer auto-following"
#event RootOff "Your Immobilize spell has worn off."
#event NoLOS "You cannot see your target."
#Event CastStart "You begin casting"
#Event CastFizzle "Your spell fizzles!"
#Event CastInterrupt "Your spell is interrupted."
#Event CastNoMana "Insufficient Mana to cast this spell"
#Event CastTooFar "Your target is out of range, get closer!"
#Event Recovered "You haven't recovered yet..."
#Event CastResist "Your target resisted "
#Event Distracted "You are too distracted to cast a spell now!"
#Event NoTarget "You must first select a target for this spell!"
#Event Sitting "You must be standing to cast a spell."
#Event NoMem "You do not seem to have that spell memorized."
#Event Stunned "You can't cast spells while stunned!"

|||Main spell mem/cast routine.
Sub SpellSub
   /varset Remem 0
   /sendkey up up
   /if n Combatstatus==1 /delay 3s
   /varset Fail 0
   /varset SpellName "$p0"
   :MemWait
   /varset SpellSlot "$char(gem,"$SpellName")"
   /echo Spell Slot is $SpellSlot
   /echo Negative value means gem is not ready.  Zero means spell is not memed.
   /if n $SpellSlot<0 {
      /echo Waiting for spell slot to repop
      /delay 1s
      /goto :MemWait
   }
   /if n $SpellSlot==0 {
      /echo Meming spell
      /memspell 2 "$p0"
      /varset SpellSlot 2
      /varset Remem 1
      :refreshwait
      /delay 5
      /if n $char(gem,"$SpellName")<=0 /goto :refreshwait
   }
   /varset CastTime "$spell("$SpellName",casttime)"
   /echo Spell Cast time is $spell("$SpellName",casttime)"
   /echo If this value is not being reported properly this script will malfunction.
   :BeginCast
   /varset Fail 0
   /varset DoAgain 0
   /varset StartCast 0
   /call WaitForStart
   :TimerLoop
   /doevents
   /if n $DoAgain==1 /goto :BeginCast
   /if n $Fail==1 {
      /varset Fail 0
      /return
   }
   /doevents
   /if n $DoAgain==1 /goto :BeginCast
   /if n $Fail==1 {
      /varset Fail 0
      /return
   }
   /if n $CTimer>0 /goto :TimerLoop
   /delay 2
   /doevents
   /if n $DoAgain==1 /goto :BeginCast
   /if n $Remem==1 {
      /loadspells "default"
      :loadsploop
      /delay 5
      /if $char(state)=="SIT" /goto :loadsploop
   }   
/return

|||Wait for spell to start before counting down timer.
Sub WaitForStart
   /cast $SpellSlot
   :StartLoop
   /doevents
   /if n $Fail==1 /return
   /if n $DoAgain==1 /return
   /if n $StartCast==0 {
      /goto :StartLoop
   }
   /varset CTimer "$CastTime"s
/return

|||Cast spell by name.  Uses SpellSub.
Sub Do-sn
   /assist $MasterName
   /delay 5
   /if n $strlen("$p1")<=0 {
      /return
   } else /if n $strlen("$p2")<=0 {
      /tell "$MasterName" Casting $p1 on %T
      /call SpellSub "$p1"
   } else /if n $strlen("$p3")<=0 {
      /tell "$MasterName" Casting $p1 $p2 on %T
      /call SpellSub "$p1 $p2"
   } else /if n $strlen("$p4")<=0 {
      /tell "$MasterName" Casting $p1 $p2 $p3 on %T
      /call SpellSub "$p1 $p2 $p3"
   } else {
      /tell "$MasterName" Casting $p1 $p2 $p3 $p4 on %T
      /call SpellSub "$p1 $p2 $p3 $p4"
   }
   /stand
   /if "$SitAfterCast"=="1" /sit on
   /press esc
/return

|||Report mana percent to master.
Sub Do-mana
   /dismount
   /press F1
   /tell $MasterName $char(mana,pct)m
   /press esc
/return

Sub Do-loadlist
   /if n $strlen("$p1")<=0 {
      /return
   } else {
   /loadspells "$p1"
   }
/return

Sub Do-aftercastsit
   /if n $SitAfterCast=1 {
      /varset SitAfterCast 0
      /return
   }
   /varset SitAfterCast 1
/return

|||Attempt to move to master and evac.
Sub Do-evac
   /tell $MasterName Moving to you and casting Evac!
   /call Do-moveto evac $MasterName
   /delay 2s
   /call SpellSub "Evacuate"
/return

Sub Event_CastStart
   /varset StartCast 1
/return

Sub Event_CastFizzle
   /delay 2
   /varset DoAgain 1
/return

Sub Event_CastInterrupt
   /delay 2
   /if n $Fail==1 /return
   /varset DoAgain 1
/return

Sub Event_FollowOff
   /press esc
   /press esc
   /delay 5
   /tell $MasterName Auto Follow Off.
/return

Sub Event_Sitting
   /stand
   /delay 2
   /varset DoAgain 1
/return

Sub Event_CastTooFar
   /varset Fail 1
   /tell $MasterName Too far away.
   /varset CTimer 0
/return

Sub Event_Distracted
   /tell $MasterName I can't cast. I'm too distracted.
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_NoTarget
   /varset Fail 1
   /tell $MasterName I have no target to cast on.
   /varset CTimer 0
/return

Sub Event_NoMem
   /tell $MasterName That spell is not memed.
   /varset Fail 1
   /varset CTimer 0
/return

Sub Event_RootOff
   /tell $MasterName Root has worn off.
/return

Sub Event_CastNoMana
   /tell $MasterName OOM. Medding 16 seconds and trying again.
   /sit off
   /sit on
   /delay 16s
   /sit off
   /varset DoAgain 1
/return

Sub Event_Stunned
   /tell $MasterName Stunned waiting 3 seconds to try again.
   /delay 3s
   /varset DoAgain 1
/return

Sub Event_Recovered
   /delay 2s
   /varset DoAgain 1
/return

Sub Event_CastResist
   /tell $MasterName Resisted. Trying again.
   /varset DoAgain 1
/return

Sub Event_Collapse
   /varset DoAgain 1
/return

Sub Event_NoLOS
   /tell $MasterName I can't see my target.
   /varset Fail 1
   /varset CTimer 0
/return
Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

wilddoug
orc pawn
orc pawn
Posts: 12
Joined: Tue Jul 01, 2003 11:18 am

dismount during mana check

Post by wilddoug » Sun Aug 03, 2003 2:22 pm

You should remove the /dismount from the mana check. This is no longer necessary.

wilddoug
orc pawn
orc pawn
Posts: 12
Joined: Tue Jul 01, 2003 11:18 am

Mana Check on the tens

Post by wilddoug » Mon Aug 04, 2003 12:40 am

For those of you like me that would like the Cleric to announce his mana at 50m, 60m, etc. I offer the following... Not sure if anyone is interesting in having the Cleric be this chatty, but it's nice not to have to keep asking him.

(A few definitions to keep track of the mana updates)

Code: Select all

#define CurrMana v75
#define ManaRem v76
#define LastMana v77
#define SELF F1
(Only announce mana at the tens, and only once.)

Code: Select all

Sub ManaUpdate
    |  Get current Mana Pct
    /press SELF
    /varset CurrMana $char(mana,pct)
    /varcalc ManaRem $CurrMana%10
    |  If it's divisible by 10 and different than the
    |  last check, report.
    /if n "$ManaRem"==0 {
        /if n $CurrMana!=$LastMana {
            /tell $MasterName Update-- $CurrManam
            /varset LastMana $CurrMana
        }
    }
/return
Finally, add the call to the right spot. I put it in the :mainloop, right before the /doevents:

Code: Select all

   |||Sub from botcombat.inc
   /if $Combatstatus=="1" /call RangeSub
   |  Report on mana
   /call ManaUpdate
   /doevents
   /varset CmdArrayNum 0
   /goto :MainLoop
---

BTW: If there is a vote, or a push, to move keystrokes to #defines, count me in. I'd like to see all "/press <key>" references (especially where the key is a single alphanumeric, like "d") defined for easier changability. For example, I've done a "#define SELF F1" in this posting, but in my own scripts, I use a different key for "select me". It makes it more readable, too, in my humble opinion. I may not be making myself clear here, but I'll try...

I've heavily altered my keyboard shortcuts for things, and when I take a standard script, no matter how brilliant, it takes some editing time, and trial-and-error (if I only skimmed the script) to bring it to my keyboard layout. Changing things like "/press d", to "/press DUCK" requires a single edit: "#define DUCK d". Seeing that #define, I can quickly change it to what I use, and I'm off and running... and ducking.

Let me know if I'm way offbase, or just dreaming. :)

Trick9000
decaying skeleton
decaying skeleton
Posts: 1
Joined: Mon Aug 04, 2003 11:55 pm

The original prob...

Post by Trick9000 » Mon Aug 04, 2003 11:59 pm

Heya folks,

The original problem was the person couldn't call the includes... I'm brandy new to this, about 2 days into it now, but one lil' stupid thing that made me stumble was the fact that I didn't have the 'Encoding' type right with notepad in windoze... It needed to be set & saved as 'ANSI' instead of whatever it defaulted to. It would bomb the original macro out, as soon as those calls were tested. Sounds just like the person's issue to me. ;)

Hope it helped,

Trick9000

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

Post by grimjack » Tue Aug 05, 2003 12:55 am

The original issue he was having was due to a code issue. I had comments on the same line as the includes. I removed that and it fixed the problem.

It was like this
#include botheal.inc | healer include

That caused the include to not work. I moved the comment above the line.

Something like this.
|healer include
#include botheal.inc

I think the other issue is due to $char(gem,"$SpellName") not returning -1. This should be fixed with eqmules code.

Moved v1.08 of botspell.inc to main post. Uncomment the marked sections for debug output. If the spell times are coming back wrong or the $char(gem,"SpellName") is not returning -1 when the gem is not ready, the script will malfunction. I'm not sure if eqmules -1 code is in cvs yet since I have not played in a month. Let me know if you see any problems in the script. Try to include debug output since I don't see myself playing anytime soon.
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

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

Post by grimjack » Tue Aug 05, 2003 2:25 am

Updated includes to use cast time with focus effects thanks to eqmules new code. Also added some debug lines that can be uncommented. Make sure you have the newest cvs with the spell(spellname,mycasttime) code.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack

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

Update.

Post by grimjack » Thu Aug 21, 2003 1:54 am

Updated a few things in the macro(The main script and the core include). It needs to be tested and I am not playing at the moment. Let me know if there are any problems.

I added support for multiple masters and added some comment sections.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack