ammonone79
New member
- Joined
- May 1, 2006
- RedCents
- 11¢
This macro I wrote because yafm didn't meet my needs.
There may be some idea's out there as to how I can make this better and I am more then open to them.
BTW this is also posted in the VIP Section of macroquest by me. I do not mind it being redistrubited... Good luck and happy foraging.
There may be some idea's out there as to how I can make this better and I am more then open to them.
BTW this is also posted in the VIP Section of macroquest by me. I do not mind it being redistrubited... Good luck and happy foraging.
Rich (BB code):
#include spell_routines.inc
#event ReGate "#*#spell is interrupted#*#"
#event ReGate "#*#spell fizzles!#*#"
#event ReGate "#*#standing to cast#*#"
#chat tell
/declare gatecount int global
||||||||||||||||||||
| Main
||||||||||||||||||||
sub Main
/echo Starting YAFM!
/declare DefaultMaxSave int outer
/varset gatecount 0
/varset DefaultMaxSave ${Ini[yafm.ini,Default,MaxSave,${NotFound}]}
| Verify that we have the ability to forage.
/if (${Me.Skill[Forage]}==0) {
/echo You cannot forage, silly person!
/goto :Exit
}
:Forage
/call Egate
/call GMCheck
|Stand up. Can't forage while sitting.
/if (${Me.State.NotEqual[Stand]}) {
/stand
/delay 5
}
| If we can forage then do so.
| Make sure to have forage as one of your buttons on your Actions menu.
/if (${Me.AbilityReady[Forage]}) {
/doability forage
}
| If we successfully foraged something then take care of it.
/if (${Cursor.ID}) {
/call HandleItem
}
/doevents
/goto :Forage
:Exit
/return
||||||||||||||||||||
| HandleItem
||||||||||||||||||||
sub HandleItem
/declare ItemSetting int local
/declare ItemsHave int local
/declare NotFound -1
:LootIt
| Look up this item in yafm.ini
/varset ItemSetting ${Ini[yafm.ini,${Zone.Name},${Cursor.Name},${NotFound}]}
/delay 5
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/echo Zone ${Zone.Name} and Item ${Cursor.Name} Not found adding it now...
/Ini "yafm.ini" "${Zone.Name}" "${Cursor.Name}" "${DefaultMaxSave}"
/varset ItemSetting ${DefaultMaxSave}
}
/varset ItemsHave ${FindItemCount[=${Cursor.Name}]}
/goto :Handlethis
/return
| If we're keeping this item then stash it in our bags.
| Otherwise, just destroy it.
:Handlethis
/if (${ItemSetting}>${ItemsHave}) {
/echo (${Cursor.Name}),(${ItemSetting}),(${ItemsHave})
/autoinventory
} else {
/echo Destroyed (${Cursor.Name})
/destroy
}
/delay 5
/if (${Cursor.ID}) /goto :LootIt
/return
|--------------------------------------------------------------------------------
|SUB: Check for GM's in zone.
|--------------------------------------------------------------------------------
Sub GMCheck
/if (${Spawn[gm].ID}) {
/beep
/beep
/beep
/echo GM entered the zone!
/echo For safty reasons ending the macro...
/camp desktop
/endmacro
}
/return
|---------------------------------------------------------------------------------
|SUB: Log on Tell
|---------------------------------------------------------------------------------
Sub Event_Chat(type,sender,line)
/echo ${type}
/echo ${sender}
/echo ${line}
|Change charactername to the character that you want to be able to tell you to log.
|This is handy when sharing an account.
/if (${sender.Equal[charactername]}) {
/echo ${sender} sent me a tell and it said ${line}
/if (${line.Find[log]}) {
/camp desktop
/endmacro
}
}
/return
|---------------------------------------------------------------------------------
|SUB: Gate when being attacked.
|---------------------------------------------------------------------------------
Sub Egate
/squelch /target ${Spawn[npc radius 50]}
/if (${Target.ID}) {
/echo ${Target.CleanName}
/cast 8 |spell Ring of Combine.
/target clear
/doevent ReGate
/varcalc gatecount ${gatecount}+1
/echo ${gatecount}
}
| If someone trains you more then 3 times and you have ported 3 times then gate and camp
/if (${gatecount} > 2) {
/echo Can't shake this dude, Gating and camping
/tar pc
/tar next pc
/tell ${Target.DisplayName} Thanks!
/cast 9 |spell Gate
/delay 20s
/camp desktop
/endmacro
}
/return
|------------------------------------------------------------------
|Event ReGate - Try the spell again if it fails.
|------------------------------------------------------------------
Sub Event_ReGate
/if (${gatecount} > 2) {
/echo Can't shake this dude, Gating and camping
/tar pc
/tar next pc
/tt Thanks!
/cast 9 |spell Gate
/delay 20s
/camp desktop
/endmacro
}
/cast 8 |spell Ring of Combine
/return
Last edited:

