- Joined
- Feb 6, 2007
- RedCents
- 1,483¢
I would like to add a feature to the YAFM (included below) that will check for the kick off request window. When detected it will end the macro and accept the kick off or prehaps better to reject the kick off and simple camp out of the game. I leave for Iraq in two days and need the code segment for testing within about 24 hours of this post. Any help is greatly apprcieted.
YAFM needing modified:
YAFM needing modified:
Rich (BB code):
|yafm.mac
|
|Yet Another Forage Macro
|
|Ini File: yafm.ini
|
| 0 = destroy
| x = keep at most x of this item
|
|New foraged items are added to the ini file automatically and are kept by default.
||||||||||||||||||||
| Main
||||||||||||||||||||
#Event Camping "#*#It will take you about 30 seconds to prepare your camp.#*#"
sub Main
/echo forage macro started
/declare DefaultMaxSave int outer
/varset DefaultMaxSave ${Ini[yafm.ini,Default,MaxSave,${NotFound}]}
/if (${DefaultMaxSave}==${NotFound}) {
/ini "yafm.ini" "Default" "MaxSave" "100"
/varset DefaultMaxSave 100
}
/delay 1
| Verify that we have the ability to forage.
| /if (!${Me.Mount.Equal[Null]}) /goto :Exit
/if (${Me.Skill[Forage]}==0) /goto :Exit
:Forage
| If we can forage then do so.
/if (${Me.AbilityReady[Forage]}) {
| Stand up. Can't forage while sitting.
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/doability forage
}
| If we successfully foraged something then take care of it.
/if (${Cursor.ID}) {
/call HandleItem
}
/doevents
/goto :Forage
:Exit
/echo You cannot forage, silly person!
/return
||||||||||||||||||||
| HandleItem
||||||||||||||||||||
sub HandleItem
/declare ItemSetting int local
/declare NotFound int local
/declare ItemsHave int local
/varset NotFound -1
:LootIt
| Look up this item in yafm.ini
/varset ItemSetting ${Ini[yafm.ini,ForageList,${Cursor.Name},${NotFound}]}
/delay 5
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/ini "yafm.ini" "ForageList" "${Cursor.Name}" "${DefaultMaxSave}"
/varset ItemSetting ${DefaultMaxSave}
}
/varset ItemsHave ${FindItemCount[=${Cursor.Name}]}
| If we're keeping this item then stash it in our bags.
| Otherwise, just destroy it.
/if (${ItemSetting}>${ItemsHave}) {
/echo Keeping "${Cursor.Name}" only ${ItemsHave} of ${ItemSetting} on hand
/autoinventory
} else {
/echo Destroying "${Cursor.Name}" already have ${ItemsHave} of ${ItemSetting}
/destroy
}
/delay 5
/if (${Cursor.ID}) /goto :LootIt
/return
Sub Event_Camping
/echo Camping - Ending macro!
/endmacro
/return
Last edited: