armysoldier
Well-known member
- Joined
- Jun 26, 2005
- RedCents
- 101¢
Working Code
WARNING: Do not use DS with this.. it causes the logic to think the mob is being hit by someone else
Final edits for today ... works good.. will add PC detection to Pieces tomorrow
EDITED:
Edits 11/20/05
Tweeked more LOCs
added a HP check
made it warrior friendly
Edits 10/10/05
Tweeking LOCS in the CaveDiver
Tweeking Zoning events
This is the bard / melee version
This takes you in one cave entrance makes a giant loop inside and comes out on the otherside and starts back at entrance
Future Plans:
Caster Version - medding is gonna be a pain
Melee only version - should not be too difficult.. no snare is gonna be a bitch
Re-Incorporate VeliumBits.inc - REMed out atm
I tested the hunting and pieces part...
using a 66 bard .. worked like a champ ..
The hard part was not warping all over .. and navigating the caves
i am sure there are better ways to do this.. but here it goes......
Also once full the toon zones to thurg.. gates to forge and does the combines
there are 3 files
Veliumhunter.mac
Veliumpieces.inc
Veliumbits.inc
FEEL FREE to try this out and let me know errors
8-)
VeliumHunter.mac
WARNING: Do not use DS with this.. it causes the logic to think the mob is being hit by someone else
Final edits for today ... works good.. will add PC detection to Pieces tomorrow
EDITED:
Edits 11/20/05
Tweeked more LOCs
added a HP check
made it warrior friendly
Edits 10/10/05
Tweeking LOCS in the CaveDiver
Tweeking Zoning events
This is the bard / melee version
This takes you in one cave entrance makes a giant loop inside and comes out on the otherside and starts back at entrance
Future Plans:
Caster Version - medding is gonna be a pain
Melee only version - should not be too difficult.. no snare is gonna be a bitch
Re-Incorporate VeliumBits.inc - REMed out atm
I tested the hunting and pieces part...
using a 66 bard .. worked like a champ ..
The hard part was not warping all over .. and navigating the caves
i am sure there are better ways to do this.. but here it goes......
Also once full the toon zones to thurg.. gates to forge and does the combines
there are 3 files
Veliumhunter.mac
Veliumpieces.inc
Veliumbits.inc
FEEL FREE to try this out and let me know errors
8-)
VeliumHunter.mac
Rich (BB code):
| VeliumHunter.MAC
| Re-Written by Armysoldier
|
| Seriously Modified Hunter.mac
| Author : robdawg
|
| Useage : /macro VeliumHunter
| Description : This macro will run your character to the Tizmak cave entrance
| Then the killing begins.. Twists a few songs and melee
| You set how many items you can hold... See a couple lines below
| Once Full you will zone to thurg and turn your treasures into Velium Pieces
|
|------------------------------------------------------------------------------------
#include spell_routines.inc
#Event Full "[MQ2] 20 Velium's"
|-------------------- ^^ NEEDS to be # of empty slots in inventory MINUS 1
|
|
#Event GD "#*#entered The Great Divide#*#"
#Event Died "#*#entered The Plane of Knowledge#*#"
#Event Thurg "#*#entered The City of Thurgadin#*#"
#include VeliumPieces.inc
#include VeliumBits.inc
#include HunterMob.ini
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc
Sub Main
/docrack nostun on
/docrack nomeleepushback on
/docrack noencumber on
|------------------------------------------------------------
|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 100
|------------------------------------------------------------
|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 -200
|------------------------------------------------------------
|What is the maximum Z Value of mobs I should target?
|------------------------------------------------------------
/declare RV_MaxZRange int outer 355
|------------------------------------------------------------
|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 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
/declare stop int outer
/varset stop 0
:Start
/doevents
/if (${Me.PctHPs}<15) /call REGEN
/call GMCheck
/call DisplayStats
/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 (${Me.Class.Name.Equal[Warrior]}) {
/if (!${Target.ID}) {
/keypress 1
/delay 4s
}
/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 10 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
/keypress 1
/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...
/echo moving deeper
/call CaveDiver
/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
/keypress forward
/delay 1s
/if (${Me.Class.Name.Equal[Bard]}) /call sing
/delay 2s
:CombatLoop
/doevents
/keypress forward
/attack on
/call MoveToMob
|/if ((${Target.Distance}<11)&&(${Me.AbilityReady["Bash"]})) /doability "Bash"
/if (!${Target.ID}) {
/attack off
/keypress forward
/keypress back
/varset RV_TargetDead 1
/varset RV_Fighting 0
/delay 1s
/target radius 100 corpse
/delay 1s
/if (!${Target.ID}) {
/call ResetSub
/return
}
/face fast
}
/if (!${RV_TargetDead}) {
/goto :CombatLoop
}
/return
|--------------------------------------------------------------------------------
|SUB: Looting
|--------------------------------------------------------------------------------
Sub LootMob
/if (${Me.Class.Name.Equal[Bard]}) /twist off
/if (${Me.Class.Name.Equal[Bard]}) /cast 6
/declare LootSlot int inner 0
/declare LootCheck int inner 0
/declare LootTotal int inner 0
/face fast
/autoinventory
/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
/keypress 0
|---------------^^ Fading Memories
/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 (!${KeySet.Arg[${nValues},|].Length}) {
/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
|--------------------------------------------------------------------------------
|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 Sing - What are you gonna twist?
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sub Sing
/twist 1 2 5 6
|----- Haste - snare - DD - Heal
/return
|-------------------------------------------------
| Move to Location Loop
|-------------------------------------------------
Sub MoveToLoc(float MoveToY,float MoveToX)
:MoveToLoop
/face fast nolook loc ${MoveToY},${MoveToX}
/if (${Math.Distance[${MoveToY},${MoveToX}]}>2) /keypress forward hold
/if (${Math.Distance[${MoveToY},${MoveToX}]}<=2) {
/keypress forward
/goto :Arrived
}
/goto :MoveToLoop
:Arrived
/return
|--------------------------------------------------------------------------------
|SUB: Cave Diver - moves deeper into caves when no mobs are found in radius
|--------------------------------------------------------------------------------
Sub CaveDiver
/keypress 1
/delay 5s
/if (${stop}==0) {
/call MoveToLoc -901.74 1690.98
/call MoveToLoc -898 1831
/echo 0
/varset stop 1
/return
}
/if (${stop}==1) {
/call MoveToLoc -970 1918
/call MoveToLoc -936 2001
/delay 1s
/call MoveToLoc -1122 2066
/delay 4s
/echo 1
/varset stop 2
/return
}
/if (${stop}==2) {
/call MoveToLoc -1122 2066
/call MoveToLoc -1172 2098
/call MoveToLoc -1180 2298
/call MoveToLoc -998 2230
/call MoveToLoc -974 2114
/call MoveToLoc -952 2177
/delay 2s
/echo 2
/varset stop 3
/return
}
/if (${stop}==3) {
/call MoveToLoc -952 2177
/call MoveToLoc -979 2425
/call MoveToLoc -1146 2430
/echo 3
/varset stop 4
/return
}
/if (${stop}==4) {
/call MoveToLoc -1146 2430
/call MoveToLoc -979 2425
/call MoveToLoc -1093 2842
/call MoveToLoc -1334 2609
/delay 2s
/echo 4
/varset stop 5
/return
}
/if (${stop}==5) {
/call MoveToLoc -1334 2609
/call MoveToLoc -1436 2781
/echo 5
/varset stop 6
/return
}
/if (${stop}==6) {
/call MoveToLoc -1436 2781
/call MoveToLoc -1334 2609
/call MoveToLoc -1093 2842
/call MoveToLoc -1273 3119
/echo 6
/varset stop 7
/return
}
/if (${stop}==7) {
/call MoveToLoc -1273 3119
/call MoveToLoc -1301 3368
/call MoveToLoc -1866 3873
/echo 7
/varset stop 8
/return
}
/if (${stop}==8) {
/call MoveToLoc -1866 3873
/call MoveToLoc -1975 4125
/echo 8
/varset stop 9
/return
}
/if (${stop}==9) {
/call MoveToLoc -1975 4125
/call MoveToLoc -1889 3725
/call MoveToLoc -1846 3706
/echo 9
/varset stop 10
/return
}
/if (${stop}==10) {
/call MoveToLoc -1846 3706
/call MoveToLoc -2069 3675
/call MoveToLoc -2011 3417
/call MoveToLoc -2189 3399
/call MoveToLoc -2254 3457
/echo 10
/varset stop 11
/return
}
/if (${stop}==11) {
/call MoveToLoc -2254 3457
/call MoveToLoc -2456 3675
/echo 11
/varset stop 12
/return
}
/if (${stop}==12) {
/call MoveToLoc -2456 3675
/call MoveToLoc -2254 3457
/echo 12
/varset stop 13
/return
}
/if (${stop}==13) {
/call MoveToLoc -2254 3457
/call MoveToLoc -2412 3370
/echo 13
/varset stop 14
/return
}
/if (${stop}==14) {
/call MoveToLoc -2412 3370
/call MoveToLoc -2549 3150
/echo 14
/varset stop 15
/return
}
/if (${stop}==15) {
/call MoveToLoc -2549 3150
/call MoveToLoc -2742 3150
/echo 15
/varset stop 16
/return
}
/if (${stop}==16) {
/call MoveToLoc -2742 3150
/call MoveToLoc -2549 3150
/echo 16
/varset stop 17
/return
}
/if (${stop}==17) {
/call MoveToLoc -2544 3100
/call MoveToLoc -2549 3150
/call MoveToLoc -2580 2915
/call MoveToLoc -2204 2861
/echo 17
/varset stop 18
/return
}
/if (${stop}==18) {
/call MoveToLoc -2204 2861
/call MoveToLoc -2334 2915
/call MoveToLoc -2262 3120
/call MoveToLoc -2158 3160
/echo 18
/varset stop 19
/return
}
/if (${stop}==19) {
/call MoveToLoc -2158 3160
/call MoveToLoc -2054 3044
/call MoveToLoc -1940 3160
/echo 19
/varset stop 20
/return
}
/if (${stop}==20) {
/call MoveToLoc -2054 3044
/call MoveToLoc -2158 3160
/call MoveToLoc -2262 3120
/call MoveToLoc -2334 2915
/echo 20
/varset stop 21
/return
}
/if (${stop}==21) {
/call MoveToLoc -2334 2915
/call MoveToLoc -2580 2915
/echo 21
/varset stop 22
/return
}
/if (${stop}==22) {
/call MoveToLoc -2580 2915
/call MoveToLoc -2646 2827
/call MoveToLoc -2560 2617
/call MoveToLoc -2262 2626
/call MoveToLoc -2193 2355
/echo 22
/varset stop 23
/return
}
/if (${stop}==23) {
/call MoveToLoc -2193 2355
/call MoveToLoc -2184 2095
/call MoveToLoc -897 1616
/call MoveToLoc -901.74 1690.98
/echo 23 - end of caves
/varset stop 0
/return
}
/return
|--------------------------------------------------------------------------------
|SUB: REGEN
|--------------------------------------------------------------------------------
sub REGEN
/echo HP real low
/warp succor
:REGEN
/if (${Me.PctHPs}==100) /zone thurgadina
/keypress 1
/delay 5s
/sit
/goto :REGEN
/return
|--------------------------------------------------------------------------------
|SUB: Full
|--------------------------------------------------------------------------------
sub Event_Full
/echo full
/twist off
/zone thurgadina
/delay 45s
/doevents
/return
|--------------------------------------------------------------------------------
|SUB: GD
|--------------------------------------------------------------------------------
sub Event_GD
/echo GD
/delay 10s
/call MoveToLoc -992.00 -182.88
/call MoveToLoc -901.74 1690.98
/mac veliumhunter
/return
|--------------------------------------------------------------------------------
|SUB: Zoned Thurg
|--------------------------------------------------------------------------------
sub Event_Thurg
/echo Thurg
/if (${Me.Class.Name.Equal[Bard]}) /twist off
/call VeliumPieces
/echo Time for Bits?
/if (${FindItemCount[=Small Piece of Velium]}>100) /call VeliumBits
/echo All done.. time to leave
/warp succor
/face noloc loc -1232,-20
/keypress forward hold
/delay 45s
/return
|--------------------------------------------------------------------------------
|SUB: Died
|--------------------------------------------------------------------------------
sub Event_Died
/echo DEAD.. damn it
/delay 5s
/sit
/camp desk
/endmac
/return
Last edited:




