addition to genbot to report lost buffs

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

Hmmmm
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Jul 18, 2004 11:51 am

addition to genbot to report lost buffs

Post by Hmmmm » Sun Aug 01, 2004 10:22 am

My gimp warror bot kept losing buffs so I added this so that he would tell me when they droped. Works pretty well and doesn't seem to effect the preformance of genbot.

Add two lines to Init-Personal to setup the vars. (3 if you include the comment)

Code: Select all

Sub Init-Personal
   /declare cmds-PERSONAL string outer Personal:

   /echo Started CheckBuffs v0.3
   /declare myBuffs[16,2] string outer
   /Call fnBuffGetCurren

Add these two lines to PersonalMain

Code: Select all

Sub PersonalMain
   /Call fnBuffCheckDroped
   /Call fnBuffGetCurrent
/return

Add these functions to the bottom.

Code: Select all

Sub fnBuffCheckDroped

   /declare TmpA int local
   /declare buffStr string local
   /declare buffTellNeeded int local

   /varset buffTellNeeded 0

   /for TmpA 1 to 16
      |/echo ${TmpA} :  ${myBuffs[${TmpA},1]} -- ${Me.Buff[${myBuffs[${TmpA},1]}]} -- ${Me.Buff[${myBuffs[${TmpA},1]}].ID}
      /if (${myBuffs[${TmpA},2]}) {
         /if (!${Me.Buff[${myBuffs[${TmpA},1]}].ID}) {
            |/echo Buff Droped - ${myBuffs[${TmpA},1]}
            /varset buffStr ${buffStr} ${myBuffs[${TmpA},1]},
            /varset buffTellNeeded 1
         }
      }
   /next TmpA

   ||/if (${buffTellNeeded}) /echo Lost these effects : ${buffStr}
   /if (${buffTellNeeded}) /tell ${MasterName} Hook a brother up: ${buffStr}

/return

Sub fnBuffGetCurrent

    /declare TmpA int local
    /for TmpA 1 to 16
       /if (${Me.Buff[${TmpA}].ID}) {
           /varset myBuffs[${TmpA},1] ${Me.Buff[${TmpA}]}
           /varset myBuffs[${TmpA},2] 1
       } else {
           /varset myBuffs[${TmpA},1] NULL
           /varset myBuffs[${TmpA},2] 0
       }
    /next TmpA

/return