I added a page on the Wiki about memming spells, the first explanation is fine, but the one about the stalling needs to be fixed to something else that actually works if the macro stalls while memming spells, since I can get the macro to continue by manualle memming the spell whenever it stalls.
[[Memming_a_spell]]
the other thing is simply a question about how can I check if a grpmember is there, and what there hp is WITHOUT using /keypress F1 F2 F3 and so on and then doing a hpcheck, is there a way to do it without actually targetting them?
Code: Select all
| buffbot.mac
|
#include spell_routines.inc
#define GUILD_NAME "guildname"
#define NOT_FOUND -1
#define BUFFBOT_INI "buffbot.ini"
#define BOOL_TRUE 1
#define BOOL_FALSE 0
#Event Invited "#*#To join the group, click on the 'FOLLOW' option, or 'DISBAND' to cancel#*#"
#Event maloon "#1# tells you, 'malo on'"
#Event malooff "#1# tells you, 'malo off'"
#Event slowon "#1# tells you, 'slow on'"
#Event slowoff "#1# tells you, 'slow off'"
#Event cripon "#1# tells you, 'crip on'"
#Event cripoff "#1# tells you, 'crip off'"
#Event status "#1# tells you, 'status'"
#Event exp "#*#You gain #*# Experience#*#"
#Event incoming "#1# tells you, 'incoming #2#'"
#Event malo "#*#uncomfortable."
#Event slow "#*#yawns."
#Event crip "#*#looks frail."
#Event gate "#1# tells you, 'gate'"
#Event HandleBuffRequest "#1# tells you, '#2#'"
sub Main
/echo Shaman Box 1.5 started
/declare SpellCanni outer "Cannibalize III"
/declare SpellHoT outer "Stoicism"
/declare Spellcrip outer "Incapacitate"
/declare Spellslow outer "Turgur's Insects"
/declare Spellmalo outer "Malosi"
/declare SpellHeal outer "Chloroblast"
/declare SlowGem outer gem2
/declare HealGem outer gem3
/declare CanniGem outer gem4
/declare MaloGem outer gem5
/declare CripGem outer gem6
/declare HoTGem outer gem7
/declare malo int outer
/declare slow int outer
/declare crip int outer
/declare incoming int outer
/declare maloed int outer
/declare slowed int outer
/declare cripled int outer
/declare targetname string outer
/declare assistname string outer
:mainLoop
/if (${Me.Standing} && !${Me.Mount.ID}) /sit
/doevents
/if (${incoming}==1) /goto :incoming
/if (${Me.Buff[Stoicism].ID} && ${Me.PctHPs} < 50) {
/target myself
/delay 1s
/call cast ${SpellHeal} ${HealGem} 4s
}
/if (!${Me.Buff[Stoicism].ID} && ${Me.PctHPs} < 70) {
/target myself
/delay 1s
/call cast ${SpellHoT} ${HoTGem} 5s
}
/if (${Me.PctMana} < 90 && ${Me.CurrentHPs} > 700 && ${Me.SpellReady[${SpellCanni}]}) {
/call cast ${SpellCanni} ${CanniGem} 6s
}
/goto :mainLoop
:incoming
/if (${incoming}==1) {
/docommand /assist ${assistname}
/delay 1s
/pet attack
/if (${slow} == 1 && ${slowed} == 0) /goto :slow
:slowed
/if (${malo} == 1 && ${maloed} == 0) /goto :malo
:maloed
/if (${crip} == 1 && ${cripled} == 0) /goto :crip
:cripled
}
/if (${Target.ID}==NULL) {
/varset incoming 0
/varset maloed 0
/varset slowed 0
/varset cripled 0
}
/varset incoming 0
/goto :mainloop
:slow
/if (${slowed}==1) {
/docommand /gsay ${targetname} has been Slowed
/docommand /say ${targetname} has been Slowed
/varset slowed 0
/goto :slowed
}
/if (!${slowed}==1) {
/call cast ${Spellslow} ${SlowGem} 6s
/doevents
/delay 1s
/goto :slow
}
:malo
/if (${maloed}==1) {
/docommand /gsay ${targetname} has been Maloed
/docommand /say ${targetname} has been Maloed
/varset maloed 0
/goto :maloed
}
/if (!${maloed}==1) {
/call cast ${Spellmalo} ${MaloGem} 5s
/doevents
/delay 1s
/goto :malo
}
:crip
/if (${cripled}==1) {
/docommand /gsay ${targetname} has been Cripled
/docommand /say ${targetname} has been Cripled
/varset cripled 0
/goto :cripled
}
/if (!${cripled}==1) {
/call cast ${Spellcrip} ${CripGem} 6s
/doevents
/delay 1s
/goto :crip
}
/goto :mainloop
Sub Event_exp
/tell name I have ${Me.PctMana}% Mana and I am ${Me.PctExp}% into lvl ${Me.Level}
/return
Sub Event_Invited
/invite
/return
Sub Event_cripon
/varset crip 1
/return
Sub Event_cripoff
/varset crip 0
/return
Sub Event_maloon
/varset malo 1
/return
Sub Event_malooff
/varset malo 0
/return
Sub Event_slowon
/varset slow 1
/return
Sub Event_slowoff
/varset slow 0
/return
Sub Event_incoming(FullText, Player, Incomingtarget)
/varset assistname ${Player}
/varset targetname ${Incomingtarget}
/varset incoming 1
/return
Sub Event_slow
/varset slowed 1
/return
Sub Event_malo
/varset maloed 1
/return
Sub Event_crip
/varset cripled 1
/return
Sub Event_status(Fulltext, Player)
/if (${malo} == 1 && ${slow} == 1 && ${crip} == 1) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Enabled & Slow is Enabled & Criple is Enabled
} else
/if (${malo} == 1 && ${slow} == 0 && ${crip} == 1) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Enabled & Slow is Disabled & Criple is Enabled
} else
/if (${malo} == 0 && ${slow} == 1 && ${crip} == 1) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Disabled & Slow is Enabled & Criple is Enabled
} else
/if (${malo} == 0 && ${slow} == 0 && ${crip} == 1) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Disabled & Slow is Disabled & Criple is Enabled
}
/if (${malo} == 1 && ${slow} == 1 && ${crip} == 0) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Enabled & Slow is Enabled & Criple is Disabled
} else
/if (${malo} == 1 && ${slow} == 0 && ${crip} == 0) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Enabled & Slow is Disabled & Criple is Disabled
} else
/if (${malo} == 0 && ${slow} == 1 && ${crip} == 0) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Disabled & Slow is Enabled & Criple is Disabled
} else
/if (${malo} == 0 && ${slow} == 0 && ${crip} == 0) {
/docommand /tell ${Player} I have ${Me.PctMana}% Mana - Malo is Disabled & Slow is Disabled & Criple is Disabled
}
/return
Sub Event_gate
|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 whitelisted (${AllowedBuff})
}
/if (!${Me.Gem[Gate]}) {
/memspell 8 "Gate"
}
:loop
/if (!${Me.SpellReady[Gate]}) {
/goto :loop
}
/if (${Me.Spawn.Sitting}) {
/stand
/delay 1s
}
/call Cast "Gate"
/return
|Handle incomming command
Sub Event_HandleBuffRequest(FullText, Player, Text)
/declare RandomWait int local 0
/declare CheckStr string local
/declare AllowedBuff int local NOT_FOUND
/declare RequestedBuff string local
/declare i int local 0
/declare j int local 0
/if (${Spawn[${Player}].GM}) {
/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 whitelisted (${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[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[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 request
/varset CheckStr ${Ini[BUFFBOT_INI, RecognizedBuffs, ${RequestedBuff}, NOT_FOUND]}
/if (${String[${CheckStr}].Equal[NOT_FOUND]}) {
|/echo # ${Player} asked for unknown buff: ${Text}
|/docommand /tell ${Player} unknown buff
/return
} else {
|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})
/return
}
/echo # Debug: Buffing ${Player} with ${CheckStr} (${Text})
/docommand /tell ${Player} inc ${CheckStr}
/varset RandomWait ${Math.Rand[4]}
/varcalc RandomWait ${RandomWait}+1
|/echo Paranoia - Waiting ${RandomWait} seconds before resuming
/delay ${RandomWait}s
/if (!${Me.Gem[${CheckStr}]}) {
/memspell 8 "${CheckStr}"
}
/target pc ${Player}
:loop
/if (!${Me.SpellReady[${CheckStr}]}) {
/goto :loop
}
/if (${Me.Spawn.Sitting}) {
|/echo # Sitting, standing up
/stand
/delay 1s
}
/call Cast "${CheckStr}"
/echo # Debug: Done buffing ${Player}
}
/return
|Codebox
|/if (${Me.PctMana} < 90 && ${Me.CurrentHPs} > 700 && ${Me.AltAbilityReady[47]}) {
|/aa act Cannibalization



