Post your completed (working) macros here. Only for macros using MQ2Data syntax!
Moderator: MacroQuest Developers
-
aChallenged1
- a grimling bloodguard

- Posts: 1804
- Joined: Mon Jun 28, 2004 10:12 pm
Post
by aChallenged1 » Sat Jan 01, 2005 10:50 am
Code: Select all
:KillAdds
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget}) /call CombatSub
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/if (${RV_DisplayStats}) /call DisplayStats
/call ResetSub
change to
Code: Select all
:KillAdds
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget}) /call CombatSub
/if (${RV_HasTarget}) /call MoveToMob
| /if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/if (${RV_DisplayStats}) /call DisplayStats
/call ResetSub
all you do is remove the call to the sub
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
That's just fast and dirty and allows you to put it back in later easily
Corrected the above to remove entire line instead of just the end.
Last edited by
aChallenged1 on Sat Jan 01, 2005 1:45 pm, edited 1 time in total.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!
-
Neolesh
- a hill giant

- Posts: 231
- Joined: Mon Aug 23, 2004 11:15 am
Post
by Neolesh » Sat Jan 01, 2005 1:07 pm
Well aC1 you gonna have to remove that whole if or you gonna get a Could Not Find Command to Execute error as is.
-
aChallenged1
- a grimling bloodguard

- Posts: 1804
- Joined: Mon Jun 28, 2004 10:12 pm
Post
by aChallenged1 » Sat Jan 01, 2005 1:43 pm
Hadn't tried it, and you're right of course.
But that line is the right line in general. =)
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!
-
mncat
- orc pawn

- Posts: 21
- Joined: Thu Oct 07, 2004 6:32 pm
Post
by mncat » Sun Jan 16, 2005 1:01 am
OK I guess I shall wait for the flames. But I was wondering if this macro was broke or something. It has been about a month since I have played EQ and I had to do a HD replacement so I lost all my old macros. What I try to load this macro it says "couldn't open macro file "E:/MQ/macros/hunter.mac" I am disapointed because I loved this macro so much.
-
aChallenged1
- a grimling bloodguard

- Posts: 1804
- Joined: Mon Jun 28, 2004 10:12 pm
Post
by aChallenged1 » Sun Jan 16, 2005 5:02 am
You have your DLLs and MacroQuest2.exe in the MQ2 directoy, and not in the Release sub directory? Asking because the Macro dir needs to be in the same directory as the executable file.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!
-
mncat
- orc pawn

- Posts: 21
- Joined: Thu Oct 07, 2004 6:32 pm
Post
by mncat » Sun Jan 16, 2005 2:22 pm
yup everything is fine now. Just seemed to forget everything I knew about MQ2 in the short little month that I wasn't useing it. But thank you for the reply.
-
aChallenged1
- a grimling bloodguard

- Posts: 1804
- Joined: Mon Jun 28, 2004 10:12 pm
Post
by aChallenged1 » Sun Jan 16, 2005 3:00 pm
Yeah, I kind of figured that was the case. I was out of game for 3 months and took me a few days to be comfortable with a few things again.
Have fun.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!
-
Phox
- orc pawn

- Posts: 29
- Joined: Fri Mar 19, 2004 6:44 am
Post
by Phox » Thu Jan 20, 2005 1:27 am
Just to simplify things for myself, I broke this macro down into a simple logical structure. It has helped alot with troubleshooting and adding features. Of course the macro pros will not much benefit from this but it might help a less experienced person.
Code: Select all
1. Macro starts
2. Loads Loot and Mob ini's
3. Is there a GM in the zone?
If yes, end macro
4. Attempt to get a target
5. Do you have a target?
If not, has the fail counter gone above max fail?
If not, increase fail counter by one and attempt to get a new target
If it has, reset fail counter and pause 30 seconds before trying to get a new target
5. Is target is range?
If not, reset variables, exclude current target, and get a new target
6. Is target full health?
If not, reset variables, exclude current target, and wait a random amount of seconds
After waiting, are there any mobs attacking you?
If not, attempt to get a new target
7. Run to mob until it is in melee range
8. Combat Loop:
1) Attack target
2) Is target dead?
If yes, move to 9.
3) Face Target
4) Move to target
5) Execute special combat commands (there are no default commands for any classes besides SK's)
6) Repeat Loop until mob is dead
9. Target corpse
10. Move to corpse
11. Loot items in loot array, destroy others
12. Reset variables and wait a random amount of seconds
13. After waiting, is a mob attacking you?
If yes, move to 6.
14. Start the process over at 3.
-
aChallenged1
- a grimling bloodguard

- Posts: 1804
- Joined: Mon Jun 28, 2004 10:12 pm
Post
by aChallenged1 » Thu Jan 20, 2005 5:15 am
That is basically what a coder should be doing when thinking up his macros and plugins. You have to know what you want to do, the order to do it in, and what to do in various expected situations.
The only thing that this is missing that would be smart to add is a "Slain" sub so that if you die it sits you down and makes you either camp out or go afk, or play a sound.
Fuck writing MQ2 macros. Go with IS scripts; IS Rules!
-
mncat
- orc pawn

- Posts: 21
- Joined: Thu Oct 07, 2004 6:32 pm
Post
by mncat » Thu Jan 20, 2005 11:41 am
Yeah I agree that if your killed it should camp you out or something and I might add that in myself. Also I plan on adding a part where it checks to see if your ducking. I couldn't tell you how many time I end up ducking and walking around like an idiot trying to attack something.
-
Chanter101
- decaying skeleton

- Posts: 8
- Joined: Sun Jan 09, 2005 3:17 am
Post
by Chanter101 » Sat Jan 22, 2005 3:27 am
Dinked around with his macro for a while, got it to work to /camp desktop upon death and to check buffs if you're an enchanter. You can change the buffs around if you want, it's at the bottom of the macro.
Edit: Tinkered with it just a little more. Not sure that the Summon pet upon death will work, really haven't had a chance to test it. The pet buffing works too.
Code: Select all
| Hunter Macro
| Hunter.mac
| Author : robdawg
| Version : v1.2 2004-05-13 10:06pm PST
| Useage : /macro Hunter
| Description : This macro will run your character around killing any mobs in your
| RV_MobArray. Then it will attempt to loot all items in your
| RV_LootArray. This is definitely a work in progress and I am sure
| someone can think of plenty of upgrades for this.
|------------------------------------------------------------------------------------
#turbo 10
#include Buffbeg.inc
#include Spellcast.inc
#event slain "You have been Slain by #*#"
#event PetSlain "(${Me.Pet}) has been slain by #*#"
Sub Main
/call BuffBegDeclares
/call BuffCheck
/call BuffPet
/call SummonPet
|------------------------------------------------------------
|How many times should aquire target fail before delaying?
|------------------------------------------------------------
/declare RV_FailMax int outer 3
|------------------------------------------------------------
|How far would you like to target a mob?
|------------------------------------------------------------
/declare RV_MaxRadius int outer 12000000
|------------------------------------------------------------
|How far is the combat range?
|------------------------------------------------------------
/declare RV_Range int outer 10
|------------------------------------------------------------
|What is the minimum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MinZRange int outer -10000000
|------------------------------------------------------------
|What is the maximum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MaxZRange int outer 10000000
|------------------------------------------------------------
|Should I loot all items?
|------------------------------------------------------------
/declare RV_LootAllItems int outer 0
|------------------------------------------------------------
|Should I display stats?
|------------------------------------------------------------
/declare RV_DisplayStats int outer 1
|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/call ReadINI HunterMob.ini "${Zone.Name}" Mob
/if (!${Defined[RV_MobArray]}) {
/echo Mob Array Creation Error, ending macro...
/endmacro
}
|------------------------------------------------------------
|Mob Array Information.
|------------------------------------------------------------
/call ReadINI HunterLoot.ini "${Zone.Name}" Loot
/if (!${Defined[RV_LootArray]}) {
/echo No Loot Array Created...
}
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare RV_FailCounter int outer 0
/declare RV_MyTargetID int outer 0
/declare RV_MyTargetName string outer
/declare RV_MyTargetDead int outer 0
/declare RV_InvalidTargetID int outer 0
/declare RV_HasTarget int outer 0
/declare RV_RandomWait int outer 0
/declare RV_LootSlot int outer 0
/declare RV_CheckLook int outer 0
/declare RV_Fighting int outer 0
/declare RV_TargetDead int outer 0
/declare RV_MyXLOC int outer 0
/declare RV_MyYLOC int outer 0
/declare pndt int outer
/declare pnv int outer
/declare RV_FastRange int outer
/declare RV_RangeMax int outer
/declare RV_RangeMin int outer
/varcalc RV_FastRange ${RV_Range}+3
/varcalc RV_RangeMax ${RV_Range}+1
/varcalc RV_RangeMin ${RV_Range}-1
:Start
/doevents
/call GMCheck
/call BuffCheck
/call GetTarget
:KillAdds
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget}) /call CombatSub
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/if (${RV_DisplayStats}) /call DisplayStats
/call ResetSub
/varset RV_RandomWait ${Math.Rand[5]}
/varcalc RV_RandomWait ${RV_RandomWait}+1
/echo Paranoia - Waiting ${RV_RandomWait} seconds before resuming
/delay ${RV_RandomWait}s
/if (${Target.ID}) {
/echo Looks like something is attacking us, killing it...
/delay 1s
/varset RV_HasTarget 1
/varset RV_Fighting 1
/goto :KillAdds
}
/goto :Start
/return
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub GetTarget
/call BuffCheck
/declare RV_CurrentRadius int local
/declare RV_TargetSub int local
:Acquire
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100
/for RV_TargetSub 1 to ${RV_MobArray.Size}
/squelch /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}"
/varset RV_MyTargetID ${Target.ID}
/varset RV_MyTargetDead 0
/if (${Target.ID}) {
/if (${Int[${Target.PctHPs}]}<100) {
/echo Mob NOT a Full Health, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}<${RV_MinZRange}) {
/echo Mob is BELOW Min Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}>${RV_MaxZRange}) {
/echo Mob is ABOVE Max Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/varset RV_HasTarget 1
/varset RV_MyTargetName ${Target.CleanName}
/echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]}
/return
}
/next RV_TargetSub
/delay 2
/next RV_CurrentRadius
/if (!${Target.ID}) {
/delay 2s
/varcalc RV_FailCounter ${RV_FailCounter}+1
/echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s)
/if (${RV_FailCounter}>=${RV_FailMax}) {
/echo Waiting for Respawns, Resetting Failure Counter...
/delay 60s
/varset RV_FailCounter 0
}
/goto :Acquire
}
/return
|--------------------------------------------------------------------------------
|SUB: Moving
|--------------------------------------------------------------------------------
Sub MoveToMob
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/declare RV_DistanceTimer timer 15
/doevents
:MovementLoop
/if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}<100)) {
/echo Mob not at full health, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/varset RV_HasTarget 0
/call ResetSub
/return
}
/if (${Target.ID}) {
/face fast
}
/if (${Int[${Target.Distance}]}>${RV_FastRange}) {
/keypress forward hold
}
/if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) {
/keypress forward
}
/if (${Int[${Target.Distance}]}<${RV_RangeMin}) {
/keypress back
}
/if (!${RV_DistanceTimer}) {
/if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/varset RV_DistanceTimer 15
/goto :Movementloop
}
/if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/echo Attacking Mob NOW!
/varset RV_Fighting 1
/varset RV_TargetDead 0
:CombatLoop
/doevents
/attack on
/call MoveToMob
/call SpecialIT
/if (!${Target.ID}) {
/attack off
/keypress forward
/keypress back
/varset RV_TargetDead 1
/varset RV_Fighting 0
/delay 1s
/target radius 30 corpse
/delay 1s
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${RV_TargetDead}) {
/goto :CombatLoop
}
/return
|--------------------------------------------------------------------------------
|SUB: Special Combat
|--------------------------------------------------------------------------------
Sub SpecialIt
/declare TempID int inner 0
/if ((${Target.Distance}<11)&&(${Me.AbilityReady["Bash"]})) /doability "Bash"
/if ((${Int[${Me.PctHPs}]}<50)&&(${Me.Gem["Light of Nife"]})&&(${Me.SpellReady["Light of Nife"]})) {
/varset TempID ${Target.ID}
/keypress forward
/keypress back
/keypress F1
/echo Casting Heal Spell because of low health...
/cast "Light of Nife"
/delay 3s
/target id ${TempID}
}
/return
|--------------------------------------------------------------------------------
|SUB: Looting
|--------------------------------------------------------------------------------
Sub LootMob
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/face fast
/keypress forward
/keypress back
/fastdrop on
/lootn never
/delay 2s
/loot
/delay 2s
/if (!${Corpse.Items}) {
/echo NO LOOT! Cheap Bastard!
/return
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/itemnotify loot${LootSlot} leftmouseup
/delay 1s
/if (${RV_LootAllItems}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 1s
} else {
/for LootCheck 1 to ${RV_LootArray.Size}
/if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) {
/echo Keeping a ${Cursor.Name}... WOOT!
/varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1
/autoinventory
/delay 1s
}
/next LootCheck
}
/if (${Cursor.ID}) {
/echo Destroying a ${Cursor.Name}...
/destroy
/delay 1s
}
/next LootSlot
/notify LootWnd DoneButton leftmouseup
/delay 2
/return
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
/keypress esc
/keypress esc
/keypress esc
/keypress esc
/varset RV_HasTarget 0
/varset RV_TargetDead 0
/varset RV_Fighting 0
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Avoidance
|--------------------------------------------------------------------------------
Sub HitObstacle
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[100]}+1>50) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return
|--------------------------------------------------------------------------------
|SUB: GM Check
|--------------------------------------------------------------------------------
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/beep
/beep
/echo GM has entered the zone!
/echo FUCK HIM but ending the macro...
/keypress forward
/keypress back
/quit
/endmacro
}
/return
|--------------------------------------------------------------------------------
|SUB: Reading from an INI File
|--------------------------------------------------------------------------------
Sub ReadINI(FileName,SectionName,ArrayType)
/echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}...
/delay 1s
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro...
/delay 1s
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
:CounterLoop
/if (${String[${Ini[${FileName},${SectionName},${ArrayType}${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["HunterMob.ini"]}&&${nValues}>0) {
/echo Declaring Mob Array...
/declare RV_MobArray[${nValues}] string outer
/declare RV_MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare RV_LootArray[${nValues}] string outer
/declare RV_LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset RV_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset RV_MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset RV_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset RV_LootStats[${nArray}] 0
}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 1s
/return
}
/return
|--------------------------------------------------------------------------------
|SUB: Display Stats
|--------------------------------------------------------------------------------
Sub DisplayStats
/declare nArray int local
/if (${Defined[RV_LootArray]}) {
/for nArray 1 to ${RV_LootArray.Size}
/echo ${Int[${RV_LootStats[${nArray}]}]} ${RV_LootArray[${nArray}]}'s
/next nArray
}
/return
Sub Event_Slain
/echo Something went wrong and I died! Ending Macro!
/delay 200
/beep
/camp Desktop
/delay 40
/beep
/endmacro
/return
Sub BuffCheck
/if (${Me.Buff[Ethereal Rune].Duration}<10) {
/target <name>
/call cast "Ethereal Rune"
}
/if (${Me.Buff[Shield of Maelin].Duration}<10) {
/target <name>
/call cast "Shield of Maelin"
}
/if (${Me.Buff[Speed of Salik].Duration}<10) {
/target <name>
/call cast "Speed of Salik"
}
/if (${Me.Buff[Levitation].Duration}<10) {
/target <name>
/call cast "Levitation"
}
/if (${Me.Buff[Clairvoyance].Duration}<10) {
/target <name>
/call cast "Clairvoyance"
}
/keypress Esc
/return
Sub SummonPet
:summonpet
/if (${Me.Pet.ID}==0) {
/call cast "Salik's Animation"
}
/return
Sub BuffPet
/if (${Me.PetBuff[Night`s Dark Terror].Duration}==0) {
/pet target
/call cast "Night`s Dark Terror"
}
/if (${Me.PetBuff[Speed of Salik].Duration}==0) {
/pet target
/call cast "Speed of Salik"
}
/return
Sub Event_PetSlain
/if (${Me.Pet.HP}==0) {
/goto :summonpet
/return
Last edited by
Chanter101 on Wed Mar 30, 2005 3:44 pm, edited 2 times in total.
-
Virtuoso65
- a hill giant

- Posts: 150
- Joined: Wed Oct 15, 2003 2:29 pm
Post
by Virtuoso65 » Sun Jan 30, 2005 11:40 pm
So I wanted to speed this macro up a bit and cut down on the junk looting and risk of destroying stuff.
In the HunterLoot.ini instead of using the loots name use the loots ID. This now also uses MQ2MoveUtils for combat movement.
Code: Select all
Sub Main
|------------------------------------------------------------
|How many times should aquire target fail before delaying?
|------------------------------------------------------------
/declare RV_FailMax int outer 3
|------------------------------------------------------------
|How far would you like to target a mob?
|------------------------------------------------------------
/declare RV_MaxRadius int outer 999
|------------------------------------------------------------
|How far is the combat range?
|------------------------------------------------------------
/declare RV_Range int outer 10
|------------------------------------------------------------
|What is the minimum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MinZRange int outer -1000
|------------------------------------------------------------
|What is the maximum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MaxZRange int outer 1000
|------------------------------------------------------------
|Should I loot all items?
|------------------------------------------------------------
/declare RV_LootAllItems int outer
/varset RV_LootAllItems 0
|------------------------------------------------------------
|Should I display stats?
|------------------------------------------------------------
/declare RV_DisplayStats int outer 0
|------------------------------------------------------------
|Loot Array Information.
|------------------------------------------------------------
/call ReadINI HunterMob.ini "${Zone.Name}" Mob
/if (!${Defined[RV_MobArray]}) {
/echo Mob Array Creation Error, ending macro...
/endmacro
}
|------------------------------------------------------------
|Mob Array Information.
|------------------------------------------------------------
/call ReadINI HunterLoot.ini "${Zone.Name}" Loot
/if (!${Defined[RV_LootArray]}) {
/echo No Loot Array Created...
}
|------------------------------------------------------------
|Variables that you don't need to worry about.
|------------------------------------------------------------
/declare RV_FailCounter int outer 0
/declare RV_MyTargetID int outer 0
/declare RV_MyTargetName string outer
/declare RV_MyTargetDead int outer 0
/declare RV_InvalidTargetID int outer 0
/declare RV_HasTarget int outer 0
/declare RV_RandomWait int outer 0
/declare RV_LootSlot int outer 0
/declare RV_CheckLook int outer 0
/declare RV_Fighting int outer 0
/declare RV_TargetDead int outer 0
/declare RV_MyXLOC int outer 0
/declare RV_MyYLOC int outer 0
/declare RV_FastRange int outer
/declare RV_RangeMax int outer
/declare RV_RangeMin int outer
/varcalc RV_FastRange ${RV_Range}+3
/varcalc RV_RangeMax ${RV_Range}+1
/varcalc RV_RangeMin ${RV_Range}-1
:Start
/doevents
/call GetTarget
:KillAdds
/if (${RV_HasTarget}) /call MoveToMob
/if (${RV_HasTarget}) /call CombatSub
/if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob
/call ResetSub
/varset RV_RandomWait ${Math.Rand[2]}
/varcalc RV_RandomWait ${RV_RandomWait}+1
/delay ${RV_RandomWait}s
/if (${Target.ID}) {
/echo Looks like something is attacking us, killing it...
/delay 1s
/varset RV_HasTarget 1
/varset RV_Fighting 1
/goto :KillAdds
}
/goto :Start
/return
|--------------------------------------------------------------------------------
|SUB: Aquire Target
|--------------------------------------------------------------------------------
Sub GetTarget
/declare RV_CurrentRadius int local
/declare RV_TargetSub int local
:Acquire
/for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100
/for RV_TargetSub 1 to ${RV_MobArray.Size}
/squelch /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc "${RV_MobArray[${RV_TargetSub}]}"
/varset RV_MyTargetID ${Target.ID}
/varset RV_MyTargetDead 0
/if (${Target.ID}) {
/if (${Int[${Target.PctHPs}]}<95) {
/echo Mob NOT a Full Health, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}<${RV_MinZRange}) {
/echo Mob is BELOW Min Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/if (${Int[${Target.Z}]}>${RV_MaxZRange}) {
/echo Mob is ABOVE Max Z Range, picking another...
/varset RV_InvalidTargetID ${Target.ID}
/call ResetSub
/goto :Acquire
}
/varset RV_HasTarget 1
/varset RV_MyTargetName ${Target.CleanName}
/echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]}
/return
}
/next RV_TargetSub
/delay 2
/next RV_CurrentRadius
/if (!${Target.ID}) {
/delay 2s
/varcalc RV_FailCounter ${RV_FailCounter}+1
/echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s)
/if (${RV_FailCounter}>=${RV_FailMax}) {
/delay 60s
/varset RV_FailCounter 0
}
/goto :Acquire
}
/return
|--------------------------------------------------------------------------------
|SUB: Moving
|--------------------------------------------------------------------------------
Sub MoveToMob
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/declare RV_DistanceTimer timer 15
/doevents
:MovementLoop
/if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}<95)) {
/varset RV_InvalidTargetID ${Target.ID}
/varset RV_HasTarget 0
/call ResetSub
/return
}
/if ((${Target.ID}) && (!${Me.Moving})) {
/squelch /stick hold 50%
}
/if (!${RV_DistanceTimer}) {
/if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle
/varset RV_MyXLOC ${Int[${Me.X}]}
/varset RV_MyYLOC ${Int[${Me.Y}]}
/varset RV_DistanceTimer 15
/goto :Movementloop
}
/if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop
/return
|--------------------------------------------------------------------------------
|SUB: Combat
|--------------------------------------------------------------------------------
Sub CombatSub
/echo Attacking Mob NOW!
/varset RV_Fighting 1
/varset RV_TargetDead 0
/attack on
:CombatLoop
/doevents
/if (!${Me.Moving}) {
/squelch /stick hold 50% moveback
}
/if (!${Target.ID}) {
/attack off
/keypress forward
/keypress back
/varset RV_TargetDead 1
/varset RV_Fighting 0
/delay 1s
/target radius 30 corpse
/delay 1s
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${RV_TargetDead}) {
/goto :CombatLoop
}
/return
|--------------------------------------------------------------------------------
|SUB: Looting
|--------------------------------------------------------------------------------
Sub LootMob
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/face
/keypress forward
/keypress back
/delay 1s
/loot
/delay 1s
/if (!${Corpse.Items}) {
/echo Nada, weak!
/return
}
/varset LootTotal ${Corpse.Items}
/for LootSlot 1 to ${LootTotal}
/delay 1
/for LootCheck 1 to ${RV_LootArray.Size}
/if (${Corpse.Item[${LootSlot}].ID}==${RV_LootArray[${LootCheck}]}) {
/itemnotify Loot${LootSlot} leftmouseup
/delay 1s
/echo Keeping a ${Cursor.Name}... WOOT!
/autoinventory
/delay 5
}
/next LootCheck
}
/next LootSlot
/notify LootWnd DoneButton leftmouseup
/delay 1
/return
|--------------------------------------------------------------------------------
|SUB: Reset
|--------------------------------------------------------------------------------
Sub ResetSub
/keypress esc
/varset RV_HasTarget 0
/varset RV_TargetDead 0
/varset RV_Fighting 0
/return
|--------------------------------------------------------------------------------
|SUB: Obstacle Avoidance
|--------------------------------------------------------------------------------
Sub HitObstacle
/echo Obstacle hit, moving around it...
/keypress forward
/keypress back hold
/delay 3
/keypress back
/if (${Math.Rand[100]}+1>50) {
/keypress strafe_right hold
} else {
/keypress strafe_left hold
}
/delay 5
/keypress strafe_right
/keypress strafe_left
/keypress forward hold
/return
Sub ReadINI(FileName,SectionName,ArrayType)
/if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) {
/echo "${SectionName}" is not a Valid Section for FILE: ${FileName}, ending macro...
/delay 1s
/return
}
/declare nValues int local 1
/declare nArray int local 0
/declare KeySet string local ${Ini[${FileName},${SectionName}]}
:CounterLoop
/if (${String[${Ini[${FileName},${SectionName},${ArrayType}${nValues}]}].Equal[null]}) {
/varcalc nValues ${nValues}-1
/goto :MakeArray
}
/varcalc nValues ${nValues}+1
/goto :CounterLoop
:MakeArray
/if (!${nValues}) /return
/if (${FileName.Equal["HunterMob.ini"]}&&${nValues}>0) {
/echo Declaring Mob Array...
/declare RV_MobArray[${nValues}] string outer
/declare RV_MobStats[${nValues}] string outer
}
/if (${FileName.Equal["HunterLoot.ini"]}&&${nValues}>0) {
/echo Declaring Loot Array...
/declare RV_LootArray[${nValues}] string outer
/declare RV_LootStats[${nValues}] string outer
}
/for nArray 1 to ${nValues}
/if (${FileName.Equal["HunterMob.ini"]}) {
/varset RV_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset RV_MobStats[${nArray}] 0
}
/if (${FileName.Equal["HunterLoot.ini"]}) {
/varset RV_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]}
/varset RV_LootStats[${nArray}] 0
}
/next nArray
/echo "${SectionName}" Zone Information Read Successfully from ${FileName}...
/delay 1s
/return
-
Haritos03
- decaying skeleton

- Posts: 1
- Joined: Mon Jan 31, 2005 10:47 pm
Post
by Haritos03 » Thu Feb 03, 2005 2:24 am
i have looked everywhere and can not find the includes needed toi run this i may look like a noob and believe me i have used the search button like mad
-
geostone
- a lesser mummy

- Posts: 78
- Joined: Thu Oct 31, 2002 6:16 pm
Post
by geostone » Thu Feb 03, 2005 6:15 am
you might want to edit out char name

-
siamesecyborg
- decaying skeleton

- Posts: 1
- Joined: Thu Feb 03, 2005 10:49 pm
Post
by siamesecyborg » Tue Feb 08, 2005 3:07 am
Just a quick note to peeps trying to play this macro - it can cause problems if you are riding on a mount... Occassionally you will run into a "You cannot see your target" repeatedly, without ever breaking.