Hello all. I have a question to anyone interested in assisting. I am pasting the following AFK macro that I use, for anyone that wants a monk one, to not only share some stuff I have compiled (very little of it is my own work anyway) and to also ask for some assistance in adding a piece that will make it more effective. Currently I keep a limited radius since there are some mobs I want to avoid - but these mobs are not KOS to me. However if I can get this working this thing can run all the time without any lapse. Meaning, if I can tell the macro to ONLY kill certain mobs then there are enough where I hunt that this thing will work all day long if I was so inclined.
Anyway, here it is - again my question is how do i add a piece that will ONLY attack certain mobs? ie "a bat" or "a ghoul"
#event Stunned "You are too distracted to use a skill.#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You can't attack while stunned!#*#"
#event Stunned "You cannot use a skill while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"
#include spell_routines.inc
Sub Main
|--------------------------------------------------------------------------------
|Configure Values Below
|--------------------------------------------------------------------------------
/declare usearray int outer 0 |--Change to 1 to use loot array
/declare RV_LootArray[5] string outer
/varset RV_LootArray[1] "Diamond"
/varset RV_LootArray[2] "Legends"
/varset RV_LootArray[3] "Junkx"
/varset RV_LootArray[4] "Junky"
/varset RV_LootArray[5] "Junkz"
|--------------------------------------------------------------------------------
|DO NOT MODIFY ANY OF THESE VALUES
|--------------------------------------------------------------------------------
/declare StickFighting int outer 0
/makecamp on
/call loop
|--------------------------------------------------------------------------------
|MAIN LOOP: Out of Combat actions
|--------------------------------------------------------------------------------
Sub Loop
:abilwatch
/if (${StickFighting}==1) /varset StickFighting 0
/if (${NearestSpawn[NPC].Distance} < 180) {
/target ${NearestSpawn[NPC]}
/attack on
}
/if (${Me.Combat}) /call Combat
/if (${Me.PctHPs} < 60) /doability "Mend"
/if (${Me.PctHPs} < 20) /call FDend
/if (${Me.PctHPs} > 60) /call SecondLife
/goto :abilwatch
/return
|--------------------------------------------------------------------------------
|SUB: Second Life
|--------------------------------------------------------------------------------
Sub SecondLife
/if (${Me.PctHPs} < 60) /doability "Mend"
/if (${Me.PctHPs} > 60) /stand
/delay 2s
/call loop
/return
|--------------------------------------------------------------------------------
|SUB: Combat Start Attack / End Fight
|--------------------------------------------------------------------------------
Sub Combat
:combatstart
/if (${Target.ID} && !${Me.Combat}) /attack on
/doevents
/if (${Me.PctHPs} < 25) /call FDend
/if (${StickFighting}==0) {
/varset StickFighting 1
/stick 13
}
/call Monkabil
|---------Run at end of fight---------------|
/if (${Target.Type.Equal[corpse]}) /keypress esc
/if (!${Target.ID}) {
/keypress back
/varset StickFighting 0
/delay 2s
/if (${NearestSpawn[NPC].Distance}<10) {
/target ${NearestSpawn[NPC]}
/attack on
/goto :combatstart
}
/attack off
/call Loot
/return
}
/goto :combatstart
/return
|--------------------------------------------------------------------------------
|SUB: Loot w/ Array
|--------------------------------------------------------------------------------
Sub Loot
/declare slot int local 1
/declare NumberItems int local 0
/declare CorpseCut int local 0
/target corpse radius 100
/stick 5 hold
:Moveto
/if (${Target.Distance}>10) /goto :MoveTo
/delay 2s
/face fast
/loot
/delay 2s
/face fast
/keypress forward
/keypress back
/varset NumberItems ${Corpse.Items}
/if (${NumberItems}>0) {
/varcalc CorpseCut ${Target.CleanName.Find['s corpse]}-1
/for slot 1 to ${NumberItems}
/shift /itemnotify loot${slot} leftmouseup
/delay 1s
:LagFix
/call HandleItem
/autoinventory
/delay 1s
/if (${Cursor.ID}) /goto :LagFix
/next slot
}
/nomodkey /notify LootWnd DoneButton leftmouseup
/delay 1s
/squelch /if (${Target.ID}) /target clear
/delay 1s
/return
sub HandleItem
/delay 1s
| /echo Found ${Cursor.Name}
/declare ItemSetting int local
/declare NotFound int local
/varset NotFound -1
| Look up this item in the INI file
/varset ItemSetting ${Ini[AutoLooter.ini,KeepList,${Cursor.Name},${NotFound}]}
/delay 5
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/ini "AutoLooter.ini" "KeepList" "${Cursor.Name}" "1"
/varset ItemSetting 1
}
| If we're keeping this item then stash it in our bags.
| Otherwise, just destroy it.
/if (${ItemSetting}==1) {
:LootIt
/autoinventory
/delay 5
/if (${Cursor.ID}) /goto :LootIt
} else {
/popup Destroying ${Cursor.Name}
/destroy
}
/return
/call loop
/return
|--------------------------------------------------------------------------------
|SUB: Monk Abilities (Epic Click, Mend, Flying Kick, Specials)
|--------------------------------------------------------------------------------
Sub Monkabil
|---------Abilities-------------------------|
/if ((${Me.AbilityReady["Flying Kick"]}) && (${Target.Distance}<18) && (${Me.Endurance}>500)) /doability "Flying Kick"
/if ((${Me.AbilityReady["Mend"]}) && (${Me.PctHPs} < 50)) /doability "Mend"
/if ((${Me.CombatAbilityReady["Clawstriker's Flurry"]}) && (${Target.Distance}<18) && (${Me.Endurance}>300)) /doability "Clawstriker's Flurry"
/return
|--------------------------------------------------------------------------------
|SUB: Feign Death (Something went terribly wrong)
|--------------------------------------------------------------------------------
Sub FDend
/doability "Feign Death"
/echo LOW HP!!!! FD!
/call SecondLife
|--------------------------------------------------------------------------------
|Event Triggers
|--------------------------------------------------------------------------------
Sub Event_Stunned
/delay 1s
/return
Thanks in advance! I appreciate all the help I have recieved so far. Its been a great community =)
Anyway, here it is - again my question is how do i add a piece that will ONLY attack certain mobs? ie "a bat" or "a ghoul"
#event Stunned "You are too distracted to use a skill.#*#"
#event Stunned "You are stunned#*#"
#event Stunned "You can't cast spells while stunned!#*#"
#event Stunned "You can't attack while stunned!#*#"
#event Stunned "You cannot use a skill while stunned!#*#"
#event Stunned "You *CANNOT* cast spells, you have been silenced!#*#"
#include spell_routines.inc
Sub Main
|--------------------------------------------------------------------------------
|Configure Values Below
|--------------------------------------------------------------------------------
/declare usearray int outer 0 |--Change to 1 to use loot array
/declare RV_LootArray[5] string outer
/varset RV_LootArray[1] "Diamond"
/varset RV_LootArray[2] "Legends"
/varset RV_LootArray[3] "Junkx"
/varset RV_LootArray[4] "Junky"
/varset RV_LootArray[5] "Junkz"
|--------------------------------------------------------------------------------
|DO NOT MODIFY ANY OF THESE VALUES
|--------------------------------------------------------------------------------
/declare StickFighting int outer 0
/makecamp on
/call loop
|--------------------------------------------------------------------------------
|MAIN LOOP: Out of Combat actions
|--------------------------------------------------------------------------------
Sub Loop
:abilwatch
/if (${StickFighting}==1) /varset StickFighting 0
/if (${NearestSpawn[NPC].Distance} < 180) {
/target ${NearestSpawn[NPC]}
/attack on
}
/if (${Me.Combat}) /call Combat
/if (${Me.PctHPs} < 60) /doability "Mend"
/if (${Me.PctHPs} < 20) /call FDend
/if (${Me.PctHPs} > 60) /call SecondLife
/goto :abilwatch
/return
|--------------------------------------------------------------------------------
|SUB: Second Life
|--------------------------------------------------------------------------------
Sub SecondLife
/if (${Me.PctHPs} < 60) /doability "Mend"
/if (${Me.PctHPs} > 60) /stand
/delay 2s
/call loop
/return
|--------------------------------------------------------------------------------
|SUB: Combat Start Attack / End Fight
|--------------------------------------------------------------------------------
Sub Combat
:combatstart
/if (${Target.ID} && !${Me.Combat}) /attack on
/doevents
/if (${Me.PctHPs} < 25) /call FDend
/if (${StickFighting}==0) {
/varset StickFighting 1
/stick 13
}
/call Monkabil
|---------Run at end of fight---------------|
/if (${Target.Type.Equal[corpse]}) /keypress esc
/if (!${Target.ID}) {
/keypress back
/varset StickFighting 0
/delay 2s
/if (${NearestSpawn[NPC].Distance}<10) {
/target ${NearestSpawn[NPC]}
/attack on
/goto :combatstart
}
/attack off
/call Loot
/return
}
/goto :combatstart
/return
|--------------------------------------------------------------------------------
|SUB: Loot w/ Array
|--------------------------------------------------------------------------------
Sub Loot
/declare slot int local 1
/declare NumberItems int local 0
/declare CorpseCut int local 0
/target corpse radius 100
/stick 5 hold
:Moveto
/if (${Target.Distance}>10) /goto :MoveTo
/delay 2s
/face fast
/loot
/delay 2s
/face fast
/keypress forward
/keypress back
/varset NumberItems ${Corpse.Items}
/if (${NumberItems}>0) {
/varcalc CorpseCut ${Target.CleanName.Find['s corpse]}-1
/for slot 1 to ${NumberItems}
/shift /itemnotify loot${slot} leftmouseup
/delay 1s
:LagFix
/call HandleItem
/autoinventory
/delay 1s
/if (${Cursor.ID}) /goto :LagFix
/next slot
}
/nomodkey /notify LootWnd DoneButton leftmouseup
/delay 1s
/squelch /if (${Target.ID}) /target clear
/delay 1s
/return
sub HandleItem
/delay 1s
| /echo Found ${Cursor.Name}
/declare ItemSetting int local
/declare NotFound int local
/varset NotFound -1
| Look up this item in the INI file
/varset ItemSetting ${Ini[AutoLooter.ini,KeepList,${Cursor.Name},${NotFound}]}
/delay 5
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/ini "AutoLooter.ini" "KeepList" "${Cursor.Name}" "1"
/varset ItemSetting 1
}
| If we're keeping this item then stash it in our bags.
| Otherwise, just destroy it.
/if (${ItemSetting}==1) {
:LootIt
/autoinventory
/delay 5
/if (${Cursor.ID}) /goto :LootIt
} else {
/popup Destroying ${Cursor.Name}
/destroy
}
/return
/call loop
/return
|--------------------------------------------------------------------------------
|SUB: Monk Abilities (Epic Click, Mend, Flying Kick, Specials)
|--------------------------------------------------------------------------------
Sub Monkabil
|---------Abilities-------------------------|
/if ((${Me.AbilityReady["Flying Kick"]}) && (${Target.Distance}<18) && (${Me.Endurance}>500)) /doability "Flying Kick"
/if ((${Me.AbilityReady["Mend"]}) && (${Me.PctHPs} < 50)) /doability "Mend"
/if ((${Me.CombatAbilityReady["Clawstriker's Flurry"]}) && (${Target.Distance}<18) && (${Me.Endurance}>300)) /doability "Clawstriker's Flurry"
/return
|--------------------------------------------------------------------------------
|SUB: Feign Death (Something went terribly wrong)
|--------------------------------------------------------------------------------
Sub FDend
/doability "Feign Death"
/echo LOW HP!!!! FD!
/call SecondLife
|--------------------------------------------------------------------------------
|Event Triggers
|--------------------------------------------------------------------------------
Sub Event_Stunned
/delay 1s
/return
Thanks in advance! I appreciate all the help I have recieved so far. Its been a great community =)