Moderator: MacroQuest Developers
Code: Select all
| buffbot.mac
|
#include spell_routines.inc
#define GUILD_NAME "YourGuildHere"
#define NOT_FOUND -1
#define BUFFBOT_INI "buffbot.ini"
#define BOOL_TRUE 1
#define BOOL_FALSE 0
#Event HandleBuffRequest "#1# tells you, '#2#'"
|Buff em
Sub Buff_Player(Player, Buff, Request)
/declare RandomWait int local 0
|Is player in range? ${Spell[name].Range} just works if spell already is memmed
/if (${Spawn[${Player}].Distance} > 100) {
/echo # Debug: ${Player} asked for buff but is oor (${Spawn[${Player}].Distance})
/docommand /tell ${Player} oor
/return
}
/echo # Debug: Buffing ${Player} with ${Buff} (${Request})
/varset RandomWait ${Math.Rand[4]}
/varcalc RandomWait ${RandomWait}+1
|/echo Paranoia - Waiting ${RandomWait} seconds before resuming
/delay ${RandomWait}s
/if (!${Me.Gem[${Buff}]}) {
/memspell 1 "${Buff}"
}
/target pc ${Player}
:loop
/if (!${Me.SpellReady[${Buff}]}) {
/goto :loop
/delay 5
}
/if (${Me.Spawn.Sitting}) {
/echo # Sitting, standing up
/stand
/delay 2s
}
/call Cast "${Buff}"
/echo # Debug: Done buffing ${Player}
/return
|Handle incomming command
Sub Event_HandleBuffRequest(FullText, Player, Text)
/declare Buff string local
/declare thebuff string local
/declare AllowedBuff int local NOT_FOUND
/declare RequestedBuff string local
/declare count int local 0
/if (${Spawn[${Player}].GM}) {
/echo ***** GM ALERT! *****
/echo # GM ${Player} told me: ${Text}, exiting!
/endmacro
}
|Is player in zone?
/if (!${Spawn[${Player}].ID}) {
|/echo # Debug: ${Player} not in zone said: ${Text}
/return
}
|Checking if player is in specified guild, or in white-list
/if (${Spawn[${Player}].Guild.NotEqual[GUILD_NAME]}) {
/varset AllowedBuff ${Ini[BUFFBOT_INI, AllowedPlayers, ${Player}, BOOL_FALSE]}
/if (${AllowedBuff} == BOOL_FALSE) {
/echo # Debug: Ignoring request '${Text}' from ${Player}
/return
}
/echo # Debug: ${Player} is white listed (${AllowedBuff})
}
|Is player in line of sight?
|/if (!${Spawn[${Player}].LineOfSight}) {
| /echo # Debug: ${Player} asked for buff but is not in LoS
| /return
|}
/varset RequestedBuff ${Text}
/if (${RequestedBuff.Right[50].Equal["Sorry, I am A.F.K. (Away From Keyboard) right now."]}) /varset RequestedBuff ${RequestedBuff.Left[-50]}
/if (${RequestedBuff.Left[12].Equal["can i get a "]}) /varset RequestedBuff ${RequestedBuff.Right[-12]}
/if (${RequestedBuff.Left[10].Equal["can i get "]}) /varset RequestedBuff ${RequestedBuff.Right[-10]}
/if (${RequestedBuff.Right[13].Equal[" when you can"]}) /varset RequestedBuff ${RequestedBuff.Left[-13]}
/if (${RequestedBuff.Right[3].Equal[" ty"]}) /varset RequestedBuff ${RequestedBuff.Left[-3]}
/if (${RequestedBuff.Right[4].Equal[" plz"]}) /varset RequestedBuff ${RequestedBuff.Left[-4]}
/if (${RequestedBuff.Right[4].Equal[" pls"]}) /varset RequestedBuff ${RequestedBuff.Left[-4]}
/if (${RequestedBuff.Right[5].Equal[" pls!"]}) /varset RequestedBuff ${RequestedBuff.Left[-5]}
/if (${RequestedBuff.Right[5].Equal[" plZ!"]}) /varset RequestedBuff ${RequestedBuff.Left[-5]}
/if (${RequestedBuff.Right[4].Equal[" wmp"]}) /varset RequestedBuff ${RequestedBuff.Left[-4]}
/if (${RequestedBuff.Right[8].Equal[" please!"]}) /varset RequestedBuff ${RequestedBuff.Left[-8]}
/if (${RequestedBuff.Right[7].Equal[" please"]}) /varset RequestedBuff ${RequestedBuff.Left[-7]}
/if (${RequestedBuff.Right[4].Equal[" wmp"]}) /varset RequestedBuff ${RequestedBuff.Left[-4]}
/if (${RequestedBuff.Right[3].Equal[" =)"]}) /varset RequestedBuff ${RequestedBuff.Left[-3]}
/if (${RequestedBuff.Right[3].Equal[" :)"]}) /varset RequestedBuff ${RequestedBuff.Left[-3]}
/if (${RequestedBuff.Right[2].Equal[" )"]}) /varset RequestedBuff ${RequestedBuff.Left[-2]}
/if (${RequestedBuff.Right[1].Equal["?"]}) /varset RequestedBuff ${RequestedBuff.Left[-1]}
/if (${RequestedBuff.Length} < 1) {
/echo # Debug: too short text
/return
}
/if (${RequestedBuff.Length} > 25) {
/echo # Debug: too long text
/return
}
|Process buff request
/echo # Debug: looking for ${RequestedBuff}
/varset Buff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, ${RequestedBuff}, NOT_FOUND]}
/echo # Debug: result ${Buff}
/if (${String[${Buff}].Equal[NOT_FOUND]}) {
/echo # ${Player} asked for unknown buff: ${Text}
|/docommand /tell ${Player} unknown buff
/return
}
/if (${Buff.Equal["ALL"]}) {
/varset count ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buffcount, NOT_FOUND]}
/if (${String[${count}].Equal[NOT_FOUND]}) {
/echo # buffcount not found in INI file
/return
}
/echo # Debug: multi buff request received, ${count} buffs incoming
/docommand /tell ${Player} inc
/if (${String[${Buff}].NotEqual[NOT_FOUND]}) {
/if (${count} > 0) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff1, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
/if (${count} > 1) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff2, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
/if (${count} > 2) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff3, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
/if (${count} > 3) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff4, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
/if (${count} > 4) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff5, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
/if (${count} > 5) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff6, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
/if (${count} > 6) {
/varset thebuff ${Ini[BUFFBOT_INI, ${Me.Class.Name}, buff7, NOT_FOUND]}
/call Buff_Player ${Player} "${thebuff}" "${Text}"
}
}
/return
}
/docommand /tell ${Player} inc
/call Buff_Player ${Player} "${Buff}" "${Text}"
/return
sub Main
/declare SpellCanni outer "Pained Memory"
/declare SpellHoT outer "Breath of Trushar"
/declare CanniGem outer gem3
/declare HoTGem outer gem1
/echo mini-buffbot 2.0 started
/tgb on
:MyMainLoop
/doevents
| Cann for mana if we are Shaman
/if (${Me.Class.Name.Equal[Shaman]}) {
/if (${Me.PctMana} < 70 && ${Me.CurrentHPs} > 2600 && ${Me.AltAbilityReady[47]}) {
/target clear
/delay 2
/target myself
/call cast ${SpellHoT} ${HoTGem} 5s
/gsay Canni5
/aa act Cannibalization
/delay 3s
}
/if (${Me.PctMana} < 70 && ${Me.CurrentHPs} > 2600 && ${Me.SpellReady[${SpellCanni}]}) /call cast ${SpellCanni} ${CanniGem} 6s
}
/delay 1s
/goto :MyMainLoop
/returnCode: Select all
[AllowedPlayers]
1stFriendName=1
2ndFriendName=1
[Enchanter]
buffme=ALL
buffcount=5
buff1=Clairvoyance
buff2=Speed of Salik
buff3=Rune of Zebuxoruk
buff4=Levitation
buff5=Everlasting Breath
speed=Speed of Salik
haste=Speed of Salik
salik=Speed of Salik
gspeed=Vallon's Quickening
ghaste=Vallon's Quickening
c=Clairvoyance
C=Clairvoyance
c6=Clairvoyance
C6=Clairvoyance
clairty=Clairvoyance
c3=Kodiac's Endless Intellect
C3=Kodiac's Endless Intellect
mr=Guard of Druzzil
guard=Guard of Druzzil
mresist=Guard of Druzzil
rune=Rune of Zebuxoruk
qrune=Mayhem
minirune=Mayhem
inv=Cloud of Indifference
invis=Cloud of Indifference
lev=Levitation
eb=Everlasting Breath
[Shaman]
buffme=ALL
buffcount=5
buff1=Wunshi's Focusing
buff2=Spirit of Fortitude
buff3=Spirit of Sense
buff4=Spirit of Might
buff5=Spirit of Perseverance
wunchi=Wunshi's Focusing
wunshi=Wunshi's Focusing
wunshis=Wunshi's Focusing
wunshi's=Wunshi's Focusing
sushi=Wunshi's Focusing
focus=Wunshi's Focusing
fokus=Wunshi's Focusing
7=Wunshi's Focusing
beg=Wunshi's Focusing
buffs=Wunshi's Focusing
buff=Wunshi's Focusing
focus me bitch=Wunshi's Focusing
W=Wunshi's Focusing
Woushie=Wunshi's Focusing
sta=Spirit of Fortitude
stamina=Spirit of Fortitude
fort=Spirit of Fortitude
fortitude=Spirit of Fortitude
boar=Spirit of Fortitude
s=Spirit of Fortitude
groupfort=Talisman of Fortitude
gfort=Talisman of Fortitude
regen=Spirit of Perseverance
reg=Spirit of Perseverance
dex=Spirit of Daiku
daiku=Spirit of Daiku
might=Spirit of Might
str=Spirit of Might
strength=Spirit of Might
sense=Spirit of Sense
sos=Spirit of Sense
agi=Spirit of Sense
agility=Spirit of Sense
inv=Invisibility
invis=Invisibility
fa=Ferine Avatar
avatar=Ferine Avatar
heal=Yoppa's Mending
bot=Breath of Trushar
hot=Breath of Trushar
qheal=Breath of Trushar
hott=Breath of Trushar
haste=Swift Like the Wind
thaste=Talisman of Alacrity
tot=Talisman of the Tribunal
dr=Talisman of the Tribunal
pr=Talisman of the Tribunal
resist=Talisman of the Tribunal
resists=Talisman of the Tribunal
talisman of tribunal=Talisman of the Tribunal
tribunal=Talisman of the Tribunal
trib=Talisman of the Tribunal
sow=Spirit of Bih`Li
billy=Spirit of Bih`Li
bihli=Spirit of Bih`Li
shrink=Shrink
shrinkall=Tiny Terror
cure=Remove Greater Curse
ios=Infusion of Spirit
lev=Levitation
leo=Spirit of the Leopard
leopard=Spirit of the Leopard
[Cleric]
buffme=ALL
buffcount=2
buff1=Conviction
buff2=Blessing of Devotion
con=Conviction
conv=Conviction
virt=Conviction
hp=Conviction
Sym=Symbol of Balikor
symbol=Symbol of Balikor
bali=Symbol of Balikor
kazad=Symbol of Balikor
bor=Blessing of Devotion
bod=Blessing of Devotion
heal=Pious Light
ch=Complete Healing
[Druid]
buffme=ALL
buffcount=2
buff1=Stealoak Skin
buff2=Protection of Seasons
po9=Steeloak Skin
pot9=Steeloak Skin
9=Steeloak Skin
nine=Steeloak Skin
pot10=Steeloak Skin
steeloak=Steeloak Skin
steelowk=Steeloak Skin
steeloak skin=Steeloak Skin
ss=Steeloak Skin
skin=Steeloak Skin
steel=Steeloak Skin
oak=Steeloak Skin
soe=Spirit of Eagle
eagle=Spirit of Eagle
spirit of eagle=Spirit of Eagle
spirit of eagles=Spirit of Eagle
foe=Flight of Eagles
flight of eagle=Flight of Eagles
flight of eagles=Flight of Eagles
pos=Protection of Seasons
season=Protection of Seasons
seasons=Protection of Seasons
str=Nature's Might
natures might=Nature's Might
eb=Everlasting Breath
ds=Nettle Shield
regen=Oaken Vigor
sow=Spirit of Wolf
spirit of wolf=Spirit of Wolf