This ISN'T GOLD CODE BY ANY MEANS. This is sorta beta. I wouldnt recommend leaving your game unattended for more than 15 minutes (record time without screwing up is little over 3 hours). When I update the code, I will post the updates on this thread.
So here is the feature list:
- Pulls one of two different kinds of mob (whichever closer) (you specify)
- Obstacle dodging (you have to get used to it)
- Auto-Autoattack (you kick, follow mob, etc)
- Auto-SoW casting
- Auto-Pet and Pet Proc casting
- Anti-add (there are problems with the logic and I need to overhaul). At the end of my post I will show an image of how it works.
(the camp when killed is broken at this point in time)
Quick warning: I cleaned up some of the code and took out static references and replaced them with variable-based references (so you only need to change things in one spot). I haven't tested the code yet, but if you find problems with the execution reply to this thread and let me know =).
The code:
Code: Select all
| Usage: /macro blpull <clericname>
| Originally designed for beastlords in their mid-30s
|
| Note: Your Home Location (anchor) is the loc you start
| the macro from. So.. position yourself accordingly before
| running.
|
| DANGER, DANGER WILL ROBINSON!!! This WILL send text to
| chat chan #1 AND group. This will also send automated
| tells to your cleric every so many seconds asking if
| ready for pull (rfp). You have been warned...
|
| Currently only pulls the closest of two different mob names
| This is by no means the final version however since I wished
| for an automatic pull macro, and this is the best one I know
| of (at least for my purposes),
|
| Code shamelessly stolen from all over. I did come up with
| the obstacle-dodging routine though =). Not sure how
| it might look to others in the group =).
|
| For best results, try with levitate and having been
| shrunk to the max
|
| There are some issues with the anti-add logic.
|
| FYI, script relies on mobs AGGROING. This does not cast a
| spell on the mobs, only runs to them and runs back if they
| do not follow the first time.
|
| Please read the thread this was posted on for more details, especially
| about how the anti-add works so far.
#turbo
#chat tell
#event Fizzle "Your spell fizzles!"
#event Interrupted "Your spell is interrupted"
#event InfernoWearOff "Your pet's Spirit of Inferno"
#event SpellSuccess "You begin casting"
|||||||||||||||!!!!!!!CHANGE ME!!!!!!!!!!!!||||||||||||||
#define ENEMYTYPEA "rhino"
#define ENEMYTYPEB "underbulk"
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub Main
/declare CheckIfMobHereTimer timer
/declare WarderName global
/declare WarderBuff global
/declare aggrodistance global
/declare varMobTypeA global
/declare varMobTypeB global
|||||||||||||||||*******CHANGE ME********|||||||||||||||||
/varset WarderName "Spirit of Herikol"
/varset WarderBuff "Spirit of Inferno"
/varset aggrodistance 100
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
/declare xhomeloc global
/declare yhomeloc global
/declare groupcleric global
/varset xhomeloc $char(x)
/varset yhomeloc $char(y)
/varset groupcleric @Param0
/echo MQ home loc set to @yhomeloc @xhomeloc
/declare rfp global
/declare AskTimer timer
:Loop
/if n @AskTimer<=1 {
/tell "@groupcleric" rfp
/varset AskTimer 43s
}
/varset rfp 0
/doevents
/if @rfp==0 /goto :loop
/call CheckPet
/varset rfp 1
/attack off
:Pull
/call SelectTarget
/call RunToMob
/call GoToHomeLocation
| The combat on <charname> is useful for other bots in your channel (especially
| ones with Xylobot who need combat casting mode on. Comment it out if you
| don't like it.
/1 combat on $char(name)
/pet back off
/face
/delay 6s
/if n $target(distance)>100 /goto :Pull
/call AttackAndFollow
/doevents flush
/if n $distance(@yhomeloc,@xhomeloc)>50 /call GoToHomeLocation
/press f1
/if n $char(buff,"Spirit of Wolf")==0 /call Cast_Spirit_Of_Wolf
/goto :Loop
/return
|
| Messy, yes I know. Live with it for now I guess =P
|
Sub RunToMob
/if n $target(id)==0 /return
/echo In RunToMob
/varset CheckIfMobHereTimer 6s
:CloserAF
/if n @CheckIfMobHereTimer<=1s {
/if n $distance(@yhomeloc,@xhomeloc)<=60 /return
}
/if n $target(distance)>$calc(@aggrodistance-5) /sendkey down up
/if n $target(distance)<$calc(@aggrodistance/3) /sendkey up up
/face fast
/sendkey down right
/delay 7
/sendkey up right
/if n $target(distance)<$calc(@aggrodistance/3) /return
/face fast
/if n $target(distance)<$calc(@aggrodistance/3) /return
/delay 10
/if n $target(distance)<$calc(@aggrodistance/3) /return
/delay 10
/if n $target(distance)<$calc(@aggrodistance/3) /return
/delay 10
/if n $target(distance)<$calc(@aggrodistance/3) /return
/delay 10
/if n $target(distance)<$calc(@aggrodistance/3) /return
/sendkey down left
/delay 7
/sendkey up left
/face fast
/if n $target(distance)<$calc(@aggrodistance/2*3) /return
/call SelectTarget
/goto :CloserAF
/return
|
| Messy, yes I know. Live with it for now I guess =P
|
Sub GoToHomeLocation
/if n $target(id)==0 /return
/echo in GoToHomeLocation
/sendkey down up
:gohomeloop
/face fast loc @yhomeloc, @xhomeloc
/pet back off
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/sendkey down left
/delay 7
/sendkey up left
/pet back off
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/face fast loc @yhomeloc, @xhomeloc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/delay 5
/pet back off
/if n $distance(@yhomeloc,@xhomeloc)<25 /goto :DoneWithGoToLoc
/sendkey down right
/delay 7
/sendkey up right
/pet back off
/face fast loc @yhomeloc, @xhomeloc
/if n $distance(@yhomeloc,@xhomeloc)>25 /goto :gohomeloop
:DoneWithGoToLoc
/sendkey up up
/return
Sub AttackAndFollow
/attack on
/delay 10s
/pet attack
:AttackLoop
/if n $target(distance)<18 /doability kick
/face fast
/if n $target(distance)>15 /sendkey down up |If target is > 18 move forward
/if n $target(distance)<4 /sendkey down down |If target is < 4 move back
/if n $target(distance)<10 /sendkey up up |If target is < 10 stop moving fwd
/if n $target(distance)>10 /sendkey up down |If target is > 12 stop moving back
/if n "$target()"=="TRUE" /goto :AttackLoop
/sendkey up up
/sendkey up down
/return
Sub SelectTarget
/declare targetdistance local
:SelectTarget
/press esc
/target npc ENEMYTYPEA
/varset targetdistance $target(distance)
/target npc ENEMYTYPEB
/if "$target()"!="TRUE" /goto :SelectTarget
/if n $target(distance)<@targetdistance {
/g Pulling %t
}
/if n $target(distance)>=@targetdistance {
/target npc ENEMYTYPEA
/g pulling %t
}
/varset targetdistance $target(distance)
:losetarget
/press esc
/echo dropping target
/if n $target(id)!=0 /goto :losetarget
/target npc "ENEMYTYPEA" range $calc(@targetdistance+10) $calc(@targetdistance+101)
/target npc "ENEMYTYPEB" range $calc(@targetdistance+10) $calc(@targetdistance+101)
/if n $target(id)!=0 {
/echo Found something in aggro range
/delay 4s
/g momentarily stopped to prevent adds.
/if n $distance(@yhomeloc,@xhomeloc)<25 {
/echo too close to home
/press esc
/return
}
/goto :SelectTarget
}
/target npc ENEMYTYPEA
/varset targetdistance $target(distance)
/target npc ENEMYTYPEB
/if n $target(distance)>=@targetdistance {
/target npc ENEMYTYPEA
/echo selected closest target
}
/return
Sub Cast_Spirit_Of_Wolf
{
/declare spellstatus local
/varset spellstatus 0
/if n $char(gem,"Spirit of Wolf")==0 /memspell 2 "Spirit of Wolf"
/delay 10
/target myself
:CastingSoW
/cast "Spirit of Wolf"
/delay 10
/doevents
/if n $char(buff,"Spirit of Wolf")!=0 {
/varset spellstatus 1
/return
}
/if n @spellstatus==0 /goto :CastingSoW
/return
}
Sub Event_chat(ChatType,Sender,ChatText)
| /declare SenderVar local
/declare ChatTextVar local
| /varset SenderVar $lcase("@Sender")
/varset ChatTextVar "$lcase("@ChatText")"
/if "@ChatTextVar"=="hold" {
/varset rfp 0
}
/if "@ChatTextVar"=="ready" {
/varset rfp 1
}
/return
Sub CheckPet
/stand
/press esc
/if n $char(pet)==0 {
/if n $char(gem,"@WarderName")==0 {
/memspell 4 "@WarderName"
/delay 8s
}
:castpet
/cast "@WarderName"
/doevents Fizzle
/if "$return"=="cast_fizzle" /goto :castpet
/doevents Interrupted
/if "$return"=="cast_interrupted" /goto :castpet
/delay 8s
/pet guard
/if n $char(gem,"@WarderBuff")==0 {
/memspell 5 "@WarderBuff"
/delay 8s
}
/call Event_InfernoWearOff
}
/return
Sub Event_InfernoWearOff
:castinferno
/cast "@WarderBuff"
/doevents
/if "$return"=="spell_success" {
/delay 8s
/return
}
/goto :castinferno
/return
Sub Event_Interrupted
/return cast_interrupted
Sub Event_Fizzle
/return cast_fizzle
Sub Event_SpellSuccess
/return spell_success

(last edited the code 3:32 pst 03/06/04 [fixed lots of run-time errors - sorry about that but didnt have a way of testing at the time])


