This is the first beta release of my Shell.mac. Basically, the Shell macro is a macro designed to incorporate many other scripts into one, and to allow customization of scripts for different characters. The Shell is currently set up to run all the provided scripts, though some are currently untested. If anyone wants more scripts added, feel free to add to the macro yourself, or post a request here and I'll see what I can do. Also posted is a sample INI file with basic information to make the macro run.
EDIT: 6/3/07 Fixed a few more parts, added spelltrain.inc to post, had missed it last time.
EDIT: 6/3/07 Thanks to Shin Noir, added the code for Frenzy to INI and skills.inc.
EDIT: 6/4/07 Fixed memspell script to work for 9th spell gem.
Features.txt:
Sample.ini6/3/2007 Beta Version 1.1
Written primarily by Jacen Solo, with some scripts borrowed from others. Code from others is marked as such in it's file. (If you wrote code which I have used and I failed to credit you, please tell me so I can fix it.)
NOTE: I am currently working on fixing up these scripts to work with shell.mac. They are included, and don't stop other functions from running currently.
Also, "Untested" is literal. Some might work perfectly as is, but I haven't tested them enough yet to be able to confidently say they work.
Untested Scripts:
* Assist
* Camp
* Chat
* Drag
* Lang
Untested Features:
* Storing your main and secondary assist's names. Allows use of /assistma and /assistsa, letting you change assists without modding scripts or hotbuttons.
* Watching for specific mobs to spawn. If the specified mob spawns, it beeps, and stores its spawn time in an INI. It also moniters despawns of the specified mob. This can be used to map mob spawn cycles.
* Dragging of an unlimited number of corpses.
* Language script with 3 modes. Spam (spams "a" in gsay), Teach (spams "a" in gsay, auto moves to next language after so many repetitions), and Lang, which accepts the correct tell, invites the sender, spams "a", auto changes to next language, and disbands when done.
* Watch specific chat channels and run commands when chat is recieved.
Untested Commands:
* /ma PlayerName --- Sets PlayerName as your main assist. For use with /assistma.
* /targma --- Sets your current target as your main assist. For use with /assistma.
* /assistma --- Targets whatever your current main assist is targetting.
* /sa PlayerName --- Sets PlayerName as your secondary assist. For use with /assistsa.
* /targsa --- Sets your current target as your secondary assist. For use with /assistsa.
* /assistsa --- Targets whatever your current secondary assist is targetting.
* /campadd MobName --- Adds MobName to the spawn watch list for the zone you are in.
* /drag --- With no parameter, drags your target's corpse until you don't have a target.
* /drag Name1 Name2 Name3 --- With parameters, drags an unlimited number of corpses until you target yourself.
* /spam --- Begins spam of "a" in main chat window. Stops when you target yourself.
* /teach --- Begins spam and automatic cycling of languages. Skips to next language if you target yourself.
* /lang --- Begins language autorun. Accepts tells saying "Teach Me." and invites sender. When sender accepts, spams and cycles languages. When done, disbands. Also accepts tells saying "Teach More LangNumberHere", sends invite, then runs extra repetitions of that language.
Tested Scripts:
* Clickies
* Combine
* Drunk
* EXPTrack
* Farm
* FeedMe
* Fish
* MemSpell
* SelfBuff
* Skills
* Spells
* SpellTrain
Tested Features:
* Automatic refresh of clickies.
* Alcohol Tolerance maxxing tool which uses Brell's Fishing Pole.
* EXP and AA tracker. Stores variables with EXP and AA gain per minute and estimated time till ding or ping. Variables can be displayed in a HUD.
* Drop farmer. Tracks and kills mobs matching the given parameter, looting items which match the table in the INI.
* Fishing script which uses Hargar's Brand Fishing Pail and Fisherman's Companion. Has INI support, and can maintain FD.
* Spell set loader with INI support.
* Automatic refresh of self buffs.
* Skill Routines script for automatically using skills.
* Spell Routines for use in other scripts
* Spell skill trainer, maxes skills for spells you have memmed.
* Loads HUD parts.
* Loads other settings.
* Basic tradeskilling combine/autoinventory script.
* Force feeding tool to conserve stat food.
Tested Commands:
* /clickies --- Toggles automatic clickie refresh
* /drunk --- Starts alcohol tolerance skillup script. Requires Brell's Fishin' Pole in a base level inventory slot.
* /farm MobName --- Kills npcs matching MobName, and loots stuff which matches INI loottable.
* /fish --- Begins fishing script. Requires Hargar Brand Fishing Pail and Fisherman's Companion.
* /memset SetName --- Loads spell set SetName from INI into gems.
* /selfbuff --- Toggles automatic self buffing.
* /spelltrain --- Practices memmed spells until that spells skill is maxed.
* /comb X --- clicks combine X times, autoinventories results, and stops if you run out of material.
* /feedme --- Toggles automatic force feeding.
* /done --- This exits scripts where the correct piece of code is added, returning to the idle loop.
Code: Select all
** Note: You must remove these comments to make the INI work.
** Name your INI with your character's name. So if your character was named Platpharmer Tosellit, your INI would be Platpharmer.ini
[Setup]
** These are the subs which are called at the start of the macro. Mostly, they set variables and aliases. Remove them to disable those parts.
1=AssistPrep
2=CampPrep
3=ClickiePrep
4=CombinePrep
5=DragPrep
6=DrunkPrep
7=ExpPrep
8=FarmPrep
9=FeedMePrep
10=FishPrep
11=LangPrep
12=MemspellPrep
13=SelfBuffPrep
14=SpellTrainPrep
[Auto]
** These are the subs called on every Idle cycle and everywhere that a macro calls "/call Run". Remove them to disable that script.
1=CampCheck
2=Clickies
3=ExpTrack
4=FeedMe
5=SelfBuff
6=Skill_Routines
[HUD]
** These are the autoloaded HUD parts. Each one is loaded at the start of the macro.
1=Stats
2=Me
3=Pet
4=Target
5=TargetofTarget
6=Group
7=Veterans
8=Spawns
9=Tribute
10=Exp
11=Spells
12=Buffs
13=SDBuffs
[Food]
** These are the foods used by FeedMe.inc
Food1=Ration
Food2=Iron Ration
[Drink]
** These are the drinks used by FeedMe.inc
Drink1=Water Flask
Drink2=Bottle of Milk
[Clickies]
** These are the clickies with are refreshed by clickies.inc
1=Journeyman's Boots
2=Fabled Goblin Skull Earring
3=Eyepatch of Plunder
[SelfBuffs]
**These are the selfbuffs which are refreshed by selfbuff.inc. BuffGem is the gem where the spells are loaded if not already up.
BuffGem=5
1=Shroud of Death
2=Shadow Sight
[Skills]
** Used by skills.inc. These are the auto-used skills.
Backstab=FALSE
Bash=TRUE
Begging=TRUE
Disarm=TRUE
Evade=FALSE
FeignDeath=FALSE
FlyingKick=FALSE
Forage=FALSE
Frenzy=FALSE
Intimidation=FALSE
Kick=FALSE
Mend=FALSE
PickPockets=FALSE
SenseTraps=FALSE
Slam=FALSE
Taunt=TRUE
HitBox=15
[Settings]
** These are the settings which are loaded at the beginning of the macro. Useful to use instead of a config file.
1=/declare textgauge global
2=/varset textgauge ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3=/mapnames normal [%l %c] %N
4=/mapnames target [%l %c] %N - %h%%
[Chat]
** Used by chat.inc. These set what to watch and how to respond.
1=tell|NULL|/beep
[Spell:59]
** This is a spell set for memspell.inc.
Spell1=Drain Spirit
Spell2=Spear of Plague
Spell3=Dooming Darkness
Spell4=Torrent of Pain
Spell5=Torrent of Hate
Spell6=Shroud of Death
Spell7=Gather Shadows
Spell8=Feign Death
[LootTable]
** This is a loot table for farm.inc. Note: You do not need to add things to it manually. It stores names here, defaulting to loot. You can change to Destroy if you want.
High Quality Lion Skin=Loot
High Quality Cat Pelt=Loot
Spider Silk=Loot
Medium Quality Lion Skin=Destroy
Ruined Lion Skin=Destroy
Medium Quality Cat Pelt=Loot
Chunk of Meat=Destroy
Ruined Cat Pelt=Destroy
Lion Meat=Destroy
[The Plane of Knowledge Fishing]
** This is the looting table for fish.inc. Note: This table is autogenerated as loot is found. It defaults to loot, but you can set things to Destroy or Drop if you want.
Rusty Dagger=Destroy
Fish Scales=Destroy
Fresh Fish=LootCode: Select all
| Shell.mac
| Written by Jacen Solo
| 6/3/07 Beta Version 1.0
#include assist.inc
#include camp.inc
#include chat.inc
#include clickies.inc
#include combine.inc
#include drag.inc
#include drunk.inc
#include exptrack.inc
#include farm.inc
#include feedme.inc
#include fish.inc
#include lang.inc
#include memspell.inc
#include selfbuff.inc
#include skills.inc
#include spells.inc
#include spelltrain.inc
#define DEBUG /squelch /echo
#event return "[MQ2] End Script."
Sub Main
/if (${Ini[${Me.CleanName}.ini].Equal[NULL]}) {
/echo No INI file for ${Me.CleanName}.
/echo Instructions for setting up an INI can be found in the ReadMe.
/endmacro
}
/call Load HUD
/call Load Settings
/call Load Setup
/squelch /alias /done /echo End Script.
:loop
/call Run
/doevents
/goto :loop
/return
Sub Load
/declare run int
/for run 1 to ${Math.Calc[${Ini[${Me.CleanName}.ini,${Param0}].Count[|]}-1]}
/squelch /docommand ${If[${Param0.Equal[Setup]},/call ,${If[${Param0.Equal[HUD]},/loadhud ,]}]}${Ini[${Me.CleanName}.ini,${Param0},${run}]}
/next run
/return
Sub Run
/declare run int
/doevents
/for run 1 to ${Math.Calc[${Ini[${Me.CleanName}.ini,Auto].Count[|]}-1]}
/call ${Ini[${Me.CleanName}.ini,Auto,${run}]}
/next run
/return
Sub Event_return
/return DONECode: Select all
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| assist.inc
| Written by Jacen Solo
|
| Allows you to set a main and secondary assist on the fly, rather than changing hotkeys every time.
| Use /ma PlayerName or /sa PlayerName to set PlayerName as your main or secondary assist.
| Or use /targma or /targsa to set your current target as your main or secondary assist.
| Then you can use /assistma and /assistsa either by typing or in a hotkey to assist your set MA and SA.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event setAssist "[MQ2] Set #1#: #2#"
Sub AssistPrep
/squelch /alias /ma /echo Set MA:
/squelch /noparse /alias /assistma /assist ${MAName}
/squelch /alias /sa /echo Set SA:
/squelch /noparse /alias /assistsa /assist ${SAName}
/squelch /noparse /alias /targma /echo Set MA: ${Target.CleanName}
/squelch /noparse /alias /targsa /echo Set SA: ${Target.CleanName}
/declare MAName outer
/declare SAName outer
/return
Sub Event_setAssist
/varset ${Param1}Name ${Param2}
/returnCode: Select all
| camp.inc
| #Originally Created by Shin Noir as Track.mac.#
| Modified heavily by Jacen Solo for efficiency use with shell.mac
| Use /campadd MobName to add MobName to the tracking list for your current zone.
#event campadd "[MQ2] Add Spawn: #1#"
Sub CampPrep
/squelch /alias /campadd /echo Add Spawn:
/return
Sub Event_campadd
| Blocks against adding the same mob twice for the same zone.
/declare x int
/if (${Ini[${Me.CleanName}.ini,${Zone.Name} List].Count[|]}==0) /goto :checkskip
/for x 1 to ${Ini[${Me.CleanName}.ini,${Zone.Name} List].Count[|]}-1
/if (${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}].Equal[${Param1}]}) {
/echo Mob Already Listed
/return
}
/next x
:checkskip
| Adds the mob to the Zone's List, adds the current spawn count to the Zone's Counts, adds a date/time stamp of their name and starting spawn count to that Zone's Camp file.
/ini "${Me.CleanName}.ini" "${Zone.Name} List" "${If[${Ini[${Me.CleanName}.ini,${Zone.Name} List].Count[|]}==0,1,${Ini[${Me.CleanName}.ini,${Zone.Name} List].Count[|]}]}" "${Param1}"
/ini "${Me.CleanName}.ini" "${Zone.Name} Counts" "${If[${Ini[${Me.CleanName}.ini,${Zone.Name} Counts].Count[|]}==0,1,${Ini[${Me.CleanName}.ini,${Zone.Name} Counts].Count[|]}]}" "${SpawnCount[npc ${Param1}]}"
/ini "${Me.CleanName}.ini" "${Zone.Name}" "${If[${Ini[${Me.CleanName}.ini,${Zone.Name} Camp].Count[|]}==0,1,${Ini[${Me.CleanName}.ini,${Zone.Name} Camp].Count[|]}]}" "${Time.Date},${Time.Time24} : ${Param1}'s Count Started At ${SpawnCount[npc ${Param1}]}"
/echo ${Param1} Added.
/return
Sub CampCheck
| If no mobs are listed for the zone, returns.
/if (${Ini[${Me.CleanName},${Zone.Name} List].Count[|]}==0) /return
| Checks each mob to see if the SpawnCount has changed from the one listed in the Zone's Counts list. If it has, it adds a date/time stamp with the mob's name and its new spawn count to the Zone's Camp list and changes the Count list to the new value. It also echo's the new information.
/declare x int
/for x 1 to ${Ini[${Me.CleanName}.ini,${Zone.Name} List].Count[|]}-1
/if (${SpawnCount[npc ${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}]}]}!=${Ini[${Me.CleanName}.ini,${Zone.Name} Counts,${x}]}) {
/ini "${Me.CleanName}.ini" "${Zone.Name} Camp" "${Ini[${Me.CleanName}.ini,${Zone.Name} Camp].Count[|]}" "${Time.Date},${Time.Time24} : ${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}]}'s Count Became ${SpawnCount[npc ${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}]}]}"
/ini "${Me.CleanName}.ini" "${Zone.Name} Counts" "${x}" "${SpawnCount[npc ${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}]}]}"
/echo ${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}]}'s Count Became ${SpawnCount[npc ${Ini[${Me.CleanName}.ini,${Zone.Name} List,${x}]}]}
}
/next x
/returnCode: Select all
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chat.inc
| Written by Jacen Solo
|
| Monitors the listed chat channels and does an action specified in the INI if a channel/text match is found.
| The information for this script should be placed in your character's INI under a section called "Chat".
| Proper format for the INI entry is Number=ChannelName|Text|Response
| Where Number is the next number in the list, ChannelName is the channel you want to watch, Text is
| what you want to look for or is blank, and Response is the command you want to execute if there is a match.
|
| Examples:
| 1=tell||/beep (This would beep when a tell was received)
| 2=say|virtue|/echo ${Sender} wants virtue
|
| NOTE: If you want to monitor a channel, it must be added below as #chat ChannelToWatch, otherwise the script won't look at it.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#chat tell
#chat say
Sub Event_Chat(Channel,Sender,Text)
/declare x int
/for x 1 to ${Ini[${Me.CleanName}.ini,Chat].Count[|]}-1
/if (${Channel.Equal[${Ini[${Me.CleanName}.ini,Chat,${x}].Token[1,|]}]}) {
/if (${Text.Find[${Ini[${Me.CleanName}.ini,Chat,${x}].Token[2,|]}]} || ${Ini[${Me.CleanName}.ini,Chat,${x}].Token[2,|].Equal[NULL]}) {
/docommand ${Ini[${Me.CleanName}.ini,Chat,${x}].Token[3,|]}
}
}
/next x
/returnCode: Select all
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| clickies.inc
| Written by Jacen Solo
|
| Self buffs with the clickies listed in YourName.ini. Toggle clickie refresh with /clickies.
| List your clickies in a [Clickies] section in your INI, with each clickie in numerically ordered keys.
| Like this:
| [Clickies]
| 1=Ring of Teh Ownage
| 2=Sword of Noobage
| 3=Boots of Mob Kicking
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event toggleclickies "[MQ2] Toggle Clickie Refresh."
Sub ClickiePrep
/declare clickies int outer 0
/squelch /noparse /alias /clickies /echo Toggle Clickie Refresh.
/return
Sub Event_toggleclickies
/varset clickies ${If[${clickies},0,1]}
/echo Automatic Clickie Refresh ${If[${clickies},ON,OFF]}
/return
Sub Clickies
/if (!${clickies}) /return
/declare x int 0
/declare oldtarg int 0
/varset oldtarg ${Target.ID}
/declare oldstatus int 0
/if (${Me.Sitting}) /varset oldstatus 1
/if (${Me.Combat}) /varset oldstatus 2
/for x 1 to ${Math.Calc[${Ini[${Me.CleanName}.ini,Clickies].Count[|]}-1]}
/if (!${FindItemCount[${Ini[${Me.CleanName}.ini,Clickies,${x}]}]}) /goto :next
/if (${Me.Buff[${FindItem[${Ini[${Me.CleanName}.ini,Clickies,${x}]}].Spell.Name}].ID}) /goto :next
/target me
/attack off
/call Cast "${Ini[${Me.CleanName}.ini,Clickies,${x}]}" item
:next
/next x
/squelch /target clear
/if (${oldtarg}) /target id ${oldtarg}
/if (${oldstatus}==1 && ${Me.Standing}) /sit
/if (${oldstatus}==2 && !${Me.Combat}) /attack
/returnCode: Select all
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combine.inc
| Written by Jacen Solo
|
| Use "/comb Number" to do Number combines. Stops when that many are done or when you run out of materials.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event Combine "[MQ2] Start Combine: #1#"
#event comb_check "You lacked#*#"
#event comb_check "You have fashioned#*#"
#event comb_lack "You are missing#*#"
Sub CombinePrep
/squelch /alias /comb /echo Start Combine:
/return
Sub Event_Combine(line,int combines)
/if (!${Defined[comb_check]}) /declare comb_check int outer
/varset comb_check 0
/declare x int 0
:Loop
/call Run
/doevents return
/if (${Macro.Return.Equal[Done]}) /return RESET
/if (${Window[TradeskillWnd].Child[CombineButton].Enabled}) /notify TradeskillWnd CombineButton leftmouseup
/if (${Cursor.ID}) {
/autoinventory
/delay 5
/goto :Loop
}
/doevents
/if (${comb_check}==1) {
/varcalc x ${x}+1
/varset comb_check 0
}
/if (${Macro.Return.Equal[RETURN]}) /return
/autoinventory
/if (${x}<${combines}) /goto :Loop
/autoinventory
/beep
/return
Sub Event_comb_check
/varset comb_check 1
/return
Sub Event_comb_lack
/return RETURNCode: Select all
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Corpse Dragging Script
|
| Written by Diggler, updated by Dirx
| Updated, modified, and shredded by Jacen Solo for use with my shell macro.
| Use "/drag Name1 Name2 Name3" to drag all named corpses, or "/drag" to drag your target.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event Drag "[MQ2] Drag corpses: #1#"
Sub DragPrep
/squelch /alias /drag /echo Drag corpses:
/return
Sub Event_Drag
/declare ParamCount int
/declare ParamString
/declare MaxParam int -1
/if (!${Defined[Param0]}) {
/if (${Target.State.Equal[DEAD]}) {
:loop3
/cor
/delay 1
/if (${Target.ID}) /goto :loop3
/return
}
:loop
/if (${Defined[Param${ParamCount}]}) {
/varcalc MaxParam ${MaxParam}+1
/varcalc ParamCount ${ParamCount}+1
/goto :loop
}
:loop2
/for ParamCount 0 to ${MaxParam}
/if (${Target.ID}==${Me.ID}) /return
/squelch /tar ${Param${ParamCount}}'s
/cor
/delay 1
/next ParamCount
/goto :loop2
/returnCode: Select all
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drunk.inc
| Written by Jacen Solo
|
| Raise Alcohol Tolerance
| Uses Brell's Fishin' Pole. Just put it in a base inventory slot or equip it, and run the script. Will stop at max skill.
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#event Drunk "[MQ2] Start Drinking!"
Sub DrunkPrep
/squelch /alias /drunk /echo Start Drinking!
/return
Sub Event_Drunk
:Start
/call Run
/cast item "Brell's fishin' Pole"
/delay 10s ${Cursor.ID}
/itemnotify pack8 leftmouseup
/delay 5
/itemnotify pack8 rightmouseup
/delay 5
/itemnotify pack8 leftmouseup
/if (${Me.Skill[Alcohol Tolerance]}==${Skill[Alcohol Tolerance].SkillCap}) {
/beep
/return
}
/doevents return
/if (${Macro.Return.Equal[DONE]}) /return RESET
/goto :Start
/returnCode: Select all
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Records Exp and AA gain, and estimated time till ding/ping (Designed for use with EXPGain, AAGain, EXPTime, and AATime displayed in HUD)
| To use, add lines in your HUD to display the EXPGain, AAGain, EXPTime, and AATime.
|
| Created by Neolesh
| Updated, modified, and shredded by Jacen Solo for use with my shell macro.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sub ExpPrep
/declare Exper float outer ${Me.PctExp}
/declare AAExp float outer ${Me.PctAAExp}
/declare TotalAAExp float outer 0.00
/declare TotalExp float outer 0.00
/declare EXPGain float outer 0.00
/declare AAGain float outer 0.00
/declare EXPTime float outer 0.00
/declare AATime float outer 0.00
/return
Sub ExpTrack
/if (${Me.PctAAExp}>=${AAExp}) {
/varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}]}
} else {
/varset AAExp ${Math.Calc[${Me.PctAAExp}-${AAExp}+100]}
}
/if (${Me.PctExp}>=${Exper}) {
/varset Exper ${Math.Calc[${Me.PctExp}-${Exper}]}
} else {
/varset Exper ${Math.Calc[${Me.PctExp}-${Exper}+100]}
}
/varcalc TotalAAExp ${TotalAAExp}+${AAExp}
/varcalc TotalExp ${TotalExp}+${Exper}
/varset EXPGain ${Math.Calc[${TotalExp}/${Math.Calc[${Macro.RunTime}/60]}]}
/varset AAGain ${Math.Calc[${TotalAAExp}/${Math.Calc[${Macro.RunTime}/60]}]}
/if (${TotalExp}==0) {
/varset EXPTime 0
} else {
/varset EXPTime ${Math.Calc[${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}/${TotalExp}]}*${Math.Calc[100-${Me.PctExp}]}]} minutes
}
/if (${TotalAAExp}==0) {
/varset AATime 0
} else {
/varset AATime ${Math.Calc[${Math.Calc[${Math.Calc[${Macro.RunTime}/60]}/${TotalAAExp}]}*${Math.Calc[100-${Me.PctAAExp}]}]} minutes
}
/varset Exper ${Me.PctExp}
/varset AAExp ${Me.PctAAExp}
/returnCode: Select all
| farm.inc
| Written by Jacen Solo
|
| Use "/farm MobName" to begin farming. Will hunt anything matching MobName.
| The script builds an INI of loot found in YourName.ini. It defaults to Loot, but you can set items to Destroy.
#define FARMDEBUG /squelch /echo
#event Farm "[MQ2] Start Farming: #1#"
Sub FarmPrep
/squelch /alias /farm /echo Start Farming:
/return
Sub Event_Farm
/echo Mob: ${Param1}
/declare lootslot int 1
/if (!${Me.AFK}) /afk
:LoopMain
/doevents return
/if (${Macro.Return.Equal[Done]}) /return RESET
/if (${Me.FreeInventory}==0) /goto :End
/if (${SpawnCount[gm]}) /goto :End
/if (${SpawnCount[pc]}>1) /goto :Pause
/call Run Auto
/doability Hide
/if (${Me.PctHPs}<70) {
/sit
:LoopMed
/doevents return
/delay 5
/if (${Me.PctHPs}<95 && ${Me.Sitting}) /goto :LoopMed
}
/if (${Target.ID}) /goto :LoopMove
/squelch /target npc ${Param1}
/delay 5
/if (!${Target.ID}) /goto :LoopMain
:LoopMove
/doevents return
/if (${Macro.Return.Equal[Done]}) /return RESET
/face fast nolook
/if (${Target.Distance}>10) {
/keypress forward hold
/goto :LoopMove
}
/if (${Me.Speed}) /keypress forward
:LoopCombat
/doevents return
/if (${Macro.Return.Equal[Done]}) /return RESET
/if (${Target.Distance}<${Math.Calc[${Target.MaxRangeTo}*2]} && !${Me.Combat}) /attack
/call Skill_Routines
/if (${Target.ID}) {
/if (${Target.Distance}<10) {
/goto :LoopCombat
} else {
/goto :LoopMove
}
}
/if (${Me.Speed}) /keypress forward
FARMDEBUG Mob is Dead
/doevents return
/if (${Macro.Return.Equal[Done]}) /return RESET
/target corpse ${Param1}
FARMDEBUG Corpse Targetted
/face fast nolook
/click right target
/delay 10m ${Window[LootWnd].Open}
/delay 2s
FARMDEBUG Loot Window Open
/if (!${Corpse.Items}) {
FARMDEBUG No Items On Corpse
/goto :corpsedone
}
:cursorloop1
/itemnotify loot${lootslot} leftmouseup
/if (!${Cursor.ID}) /goto :cursorloop1
:lootretry
FARMDEBUG Checking Item ${lootslot} : ${Cursor.Name}
/if (${Ini[${Me.CleanName}.ini,LootTable,${Cursor.Name}].Equal[Loot]}) {
FARMDEBUG Item ${Cursor.Name} Is Set To Loot
:cursorloop2
/autoinventory
/if (${Cursor.ID}) /goto :cursorloop2
} else /if (${Ini[${Me.CleanName}.ini,LootTable,${Cursor.Name}].Equal[Destroy]}) {
FARMDEBUG Item ${Cursor.Name} Is Set To Destroy
:cursorloop3
/destroy
/if (${Cursor.ID}) /goto :cursorloop3
} else {
FARMDEBUG Item ${Cursor.Name} Is Not Listed
/ini "${Me.CleanName}.ini" "LootTable" "${Cursor.Name}" "Loot"
FARMDEBUG ${Cursor.Name} Added.
/goto :lootretry
}
/if (${Corpse.Items}>0) {
/varcalc lootslot ${lootslot}+1
/goto :cursorloop1
}
:corpsedone
/varset lootslot 1
FARMDEBUG Done Checking Loot
/delay 5
/notify LootWnd DoneButton leftmouseup
FARMDEBUG Loot Window Closed
/delay 10m !${Window[LootWnd].Open}
/goto :LoopMain
:Pause
/doability Hide
/delay 10000m ${SpawnCount[pc]}<2 || !${Me.AFK} || ${Me.HPs}<60
/goto :LoopMain
:End
/doability Hide
/camp
/endmacro
/return


