Moderator: MacroQuest Developers
Code: Select all
Sub CasterHealCode: Select all
Sub CasterHeal(param0)Code: Select all
/call ChatOut 5 @MasterName "@PatchHealMsg $target(name)"Code: Select all
Sub Event_Zoned
/varset IsAnchored 0
/varset ForBuffsZoned 1
/sendkey up up
/returnCode: Select all
#Event Zoned "LOADING, PLEASE WAIT..."Code: Select all
#Event Zoned "You have entered"Code: Select all
|genbot.mac
|Generic bot macro for any class.
|Version 9.0
|Date:12/30/2003 1:00am
|
|
|
|
#define personal-array 0
#define botcore-array 1
#define botcombat-array 2
#define botspell-array 3
#define bothealer-array 4
#define botbuffs-array 5
#include botcore.inc
#include botspell.inc
#include botcombat.inc
#include bothealer.inc
#include botbuffs.inc
#include personal.inc
#turbo 40
Sub Main
/zapvars
/declare MasterCount global
/declare ArrayCore global
/declare ArraySpell global
/declare ArrayComb global
/declare ArrayHeal global
/declare ArrayBuffs global
/declare ArrayPers global
/declare IniFile global
/varset IniFile "genbot_"
/varcat IniFile $char(name)
/varcat IniFile ".ini"
|Core variables
/call SetupCoreVars
|Spell Module Variables
/call SetupSpellVars
|Combat Module Variables.
/call SetupCombatVars
|Healer Module Variables.
/call SetupHealerVars
|Buffs Module Variables.
/call SetupBuffsVars
|Personal Module Variables.
/call SetupPersonalVars
/if $defined(Param0)==FALSE {
/echo Usage: /macro generic <Master Name1> <Master Name2>...
/endmacro
}
/varset MasterCount 0
:MasterLoop
/if $defined(Param$int(@MasterCount))==TRUE {
/varset MName($int(@MasterCount)) @Param$int(@MasterCount)
/varadd MasterCount 1
/goto :MasterLoop
}
/varsub MasterCount 1
/varset MasterName @MName(0)
|||This is where the commands the bot can take is set up
/call CoreCommands
/call SpellCommands
/call CombatCommands
/call HealerCommands
/call BuffsCommands
/call PersonalCommands
:MainLoop
/doevents
|||Sub from bothealer.inc
/call CheckGrpHealth
||| Sub From bothealer.inc
/call PalGrpHealChk
||| Sub From bothealer.inc
/call PalHealChk
|||Sub from botbuffs.inc
/call CheckBuffs
|||Sub from botcombat.inc
/if n @Combatstatus==0 {
/if n $DoTraps==1 /call TrapFinder
}
/if n @DoArchery!=1 {
/if n @Combatstatus==1 /call RangeSub
}
/if n @Combatstatus==1 /call MeleeAbility
/if n @Combatstatus!=1 {
/if n @Supportstatus!=1 {
/if n @IsAnchored==0 {
/if n @Afollow==1 {
/target @FollowTarget
/call Do-moveto foo @FollowTarget
}
}
}
/if n @IsAnchored==1 {
/if n $distance(@AnchorX,@AnchorY)>@AnchorRadius {
/call MoveToAnchor
} else /if n @SitAfterCast==1 {
/if $char(state)==STAND /sit
}
}
}
/if $combat==TRUE {
/if $target()==TRUE {
/if "$target(name,clean)"!="$char(name)" {
/if n @AutoEngage==1 /varset Combatstatus 1
}
}
}
/call PersonalMain
/doevents
/varset CmdArrayNum 0
/goto :MainLoop
/returnCode: Select all
|botbuffs.inc
|Bot buff checking module.
|Version 1
|Date:1/1/2004
|
|
|
|Requires botspell.inc
Sub BuffsCommands
/varset Commands(5,0) CheckBuffs
/varset ArrayBuffs 0
/return
Sub TellCmds-buffs
/declare counter local
/declare cmds local
/varset cmds ""
/for counter 0 to @ArrayBuffs
/varcat cmds "@Commands(5,@counter), "
/next counter
/call ChatOut 2 @MasterName "@cmds."
/return
Sub SetupBuffsVars
/declare CmdList-buffs global
/declare generalbuffs array
/declare combatbuffs array
/declare askoncebuff global
/declare ForBuffsZoned global
/varset ForBuffsZoned 1
/for tempvar 1 to 10 {
/varset generalbuffs(@tempvar) "$ini(@IniFile,"Buffs",generalbuffs@tempvar)"
/if "@generalbuffs(@tempvar)"=="NOTFOUND" {
/ini "@IniFile" "Buffs" "generalbuffs@tempvar" "none"
/varset generalbuffs(@tempvar) "none"
}
}
/next tempvar
/for tempvar 1 to 10 {
/varset combatbuffs(@tempvar) "$ini(@IniFile,"Buffs",combatbuffs@tempvar)"
/if "@combatbuffs(@tempvar)"=="NOTFOUND" {
/ini "@IniFile" "Buffs" "combatbuffs@tempvar" "none"
/varset combatbuffs(@tempvar) "none"
}
}
/next tempvar
/varset askoncebuff "$ini(@IniFile,"Buffs",askoncebuff)"
/if "@askoncebuff"=="NOTFOUND" {
/ini "@IniFile" "Buffs" "askoncebuff" "none"
/varset askoncebuff "none"
}
}
/return
Sub checkcombatbuffs
/declare count local
/for count 1 to 10
/if "@combatbuffs(@count)"!="none" /call checkabuff "@combatbuffs(@count)"
/next count
/return
Sub checkgeneralbuffs
/declare count local
/for count 1 to 10
/if "@generalbuffs(@count)"!="none" /call checkabuff "@generalbuffs(@count)"
/next count
/return
Sub checkaskoncebuff
/if n ForBuffsZoned==1 {
/varset ForBuffsZoned 0
/if "@askoncebuff"!="none" {
/call checkabuff "@askoncebuff"
}
}
/return
Sub checkabuff(listtocheck)
|buffs that are fading soon
/if $char(buff,$char(buff,"@listtocheck"),duration)<=1 {
/if $char(book,"@listtocheck")==NULL {
/Call ChatOut 9 @MasterName "My @listtocheck fades in $char(buff,$char(buff,"@listtocheck"),durationsecs)"
/Call ChatOut 5 @MasterName "snme @listtocheck"
/delay 50
/return
}
/call spellsub "@listtocheck"
/return
}
}
| buffs we are just outright missing atm
/if $char(buff,"@listtocheck")==0 {
/if $char(book,"@listtocheck")==NULL {
/Call ChatOut 5 @MasterName "snme @listtocheck"
:WaitForBuff
/delay 5s
/if $char(buff,"@listtocheck")==0 /goto :WaitForBuff
/return
}
| we cast this one ourselves
/declare buffsoldtarg local
/varset buffsoldtarg $target(id)
/target myself
/call spellsub "@listtocheck"
/target $spawn(@buffsoldtarg,name)
/return
}
/return
Sub CheckBuffs
/Call checkgeneralbuffs
/if $combat==TRUE /Call CheckCombatBuffs
/if n ForBuffsZoned==1 /call Checkaskoncebuffs
/returnCode: Select all
#Event SkillUp "You have become better at"
Sub Event_SkillUp(SkillUpText)
/declare ParseSkillLevel local
/declare ParseSkill local
/declare PositionStart local
/declare PositionEnd local
/varset PositionStart $calc($instr("! (","@SkillUpText")+3)
/varset PositionEnd $instr(")","@SkillUpText")
/varset ParseSkillLevel $mid(@PositionStart,$calc(@PositionEnd-@PositionStart),"@SkillUpText")
/varset PositionStart $instr("You have become better at ","@SkillUpText")
/varset PositionEnd $instr("! (","@SkillUpText")
/varset ParseSkill $mid(@PositionStart,$calc(@PositionEnd-@PositionStart),"@SkillUpText")
/call ChatOut 5 "@MasterName" "@ParseSkill increased - @ParseSkillLevel ..."
/if n @ParseSkillLevel==$calc($calc($char(level)*5)+5) {
/call ChatOut 5 "@MasterName" "@ParseSkill maxed for level - @ParseSkillLevel ... woo!"
/if n @ParseSkillLevel==235 {
/call ChatOut 5 "@MasterName" "@ParseSkill maxed forever! - 235 is max!"
}
}
/return
param0 is implied. those changes aren't needed unless I'm mistakenMcTisuk wrote: There seems to be something wierd anyhow, in the group healing check routine, it passes thru to casterheal or tankheal or whatever. It tries to pass a paramater, the targid of the person to heal. The called routines, casterheal and so on, don't have parameters, so I kept getting param0 = null ...
changetoCode: Select all
Sub CasterHealdo the same forCode: Select all
Sub CasterHeal(param0)
Sub TankHeal
Sub PallyHeal
Sub Patchheal
maybe others. I thought for a while param0 was "implied" if you had no params, but I echo'd param0 on entering each and always got null .. ie, we pass in nothing, then try and heal that person.
look in personal.inc more specifically at the do-bp sub.leetenc01 wrote:was wondering, since im a fairly big newb to MQ heh, where in this would i need to edit to make my bot cast an item for his spell. Like if my wiz bot had epic and i wanted buff1 to be click staff of the four. Just putting buff one as the item name didnt work
I figured, since the code worked sometimes, that they were implied - it works sometimes for me.param0 is implied. those changes aren't needed unless I'm mistaken
edit: I just asked and confirmed that it was implied.
untested, not running eq atm, but here's my suggested change to implement the delay, not including your altered faces :w00tz0r wrote: In botcore.inc
Sub MoveToAnchor
<snipped>
Is there a way to make the script cause the bot when returning to face in a little bit random direction? Or place a random pause between killing the mob and returning?
Basically just to make it appear more humanlike.
Code: Select all
Sub MoveToAnchor
[color=darkred]/declare donedelay local
/varset donedelay 0[/color]
/varset MyXLoc $char(x)
/varset MyYLoc $char(y)
/varset countdown 0
:AnchorMoveLoop
/if @IsAnchored==0 {
/sendkey up up
/return
}
/doevents
/if n @Combatstatus==1 {
/sendkey up up
/return
}
[color=darkred] /if n @donedelay==0 {
| alter 50 to be suitable "longest"delay before bot moves.
/delay $rand(50)
/varset donedelay 1
}[/color]
/if "$char(state)"=="SIT" /stand