
This is the most complex script I have undertaken to date. I've been working on it for a long time, and will probably still be working on it for a good while.
It's meant to be a be-all end-all looter program. It loots corpses, chests, and your own inventory of desired items and sorts them into three bags(may one day be expanded to any number). You choose what items to loot and where to loot them. I designed this script initially because most common looting scripts do not make use of the holding bags available on excelsior, and I wanted one that did.
This is far from complete, which is why I marked it test. I want any comments, questions, or issues posted here should they arise. I also want ideas to make it better. I intend to add functions for automatically smelting ore that is found anywhere(for example, when you mine ore falls into your pack, and since this program sorts your pack too, it can be made to function like that), putting metals and wood onto keys automatically, and adding custom item lists for looting. I will also someday likely integrate my [claim script into this one, provided I can get this one working perfectly. There may be more ideas that I have later, but for now that's all.
Loots: (green = available in the next release, blue = newest additions to script available below)
-Gold
-Oints/Essences
-Champ Skulls (obsolete, will remove soon)
-Garg Axes, Knives, and Picks
-Peerless Keys (Travesty, Crypt Key, Effusion/Parox/Dreadhorn Keys)
-Recipe Scrolls
-Ore/Logs/Boards
-Runic Tools
-Jewels
-Quest Stacks (such as Zoogi Fungus)
-Trans-Powder Items (Pet Summon Ball, Bracelet of Binding)
-Mage and Druid Regs
-Peerless Stackables (such as Eye of Travesty, Corruption, Elven Notes, etc)
-Peerless Nonstackables (such as Dog Imprisoned In A Crystal, Crimson Cincture, etc)
-Every Single Item in the Mage Quest
-Arrows
-Arcane Gems
-Seeds
Items/Features Yet To Be Added:
-Bones
-Necro Regs
-Para Chest Auto-Open
-Autosmelting using Mobile Forge
-Auto-add items to keys (this is now on the menu but does nothing yet)
-Item Evaluation (this may be a ways off yet)
-"Scavenger" element to search nearby ground as well.
-Ideas?
Changes made:
-Moved Parox spawning items to Peerless Keys section
-Added a "save" button to the options screen so you don't have to look at your item selections every time you change options.
-Added three new options. Loot During Battle, which if checked will cause the script to not wait if you currently have a battle target. Use Lockpicks Instead of Magic, which allows you to use lockpicks over the traditional magical approach when a locked chest is encountered. And...Auto-Add Items to Keys, which after each looting cycle adds any found items that can be keyed to their respective keys. This of course required...
-Added a setup for getting the IDs of your keys. The script will automatically detect them in your main pack. If you don't keep your keys there it won't detect them...if I figure out the issue I'm having with using items in closed bags I'll change that.
-"Locked Down & Secure" chests will no longer be targeted by the chest looting phase

-If the topmost corpse that is open is the one the script stopped looting because of some condition(like having a target or something), it will no longer try to re-open the corpse, saving a little time and processing by the server

-Removed Glacial Staff from loot list...it's common and not that great.
-Fixed a bug that was picking up rings that had the same type as Sabrix Eye.
-Added a "Done." message when a corpse is finished being looted but only if "Close Corpses" is off.
-Added support for sub-containers.
-Fixed a bug in the method I had used to read info on chests.
-Fixed the "That is out of sight" message being repeated over and over due to an item being not draggable. Hopefully this being caught now will prevent crashes.
Known Issues:
1. This is a heavy script. It may crash your UO if used with too many others at once or if you have a crappy system.
2. Sometimes the script may loot items that you don't desire it to. I'm still in the process of filtering the items, so if anything falls into your looting packs that you don't want or didn't select somewhere, please post it here for me to add to the filter.
3. There is some evidence now to indicate that if this script is crashing your UO client, you may have some incorrect registry entries. There is a post at the top of this forum to help you fix that (Cannot find suitable cliloc file). I realize this topic relates to razor, not easyUO, but these registry entries being discussed are those of UO, not of Razor. Razor reads these registry entries as does EasyUO, so fixing them would probably help

Enjoy!!
Code: Select all
;------------------------+
;Kaiana's Uber-Looter |
;(for looting items) |
;------------------------+
;NOTES TO SELF (Stuff to do)
;1 - make invcleanup do more, such as smelting ore on
; mobile forge and putting in keys
;2 - Add deathwatch beetle seeds
;3 - search nearby ground
;4 - good drop assessment (way later)
;para chest item type IIF_HIF
;bones = GUF
;Cell Key - DFG
;torso pieces and irk's brain need filters
set %version 0.91c
set %build 10.11.10
event SysMessage Kaiana's UberLooter version %version build %build ...
;New in version 0.5 - Chest looting!
;New in version 0.6 - Minimalized LastObject interference, improved speed!
;New in version 0.65 - Setup menu and bag saving!
;New in version 0.7 - Item Setup and saving!
;New in version 0.8 - Mage quest looting! More efficiency!
;New in version 0.85 - More options!
;New in version 0.87 - Save button on Options menu!
;New in version 0.88 - Added more items!
;New in version 0.88b - Interface changes...
;New in version 0.90 - Lockpicking, various fixes and tweaks
;New in version 0.91 - Lockpicking fixes, sub-container support
event SysMessage New in version %version - Lockpicking fixes, sub-container support
set %testX #SCNT2
;set IMPORTANT bag variables
set %waitTime 10
set %myHoldingBag *savedHoldingBag
set %myOtherBag *savedOtherBag
set %myJewelBag *savedJewelBag
set %mySpellKeys *savedSpellKeys
set %myMetalKeys *savedMetalKeys
set %myWoodKeys *savedWoodKeys
set %myTailorKeys *savedTailorKeys
set %myStoneKeys *savedStoneKeys
;set other IMPORTANT stuff
set %beenGhost #false
set %moveToCorpse #false
set %paused #false
set %picksSet #false
set %currPicksID X
set %currPicksType X
set %pauseTimer 0
set %lootTypeReturn 0
set %levelsDeep 0
set %tempIgnoring #false
set *isLooting #false
;set up support for key gumps
set %spellMenuSize 505_475
set %metalMenuSize 505_270
set %woodMenuSize 505_295
set %tailorMenuSize 505_440
set %stoneMenuSize 505_270
set %spellAddX 290
set %spellAddY 435
set %metalAddX 290
set %metalAddY 235
set %woodAddX 290
set %woodAddY 260
set %tailorAddX 290
set %tailorAddY 410
set %stoneAddX 290
set %stoneAddY 235
;=================ITEM LISTS
;============MISC
set %gold POF_ ;Gold
set %oints WLF_ ;Ointment, Essences
set %skulls PCK_QCK_ ;All Champ skulls, human skulls(dark father)
set %gargs ZRF_GMH_QPF_ ;Garg Items
set %recipes PIP_ ;Recipe Scrolls
set %ores DWJ_ENK_TLK_ZLK_ ;All Ore/Ingots/Boards/Logs
set %runictools TLH_KTL_UFG_ ;Runic Hammer, Runic Tinker, Runic Fletcher
set %jewels EVF_HVF_BVF_RVF_ZVF_GVF_NVF_UVF_FXS_GXS_ZWS_AXS_TWS_WWS_VWS_UWS_VVF_
set %seeds PDF_
set %arrows RWF_
set %arcanegems JSL_
set %filters UJG_ZRF_GMH_QPF_RMH_XMF_POL_IJG_GMF_FSF_EWH_MPF_PZF_XDI_SEG_REG_CFG_DCI_YWL_ZWF_RZF_LWL_
;============QUEST STACKS
;Zoogi Fungus, Daemon Bones
set %queststacks TTO_OZF_
;============TRANS-POWDER ITEMS
;Bracelet of Binding, Pet Summoning Ball
set %transpowderitems IJG_GMF_
;============IMPRISONED PETS
;Imprisoned Dog/Squirrel, Imprisoned Ferret
set %imppets XWL_BXL_
;============NON-NECRO REGS
;Normal Regs (Magery, Druid)
set %regs KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_PLF_WLF_IND_
;============PEERLESS NON-STACKABLES
;Mark of Travesty, Map, Teakwood Tray (x2), Sushi Prep (x2),
;Travesty's Collection of Shells (x2), Crimson Cincture,
;Parrot Deed, Melisande's Corroded Hatchet, Bat Wings
;Dread's Revenge Medallion of the Undead,
;Crystalline Ring, Necromancer's Cloak
set %peerlessnonstacks PZH_SVH_ETD_BTD_TML_WML_HXF_TXF_XDI_EWH_FSF_NVI_WRH_SJG_UJG_DCI_
;============PEERLESS STACKABLES
;Eye of Travesty, Corruption, Putrefaction, Blight,
;Scourge, Taint, Muculent, Elven Notes
set %peerlessstacks LWS_EWS_GWS_JWS_DWS_FWS_QWS_XMF_
;============PEERLESS KEYS
;Serpent Fang Key, Dragon Flame Key, Tiger Claw Key,
;Door & Chest Key, Crypt Key are in first three
;...and then:
;Sabrix's Eye, Thorny Briar, Blighted Cotton, Lissith's Silk, Irk's
;Brain/Rabid Brain, Gnaw's Fang, Severed Right Leg,
;Severed Left Leg, Severed Left Arm, Rotting Head,
;Severed Right Arm, Blackened Heart, Dismembered Torso
;Scattered Crystal, Crystal Fragments, Shattered Crystal,
;Broken Crystal, Fractured Crystal, Piece of Crystal
set %peerlesskeys SEG_REG_CFG_LWL_WIS_FPE_RZF_YWK_MIG_MWK_KWK_GJL_WIL_VIL_LWK_FIL_CXM_OXM_HXM_XBN_UBN_EXM_
;============COLLECTOR ITEMS
;=====Prism of Light:
;Prism of Light, Ice Wyrm Spike, A Hydra Scale, Krystalen,
;Ring of Ice, Icy Heart, A Frozen Soul, Jar Of Glacial Water
set %mageitemsprism YWL_PWS_STO_RBN_UJG_DAG_FAV_JEG_
;=====Blighted Grove:
;Lady Melisande's Spellbook, Remnants of an Ancient Ent,
;Insanity Taffy, Abscess Tooth, Dream Catcher, Tangle Fluid,
;Thrasher's Scale
set %mageitemsblight MPF_LSE_FND_IEG_VLK_LHJ_STO_
;=====Bedlam:
;Grizzled Bones, Jade Amulet, Skeleton Key, Jonath's Mask,
;Adam's Rib
set %mageitemsbedlam VNF_AXS_CFG_BCP_MJK_
;=====Sanctuary:
;Dead Mouse, Magic Stones, Smoldering Larynx, Cyclopean Axe,
;A Spanish Doubloon
set %mageitemssanc YRL_HNL_NWK_RMH_POF_
;=====Labyrinth:
;Horn of Defeat, A Pyre's Feathers, An Egiptski Relic,
;A Skorp Stinger, A Gold Nugget
set %mageitemslaby ZWF_QFF_SXF_PZF_KXF_
;=====Paroxysmus:
;Acid Proof Rope, Deadly Fang, Radioactive Material, Vile Venom,
;Smelly Goo
set %mageitemsparox MSL_QWI_WLF_HMF_UZG_
;============BOX TYPES - For Chest Looting
set %boxTypes KIF_ZTD_UMF_IIF_BKF_BUD_WMF_IKF_VMF_KKF_JKF_HIF_JIF_CUD_HKF_KER_CIR_ZHR_EIR_XHR_HIR_KIR_
set %bagTypes CKF_ZJF_LKF_UXM
;SETUP LOOT BAGS
set %lootNormal *savedLootNormal
set %lootHolding *savedLootHolding
set %lootJewels *savedLootJewels
set %lootAll *savedLootAll
;Setup targeting stuff
set %targetType X
set %targetKind X
set %targetID X
set %targetLocX X
set %targetLocY X
set %currKind X
set %contOpen #false
;Setup clicking stuff
set %openLocX #CLIXRES - 144
set %openLocY #CLIYRES - 212
set %boxLocX #CLIXRES - 180
set %boxLocY #CLIYRES - 240
set %closeLocX %openLocX + 30
set %closeLocY %openLocY + 30
set %closeBoxLocX %boxLocX + 30
set %closeBoxLocY %boxLocY + 30
;Setup savelast stuff
set %lastObjectID X
set %lastObjectType X
set %lastTargetID X
set %lastTargetKind X
;display load time
set %testX #SCNT2 - %testX
event SysMessage Loaded Items in %testX tenths of a second.
event SysMessage Hold Ctrl+Delete to pause.
gosub SetupBags
gosub SetupItems
display ok Script started successfully.$$To pause the script, hold CTRL+DEL.$To unpause again, hit DEL.$While paused, hit INSERT to access the setup again.
loop:
onhotkey DELETE CTRL
gosub PauseLoop
gosub MainLoop
onhotkey DELETE CTRL
gosub PauseLoop
gosub ChestLoop
onhotkey DELETE CTRL
gosub PauseLoop
gosub CleanUpInv
goto loop
;=============SETUPBAGS ROUTINE - menu open
;Brings up menu
sub SetupBags
{
;Check if setup is already completed
if *isDone = 1
return
displaymenu:
menu Window Size 360 180
menu Window Title UberLooter
menu Image Create div1 0 0 360 180
menu Font Size 9
menu Text txtHolding 0 0 Stackables Bag ID: %myHoldingBag
menu Text txtOther 0 16 Non-Stackables Bag ID: %myOtherBag
menu Text txtJewelBag 0 32 Gem Pouch ID: %myJewelBag
menu Image Line div1 198 0 198 79 black 1
menu Image Line div1 0 47 198 47 black 1
menu Image Line div1 0 79 360 79 black 1
menu Text txtSpellKeys 200 0 Spell Keys ID: %mySpellKeys
menu Text txtMetalKeys 200 16 Metal Keys ID: %myMetalKeys
menu Text txtWoodKeys 200 32 Wood Keys ID: %myWoodKeys
menu Text txtTailorKeys 200 48 Tailor Keys ID: %myTailorKeys
menu Text txtStoneKeys 200 64 Stone Keys ID: %myStoneKeys
menu Button btnSetup 0 48 100 16 Setup
menu Text txtInfo 0 64 If bags/keys show N/A, click Setup.
menu Check chkLootCorpses 0 80 200 16 #true Loot Corpses
menu Check chkCloseCorpses 10 96 200 16 #true Close Corpses After Looting
menu Check chkLootChests 0 112 200 16 #true Loot Chests
menu Check chkLockpick 10 128 200 16 #true Use Lockpicks Instead of Magic
menu Check chkCleanInv 0 144 200 16 #true Clean Up Inventory
menu Check chkAutoKey 10 160 200 16 #true Auto-Add Items to Keys
menu Check chkBattleLoot 200 80 160 16 #true Loot During Battle
menu Button btnDone 260 140 100 20 Items...
menu Button btnSave 260 160 100 20 Save
if *optionCloseCorpses = 0
menu set chkCloseCorpses 0
if *optionCleanInv = 0
menu set chkCleanInv 0
if *optionLootCorpses = 0
menu set chkLootCorpses 0
if *optionLootChests = 0
menu set chkLootChests 0
if *optionLockpick = 0
menu set chkLockpick 0
if *optionAutoKey = 0
menu set chkAutoKey 0
if *optionBattleLoot = 0
menu set chkBattleLoot 0
menu HideEUO
menu Show
set #MENUBUTTON X
repeat
{
sleep 1
}
until #MENUBUTTON <> X
if #MENUBUTTON = Closed
halt
if #MENUBUTTON = btnSetup
{
menu Hide
;Get stackable bag
display ok Please target your bag for stackables. You may wish to use a holding bag for this category.
event macro 8 7 ;open backpack
set #TARGCURS 1
set #LTARGETID X
repeat
{
sleep 1
}
until #LTARGETID <> X
set %myHoldingBag #LTARGETID
;Get non-stackable bag
display ok Please target your bag for non-stackables. A pouch or chest with a high item limit works best.
set #TARGCURS 1
set #LTARGETID X
repeat
{
sleep 1
}
until #LTARGETID <> X
set %myOtherBag #LTARGETID
;Get jewel bag
display ok Please target your gem pouch. (Excelsior Exclusive!) $$If you do not have a gem pouch, it is recommended you use the same bag you used for stackables.
set #TARGCURS 1
set #LTARGETID X
repeat
{
sleep 1
}
until #LTARGETID <> X
set %myJewelBag #LTARGETID
;Get spell keys
;display okcancel Please target your spellcaster's keys. (Cancel if you do not have them.)
;if #dispres <> cancel
;{
; set #TARGCURS 1
; set #LTARGETID X
; repeat
; {
; sleep 1
; }
; until #LTARGETID <> X
; set %mySpellKeys #LTARGETID
;}
set %mySpellKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Spell , #spc , Caster in #property && Keys in #property
set %mySpellKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %mySpellKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %mySpellKeys <> N/A
display ok Spell Caster's Keys Found!
else
display ok No Spell Caster's Keys Detected.
;get metalworker's keys
set %myMetalKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Metal , #spc , Worker in #property && Keys in #property
set %myMetalKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %myMetalKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %myMetalKeys <> N/A
display ok Metal Worker's Keys Found!
else
display ok No Metal Worker's Keys Detected.
;get woodworker's keys
set %myWoodKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Wood , #spc , Worker in #property && Keys in #property
set %myWoodKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %myWoodKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %myWoodKeys <> N/A
display ok Wood Worker's Keys Found!
else
display ok No Wood Worker's Keys Detected.
;get tailor's keys
set %myTailorKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Tailor in #property && Keys in #property
set %myTailorKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %myTailorKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %myTailorKeys <> N/A
display ok Tailor's Keys Found!
else
display ok No Tailor's Keys Detected.
;get stoneworker keys
set %myStoneKeys N/A
finditem NUI C_ , #BACKPACKID
repeat
{
if #FINDKIND <> -1
{
event property #FINDID
if Stone , #spc , Worker in #property && Keys in #property
set %myStoneKeys #FINDID
else
{
ignoreitem #FINDID 3
finditem NUI C_ , #BACKPACKID
}
}
}
until %myStoneKeys <> N/A || #FINDKIND = -1
;keys found or all keys checked and none found
ignoreitem reset 3
if %myStoneKeys <> N/A
display ok Stone Worker's Keys Found!
else
display ok No Stone Worker's Keys Detected.
goto displaymenu
}
if #MENUBUTTON = btnDone || #MENUBUTTON = btnSave
{
menu Get chkCloseCorpses
set *optionCloseCorpses #menures
menu Get chkCleanInv
set *optionCleanInv #menures
menu Get chkLootCorpses
set *optionLootCorpses #menures
menu Get chkLootChests
set *optionLootChests #menures
menu Get chkLockpick
set *optionLockpick #menures
menu Get chkAutoKey
set *optionAutoKey #menures
menu Get chkBattleLoot
set *optionBattleLoot #menures
set *savedHoldingBag %myHoldingBag
set *savedOtherBag %myOtherBag
set *savedJewelBag %myJewelBag
set *savedSpellKeys %mySpellKeys
set *savedMetalKeys %myMetalKeys
set *savedWoodKeys %myWoodKeys
set *savedTailorKeys %myTailorKeys
set *savedStoneKeys %myStoneKeys
set *isDone 1
if #MENUBUTTON = btnSave
set *isDoneItems 1
else
set *isDoneItems 0
menu Clear
menu Hide
return
}
}
;=============SETUPITEMS ROUTINE - menu open
;Brings up item menu
sub SetupItems
{
;Check if setup is already completed
if *isDoneItems = 1
return
;Init Window------------------------------------------------------
event SysMessage Loading Items...
menu Window Size 340 480 ;
menu Window Title UberLooter Items ;
;
menu Check chkGold 0 0 180 20 #true Gold ;
menu Combo Create cmbGold 220 0 120 ;
menu Combo Add cmbGold Stackables ;
menu Combo Add cmbGold Non-Stackables ;
menu Combo Select cmbGold 1 ;
;
menu Check chkOints 0 20 180 20 #true Oints/Essences ;
menu Combo Create cmbOints 220 20 120 ;
menu Combo Add cmbOints Stackables ;
menu Combo Add cmbOints Non-Stackables ;
menu Combo Select cmbOints 1 ;
;
menu Check chkSkulls 0 40 180 20 #true Champ Skulls ;
menu Combo Create cmbSkulls 220 40 120 ;
menu Combo Add cmbSkulls Stackables ;
menu Combo Add cmbSkulls Non-Stackables ;
menu Combo Select cmbSkulls 2 ;
;
menu Check chkGargs 0 60 180 20 #true Garg Items ;
menu Combo Create cmbGargs 220 60 120 ;
menu Combo Add cmbGargs Stackables ;
menu Combo Add cmbGargs Non-Stackables ;
menu Combo Select cmbGargs 2 ;
;
menu Check chkPeerlessKeys 0 80 180 20 #true Peerless Keys/Summoners
menu Combo Create cmbPeerlessKeys 220 80 120 ;
menu Combo Add cmbPeerlessKeys Stackables ;
menu Combo Add cmbPeerlessKeys Non-Stackables ;
menu Combo Select cmbPeerlessKeys 2 ;
;
menu Check chkRecipes 0 100 180 20 #true Recipes ;
menu Combo Create cmbRecipes 220 100 120 ;
menu Combo Add cmbRecipes Stackables ;
menu Combo Add cmbRecipes Non-Stackables ;
menu Combo Select cmbRecipes 2 ;
;
menu Check chkOres 0 120 180 20 #true Ore/Wood ;
menu Combo Create cmbOres 220 120 120 ;
menu Combo Add cmbOres Stackables ;
menu Combo Add cmbOres Non-Stackables ;
menu Combo Select cmbOres 1 ;
;
menu Check chkRunics 0 140 180 20 #true Runic Tools ;
menu Combo Create cmbRunics 220 140 120 ;
menu Combo Add cmbRunics Stackables ;
menu Combo Add cmbRunics Non-Stackables ;
menu Combo Select cmbRunics 2 ;
;
menu Check chkJewels 0 160 180 20 #true Jewels ;
menu Combo Create cmbJewels 220 160 120 ;
menu Combo Add cmbJewels Stackables ;
menu Combo Add cmbJewels Non-Stackables ;
menu Combo Add cmbJewels Gem Pouch ;
menu Combo Select cmbJewels 3 ;
;
menu Check chkQuestStacks 0 180 180 20 #true Quest Stackables ;
menu Combo Create cmbQuestStacks 220 180 120 ;
menu Combo Add cmbQuestStacks Stackables ;
menu Combo Add cmbQuestStacks Non-Stackables ;
menu Combo Select cmbQuestStacks 1 ;
;
menu Check chkTransPowderItems 0 200 180 20 #true Trans-Powder Items
menu Combo Create cmbTransPowderItems 220 200 120 ;
menu Combo Add cmbTransPowderItems Stackables ;
menu Combo Add cmbTransPowderItems Non-Stackables ;
menu Combo Select cmbTransPowderItems 2 ;
; ;
menu Check chkRegs 0 220 180 20 #true Regs (Non-Necro) ;
menu Combo Create cmbRegs 220 220 120 ;
menu Combo Add cmbRegs Stackables ;
menu Combo Add cmbRegs Non-Stackables ;
menu Combo Select cmbRegs 1 ;
;
menu Check chkPeerlessNonstacks 0 240 180 20 #true Peerless Non-Stackables
menu Combo Create cmbPeerlessNonstacks 220 240 120 ;
menu Combo Add cmbPeerlessNonstacks Stackables ;
menu Combo Add cmbPeerlessNonstacks Non-Stackables ;
menu Combo Select cmbPeerlessNonstacks 2 ;
;
menu Check chkPeerlessStacks 0 260 180 20 #true Peerless Stackables
menu Combo Create cmbPeerlessStacks 220 260 120 ;
menu Combo Add cmbPeerlessStacks Stackables ;
menu Combo Add cmbPeerlessStacks Non-Stackables ;
menu Combo Select cmbPeerlessStacks 1 ;
;
menu Check chkMagePrism 0 280 180 20 #true Prism of Light Items ;
menu Combo Create cmbMagePrism 220 280 120 ;
menu Combo Add cmbMagePrism Stackables ;
menu Combo Add cmbMagePrism Non-Stackables ;
menu Combo Select cmbMagePrism 2 ;
;
menu Check chkMageBlight 0 300 180 20 #true Blighted Grove Items ;
menu Combo Create cmbMageBlight 220 300 120 ;
menu Combo Add cmbMageBlight Stackables ;
menu Combo Add cmbMageBlight Non-Stackables ;
menu Combo Select cmbMageBlight 2 ;
;
menu Check chkMageBedlam 0 320 180 20 #true Bedlam Items ;
menu Combo Create cmbMageBedlam 220 320 120 ;
menu Combo Add cmbMageBedlam Stackables ;
menu Combo Add cmbMageBedlam Non-Stackables ;
menu Combo Select cmbMageBedlam 2 ;
;
menu Check chkMageSanc 0 340 180 20 #true Sanctuary Items ;
menu Combo Create cmbMageSanc 220 340 120 ;
menu Combo Add cmbMageSanc Stackables ;
menu Combo Add cmbMageSanc Non-Stackables ;
menu Combo Select cmbMageSanc 2 ;
;
menu Check chkMageLaby 0 360 180 20 #true Labyrinth Items ;
menu Combo Create cmbMageLaby 220 360 120 ;
menu Combo Add cmbMageLaby Stackables ;
menu Combo Add cmbMageLaby Non-Stackables ;
menu Combo Select cmbMageLaby 2 ;
;
menu Check chkMageParox 0 380 180 20 #true Paroxysmus Items ;
menu Combo Create cmbMageParox 220 380 120 ;
menu Combo Add cmbMageParox Stackables ;
menu Combo Add cmbMageParox Non-Stackables ;
menu Combo Select cmbMageParox 2 ;
menu Check chkSeeds 0 400 180 20 #true Seeds ;
menu Combo Create cmbSeeds 220 400 120 ;
menu Combo Add cmbSeeds Stackables ;
menu Combo Add cmbSeeds Non-Stackables ;
menu Combo Select cmbSeeds 2
menu Check chkArcaneGems 0 420 180 20 #true Arcane Gems ;
menu Combo Create cmbArcaneGems 220 420 120 ;
menu Combo Add cmbArcaneGems Stackables ;
menu Combo Add cmbArcaneGems Non-Stackables ;
menu Combo Select cmbArcaneGems 2 ;
menu Check chkArrows 0 440 180 20 #true Arrows ;
menu Combo Create cmbArrows 220 440 120 ;
menu Combo Add cmbArrows Stackables ;
menu Combo Add cmbArrows Non-Stackables ;
menu Combo Select cmbArrows 1 ;
; ;
;Now, get old settings if they exist ;
gosub SetState chkGold cmbGold *lootingGold ;
gosub SetState chkOints cmbOints *lootingOints ;
gosub SetState chkSkulls cmbSkulls *lootingSkulls ;
gosub SetState chkGargs cmbGargs *lootingGargs ;
gosub SetState chkPeerlessKeys cmbPeerlessKeys *lootingPeerlessKeys ;
gosub SetState chkRecipes cmbRecipes *lootingRecipes ;
gosub SetState chkOres cmbOres *lootingOres ;
gosub SetState chkRunics cmbRunics *lootingRunics ;
gosub SetState chkJewels cmbJewels *lootingJewels ;
gosub SetState chkQuestStacks cmbQuestStacks *lootingQuestStacks ;
gosub SetState chkTransPowderItems cmbTransPowderItems *lootingTransPowderItems
gosub SetState chkRegs cmbRegs *lootingRegs ;
gosub SetState chkPeerlessNonstacks cmbPeerlessNonstacks *lootingPeerlessNonstacks
gosub SetState chkPeerlessStacks cmbPeerlessStacks *lootingPeerlessStacks ;
gosub SetState chkMagePrism cmbMagePrism *lootingMagePrism ;
gosub SetState chkMageBlight cmbMageBlight *lootingMageBlight ;
gosub SetState chkMageBedlam cmbMageBedlam *lootingMageBedlam ;
gosub SetState chkMageSanc cmbMageSanc *lootingMageSanc ;
gosub SetState chkMageLaby cmbMageLaby *lootingMageLaby ;
gosub SetState chkMageParox cmbMageParox *lootingMageParox ;
gosub SetState chkSeeds cmbSeeds *lootingSeeds ;
gosub SetState chkArcaneGems cmbArcaneGems *lootingArcaneGems ;
gosub SetState chkArrows cmbArrows *lootingArrows ;
;
menu Button btnDone 220 460 100 20 Done ;
menu HideEUO ;
menu Show ;
;----------------------------------------------End Window Init---;
set #MENUBUTTON X
repeat
{
sleep 1
}
until #MENUBUTTON <> X
if #MENUBUTTON = Closed
halt
if #MENUBUTTON = btnDone
{
set %lootNormal
set %lootHolding
set %lootJewels
set %lootAll
;Champ Skulls
gosub GetState chkSkulls cmbSkulls %skulls
set *lootingSkulls #result
;Imprisoned Pets
;gosub GetState chkImpPets cmbImpPets %imppets
;set *lootingImpPets #result
;Travesty Non-Stackables
gosub GetState chkPeerlessNonstacks cmbPeerlessNonstacks %peerlessnonstacks
set *lootingPeerlessNonstacks #result
;Travesty Stackables
gosub GetState chkPeerlessStacks cmbPeerlessStacks %peerlessstacks
set *lootingPeerlessStacks #result
;Travesty Keys
gosub GetState chkPeerlessKeys cmbPeerlessKeys %peerlesskeys
set *lootingPeerlessKeys #result
;Garg Items
gosub GetState chkGargs cmbGargs %gargs
set *lootingGargs #result
;Quest Stackables
gosub GetState chkQuestStacks cmbQuestStacks %queststacks
set *lootingQuestStacks #result
;Trans Powder Items
gosub GetState chkTransPowderItems cmbTransPowderItems %transpowderitems
set *lootingTransPowderItems #result
;Oints/Essences
gosub GetState chkOints cmbOints %oints
set *lootingOints #result
;Runic Tools
gosub GetState chkRunics cmbRunics %runictools
set *lootingRunics #result
;Recipes
gosub GetState chkRecipes cmbRecipes %recipes
set *lootingRecipes #result
;Ore
gosub GetState chkOres cmbOres %ores
set *lootingOres #result
;Jewels
gosub GetState chkJewels cmbJewels %jewels
set *lootingJewels #result
;Regs
gosub GetState chkRegs cmbRegs %regs
set *lootingRegs #result
;Gold
gosub GetState chkGold cmbGold %gold
set *lootingGold #result
gosub GetState chkMagePrism cmbMagePrism %mageitemsprism
set *lootingMagePrism #result
gosub GetState chkMageBlight cmbMageBlight %mageitemsblight
set *lootingMageBlight #result
gosub GetState chkMageBedlam cmbMageBedlam %mageitemsbedlam
set *lootingMageBedlam #result
gosub GetState chkMageSanc cmbMageSanc %mageitemssanc
set *lootingMageSanc #result
gosub GetState chkMageLaby cmbMageLaby %mageitemslaby
set *lootingMageLaby #result
gosub GetState chkMageParox cmbMageParox %mageitemsparox
set *lootingMageParox #result
gosub GetState chkSeeds cmbSeeds %seeds
set *lootingSeeds #result
gosub GetState chkArcaneGems cmbArcaneGems %arcanegems
set *lootingArcaneGems #result
gosub GetState chkArrows cmbArrows %arrows
set *lootingArrows #result
set %lootAll %lootNormal , %lootHolding , %lootJewels
set *savedLootNormal %lootNormal
set *savedLootHolding %lootHolding
set *savedLootJewels %lootJewels
set *savedLootAll %lootAll
set *isDoneItems 1
menu Clear
menu Hide
return
}
}
;=============SETSTATE FUNCTION - Checks options
;Checks the options in the item menu and builds lists
sub SetState ;%1 = checkboxname, %2 = comboboxname, %3 = saved state
{
if %3 = 0
{
menu Set %1 0
menu Set %2 1
}
if %3 = 1 || %3 = 2 || %3 = 3
{
menu Set %1 -1
menu Combo Select %2 %3
}
if %3 <> 0 && %3 <> 1 && %3 <> 2 && %3 <> 3
{
menu Set %1 -1
}
return
}
;=============GETSTATE FUNCTION - Checks options
;Checks the options in the item menu and builds lists
sub GetState ;%1 = checkboxname, %2 = comboboxname, %3 = items to add
{
menu Get %1
if #menures <> 0
{
menu Get %2
if #menures = 1
{
set %lootHolding %lootHolding , %3
}
if #menures = 2
{
set %lootNormal %lootNormal , %3
}
if #menures = 3
{
set %lootJewels %lootJewels , %3
}
return #menures
}
else
return 0
}
;=============PAUSELOOP ROUTINE - Pauses the lootz
;Activates Pause mode
sub PauseLoop
{
set %paused #true
set %pauseTimer #SCNT
event SysMessage Looting PAUSED...hit Delete to resume, Insert for menu.
repeat
{
if %pauseTimer < #SCNT - 20
{
set %pauseTimer #SCNT
event SysMessage Looting PAUSED...hit Delete to resume.
}
onhotkey DELETE
set %paused #false
onhotkey INSERT
{
set *isDone 0
gosub SetupBags
gosub SetupItems
display Ok Settings changed successfully.
}
}
until %paused = #false
event SysMessage Looting UNPAUSED...
return
}
;=============MAINLOOP ROUTINE - Runs the looting
;Loots desired items to desired bags.
sub MainLoop
{
if *optionLootCorpses = 0
return
;Check status
gosub GetStatus
if #RESULT = #FALSE
return
;If character has been a ghost, prioritize finding the character corpse first
if %beenGhost = #true
{
finditem YFM G_2
if #FINDKIND = -1 || #FINDDIST > 2
return ;No Corpse Found In Range
;Else, Corpse Found
;Check if corpse is character's
event Property #FINDID
if #CHARNAME notin #PROPERTY
{
;Not the character corpse
ignoreitem #FINDID 2
return
}
;Corpse belongs to character
set %targetType #FINDTYPE
set %targetID #FINDID
;Open corpse
gosub SaveLast
gosub SetTarget
event Macro 17
gosub LoadLast
wait %waitTime
;Restore normal state
set %beenGhost #false
event SysMessage Character corpse found, returning to normal...
ignoreitem reset 2
return
}
retryOpen:
finditem YFM G_2
if #FINDKIND = -1 || #FINDDIST > 2
return ;No corpse found
;Else, corpse found
event ExMsg #FINDID 2 13 Looting...
;Acquire target
set %targetType #FINDTYPE
set %targetID #FINDID
set %targetLocX #FINDX
set %targetLocY #FINDY
;Open Corpse if not already open
gosub OpenTarget
scanJournal 1
;Check if it wasn't opened
if I_can't_reach_that in #journal || too_far_away in #journal
return
;Check if it wasn't yours
if did_not_earn_the_right in #journal
{
ignoreItem %targetID 1
return
}
if #CONTID <> %targetID
return
;Corpse Opened
set %contOpen #true
gosub LootItems
;Close Corpse
if *optionCloseCorpses = 0
set %contOpen #false
;Corpse was closed, may not have been looted fully
if #CONTID <> %targetID
return
if %contOpen = #true && #result = #true
{
;click %closeLocX %closeLocY DMC
set #CONTID %targetID
if #CONTID = %targetID
{
contPos %openLocX %openLocY
click %closeLocX %closeLocY R DMC
set %contOpen #false
}
else
set %contOpen #false
}
;If corpse was not completely looted, don't ignore
if #result = #false then
return
ignoreItem %targetID 1
return
}
;=============CHESTLOOP ROUTINE - Loots locked chests
;Will loot all desired items from locked chests in
;dungeons as MainLoop routine does
sub ChestLoop
{
if *optionLootChests = 0
return
;Check status
gosub GetStatus
if #RESULT = #FALSE
return
;If character has been a ghost, prioritize finding
;the character corpse first
if %beenGhost = #true
return
;Search for treasure box
checkForBox:
nextcpos %boxLocX %boxLocY
if *optionLockpick = -1
findItem %boxTypes G_1
else
findItem %boxTypes G_2
if #FINDKIND = -1 || #FINDDIST > 2
{
;No Box Found In Range
wait %waitTime
return
} ;Else, Box Found
;Acquire Target
set %targetID #FINDID
set %targetLocX #FINDX
set %targetLocY #FINDY
set %targetKind #FINDKIND
set %targetType #FINDTYPE
;Check if it's empty
gosub SaveLast
gosub SetTarget
event Property #LTARGETID
gosub LoadLast
if $0 , #spc , Items in #PROPERTY || Locked , #spc , Down , #spc , & , #spc , Secure in #PROPERTY
{
ignoreItem %targetID 1
wait %waitTime
return
}
event ExMsg #FINDID 2 13 Looting...
;No "Stones" in description, meaning it's locked/trapped
if Stones notin #PROPERTY
{
if *optionLockpick = -1
gosub OpenChestLockpick
else
gosub OpenChestMagic
if #result = #false
return
;if #result = unable
set #LSPELL 14
event Macro 16
target 60
event Macro 22
gosub LoadLast
wait %waitTime
}
gosub OpenTarget
;Too far away
if I_can't_reach_that in #journal || too_far_away in #journal
{
return
}
;Opened chest, begin loot
set %contOpen #TRUE
gosub LootItems
;Close chest gump
if *optionCloseCorpses = 0
set %contOpen #false
;Chest was closed, may not have been completely looted
if #CONTID <> %targetID
return
if %contOpen = #true && #result = #true
{
set #CONTID %targetID
if #CONTID = %targetID
{
contPos %boxLocX %boxLocY
click %closeBoxLocX %closeBoxLocY R DMC
set %contOpen #false
}
else
set %contOpen #false
}
;If chest was not completely looted, do not ignore
if #result = #false then
return
ignoreItem %targetID 1
return
}
;=============CLEANUPINV ROUTINE - Checks Inv for items
;Useful for mining, lumberjacking
sub CleanUpInv
{
if *optionCleanInv = 0
return
;Check status
gosub GetStatus
if #RESULT = #FALSE
return
;Acquire target
set %targetType ZJF
set %targetID #BACKPACKID
set %targetLocX #CHARPOSX
set %targetLocY #CHARPOSY
;if *optionAutoKey = 1
;{
; gosub AutoKeyItems
;}
gosub LootItems
set %tempRes #result
return
}
;=============LOOTITEMS FUNCTION - Grabs stuffz
;Checks for normal, then holding, then jewels.
;
;Also returns a boolean value to indicate whether
;the corpse is fully looted or not, so the script
;won't ignore the corpse.
sub LootItems
{
checkForLoot:
gosub GetStatus
if #RESULT = #FALSE
{
wait %waitTime
return #false ;corpse not looted
}
if %targetType = YFM
{
set *isLooting #true
}
if %targetID = #BACKPACKID
finditem %lootAll C_ , %targetID
else
findItem %lootAll , %boxTypes , %bagTypes C_ , %targetID
if #FINDKIND = -1
{
set *isLooting #false
if %targetID <> #BACKPACKID && *optionCloseCorpses = 0
event ExMsg %targetID 2 12 Done.
return #true ;all items searched, nothing found
}
;loot found
if #FINDTYPE in %boxTypes , %bagTypes
{
;sub-container found, loot it
;Acquire Target
gosub SubBagUp
;Open container if not already open
gosub OpenTarget
scanJournal 1
;Check if it wasn't opened
if I_can't_reach_that in #journal || too_far_away in #journal || #CONTID <> %targetID
{
gosub SubBagDown
goto checkForLoot
}
;Cont Opened
gosub LootItems
if #result = #true
{
ignoreitem %targetID 1
gosub SubBagDown
goto checkForLoot
}
}
;loot is not sub-container
gosub SmartFilter
if #RESULT = 0
{
ignoreitem #FINDID 1
goto checkForLoot
}
set %lootTypeReturn #RESULT
gosub CheckDist 2
if #RESULT = #FALSE
{
event ExMsg %targetID 2 13 Too far...
wait %waitTime
return #false ;corpse not completely looted
}
;Identify Items
event Property #FINDID
str pos #PROPERTY $
set %endPos #STRRES - 1
str left #PROPERTY %endPos
set %foundString #STRRES
event SysMessage %foundString obtained.
;Make sure when it is dragged it is not out of sight
exevent Drag #FINDID #FINDSTACK
;wait %waitTime
if %lootTypeReturn = 1
exevent Dropc %myHoldingBag
if %lootTypeReturn = 2
exevent Dropc %myOtherBag
if %lootTypeReturn = 3
{
if #FINDTYPE in %lootHolding
exevent Dropc %myHoldingBag
if #FINDTYPE in %lootNormal
exevent Dropc %myOtherBag
if #FINDTYPE in %lootJewels
exevent Dropc %myJewelBag
}
wait %waitTime
set %jrnl #jindex
scanjournal %jrnl
if That_is_out_of_sight in #journal
{
ignoreitem %targetID 3
set %tempIgnoreTime #SCNT
set %tempIgnoring #true
event ExMsg %targetID 2 30 (Ten Second Ignore)
return #false ;corpse not completely looted
}
goto checkForLoot
}
;=============CHECKDIST FUNCTION - Checks distance
;Makes sure corpse is in range (for tracking movement)
sub CheckDist ;%1 = distance to check
{
if #CHARPOSX > %targetLocX + %1 || #CHARPOSX < %targetLocX - %1 || #CHARPOSY > %targetLocY + %1 || #CHARPOSY < %targetLocY - %1
return #FALSE ;out of range
else
return #TRUE
}
;=============SAVELAST FUNCTION - Saves last item
;Saves the current Last Object before changing it to
;perform some function in the script, to retrieve
;afterwards with LoadLast
sub SaveLast
{
set %lastObjectID #LOBJECTID
set %lastOjectType #LOBJECTTYPE
set %lastTargetID #LTARGETID
set %lastTargetKind #LTARGETKIND
return
}
;=============LOADLAST FUNCTION - Loads last item
;Restores the Last Object to pre-function state
sub LoadLast
{
set #LOBJECTID %lastObjectID
set #LOBJECTTYPE %lastOjectType
set #LTARGETID %lastTargetID
set #LTARGETKIND %lastTargetKind
return
}
;=============SETTARGET FUNCTION - Set target
;Sets last object values to target values
sub SetTarget
{
set #LOBJECTID %targetID
set #LOBJECTTYPE %targetType
set #LTARGETID %targetID
set #LTARGETKIND %targetKind
return
}
;=============GETSTATUS FUNCTION - Confirms action ready
;Makes sure the character is not lifting something,
;setting a number in a stack, targeting, not logged in,
;a ghost, or hidden.
;If the character dies, the script looks for the corpse,
;but not until the character is alive, of course.
sub GetStatus
{
if %tempIgnoring = #true && #SCNT - %tempIgnoreTime > 10
{
ignoreitem reset 3
set %tempIgnoring #false
event SysMessage Clearing 10 second ignores...
}
onhotkey DELETE CTRL
return #FALSE
IF #LLIFTEDKIND = 1 || #CONTNAME = drag_gump || #CONTNAME = stack_gump || #TARGCURS = 1 || #CLILOGGED = 0 || #CHARGHOST = YES || H IN #CHARSTATUS || #ENEMYID <> N/A
{
if #CHARGHOST = YES && %beenGhost = #false
{
event SysMessage Character death detected, searching for corpse...
set %beenGhost #true
}
;Allow corpse to be looted while hidden
if #CHARGHOST = NO && %beenGhost = #true && H in #CHARSTATUS
return #TRUE
;If battle looting option is on, don't wait
if #ENEMYID <> N/A && *optionBattleLoot = -1
return #TRUE
return #FALSE
}
return #TRUE
}
;=============SMARTFILTER FUNCTION - Filters like items
;Checks to make sure the found item is actually the item we want
;and not just some item with the same itemtype.
;Returns 0 if its just some crap
;Returns 1 if its an item we want in holding bag
;Returns 2 if its an item we want in normal bag
;Returns 3 if its a non-filtered item we want
sub SmartFilter
{
if #FINDTYPE in %filters
{
event Property #FINDID
if #FINDTYPE in POL_ ;Gold/Spanish Doubloon
{
if Spanish , #spc , Doubloon notin #PROPERTY
return *lootingGold
return *lootingMageSanc
}
if #FINDTYPE in WLF_ ;Oints/Essences/Radioactive Material
{
if Ointment notin #PROPERTY && Essence , #spc , Of notin #PROPERTY && Radioactive , #spc , Material notin #PROPERTY
return 0
if Ointment in #PROPERTY || Essence , #spc , Of in #PROPERTY
return *lootingOints
return *lootingMageParox
}
if #FINDTYPE in RZF_ ;Spider's Silk/Lissith's Silk
{
if Lissith notin #PROPERTY
return *lootingRegs
return *lootingKeys
}
if #FINDTYPE in ZRF_GMH_QPF_ ;gargs
{
if Gargoyles notin #PROPERTY && Gargoyle's notin #PROPERTY
return 0
return *lootingGargs
}
if #FINDTYPE in IJG_GMF_ ;trans powder items
{
if Bracelet , #spc , of , #spc , Binding notin #PROPERTY && Crystal , #spc , Ball , #spc , of , #spc , Pet , #spc , Summoning notin #PROPERTY
return 0 ;only a regular crappy ball
if [Linked , #spc , Pet: , #spc , #spc notin #PROPERTY && Crystal , #spc , Ball , #spc , of , #spc , Pet , #spc , Summoning in #PROPERTY
return 0 ;already linked to a pet, don't loot/move
str len #PROPERTY
if #STRRES > 28 && Bracelet , #spc , of , #spc , Binding in #PROPERTY
return 0 ;already linked to a person, don't loot/move
return *lootingTransPowderItems
}
if #FINDTYPE in XMF_ ;elven notes
{
if Elven , #spc , Note notin #PROPERTY
return 0
return *lootingPeerlessStacks
}
if #FINDTYPE in LWL_ ;sabrix's eye
{
if Sabrix notin #PROPERTY
return 0
return *lootingPeerlessKeys
}
if #FINDTYPE in UJG_ ;Crystalline Ring, Ring of Ice
{
if Crystalline , #spc , Ring notin #PROPERTY && Ring , #spc , of , #spc , Ice notin #PROPERTY
return 0
if Crystalline , #spc , Ring in #PROPERTY
return *lootingPeerlessNonstacks
return *lootingMagePrism
}
if #FINDTYPE in RMH_ ;Cyclopian Axe
{
if Cyclopian , #spc , Axe notin #PROPERTY
return 0
return *lootingMageSanc
}
if #FINDTYPE in FSF_ ;Melisande's Corroded Hatchet
{
if Melisande's , #spc , Corroded , #spc , Hatchet notin #PROPERTY
return 0
return *lootingPeerlessNonstacks
}
if #FINDTYPE in EWH_ ;A Deed For A Parrot
{
if A , #spc , Deed , #spc , F , or , #spc , A , #spc , Parrot notin #PROPERTY
return 0
return *lootingPeerlessNonstacks
}
if #FINDTYPE in MPF_ ;Lady Melisande's Spellbook
{
if Lady , #spc , Melisande's , #spc , Spellbook notin #PROPERTY
return 0
return *lootingMageBlight
}
if #FINDTYPE in PZF_ ;A Skorp Stinger
{
if A , #spc , Skorp , #spc , Stinger notin #PROPERTY
return 0
return *lootingMageLaby
}
if #FINDTYPE in XDI_ ;Crimson Cincture
{
if Crimson , #spc , Cincture notin #PROPERTY
return 0
return *lootingPeerlessNonstacks
}
if #FINDTYPE in SEG_REG_CFG_ ;Serpent Fang Key, Dragon Flame Key, Tiger Claw Key, Crypt Key
{
if Serpent , #spc , Fang notin #PROPERTY
+ && Dragon , #spc , Flame notin #PROPERTY
+ && Tiger , #spc , Claw notin #PROPERTY
+ && Door , #spc , & , #spc , Chest notin #PROPERTY
+ && Crypt notin #PROPERTY
return 0
return *lootingPeerlessKeys
}
if #FINDTYPE in DCI_ ;Necromancer's Cloak
{
if Necromancer's , #spc , Cloak notin #PROPERTY
return 0
return *lootingPeerlessNonstacks
}
if #FINDTYPE in YWL_ ;Prism of Light
{
if Prism , #spc , of , #spc , Light notin #PROPERTY
return 0
return *lootingMagePrism
}
if #FINDTYPE in ZWF_ ;Horn of Defeat
{
if Horn , #spc , of , #spc , Defeat notin #PROPERTY
return 0
return *lootingMageLaby
}
}
return 3
}
sub WaitForGump ;%1 = contsize to wait for, %2 = waittime(seconds)
{
set %gumpWaiting #SCNT
repeat
{
sleep 1
}
until #CONTSIZE = %1 || #SCNT - %gumpWaiting > %2
if #CONTSIZE = %1
return #true ;gump has appeared
else
return #false ;hasn't shown up in allotted time
}
sub OpenChestLockpick
{
gosub SaveLast
;get picks
if %picksSet = #false
{
finditem IWH C_ , #BACKPACKID
if #FINDKIND = -1
{
finditem IWH C_ , %myHoldingBag
if #FINDKIND = -1
{
finditem IWH C_ , %myOtherBag
if #FINDKIND = -1
{
event SysMessage No lockpicks found in your main packs. Switching to magic opening mode...
set *optionLockpick #false
return #false
}
}
}
set %currPicksID #FINDID
set %currPicksType #FINDTYPE
event Property #FINDID
str pos #PROPERTY #spc
set %endPos #strres - 1
str left #PROPERTY %endPos
set %picksLeft #strres
set %picksSet #true
}
;picks acquired, use on chest
repeatpick:
set #LOBJECTID %currPicksID
set #LOBJECTTYPE %currPicksType
gosub CheckDist 1
if #result = #false
{
event ExMsg %targetID 2 13 Too far...
return #false
}
event Macro 17
target 60
gosub SetTarget
event Macro 22
set %jrnl #jindex
scanjournal %jrnl
click %clickLocX %clickLocY DMC
repeat
{
if #jindex > %jrnl
{
set %jrnl %jrnl + 1
scanjournal %jrnl
}
else
sleep 1
}
until lock_quickly_yields_to_your_skill in #journal || does_not_appear_to_be_locked in #journal || too_far_away in #journal || see_how_that_lock_can_be_manipulated in #journal || unable_to_pick_the_lock in #journal
if does_not_appear_to_be_locked in #journal
return #true
if too_far_away in #journal
{
event ExMsg %targetID 2 13 Too far...
return #false
}
if lock_quickly_yields_to_your_skill in #journal || unable_to_pick_the_lock in #journal
{
set %picksLeft %picksLeft - 1
if %picksLeft = 0
{
event SysMessage You have depleted your picks.
set %picksSet #false
set %currPicksID X
set %currPicksType X
}
if unable_to_pick_the_lock in #journal
goto repeatpick
return #true
}
if see_how_that_lock_can_be_manipulated in #journal
return unable
}
sub OpenChestMagic
{
;My spell does not seem to have an effect on that lock.
gosub SaveLast
gosub SetTarget
set #LSPELL 23
event Macro 16
target 60
event Macro 22
wait %waitTime
return #true
}
;\/CURRENTLY INCOMPLETE\/
sub AutoKeyItems
{
checkForKeyItems:
gosub GetStatus
if #RESULT = #FALSE
{
wait %waitTime
return #false ;corpse not looted
}
;findItem %lootAll C_ , %targetID
;if #FINDKIND = -1
; return #true ;all items searched, nothing found
;loot found
;gosub SmartFilter
;if #RESULT = 0
;{
; ignoreitem #FINDID 1
; goto checkForLoot
;}
;set %lootTypeReturn #RESULT
;gosub CheckDist 2
;if #RESULT = #FALSE
;{
; event ExMsg %targetID 2 13 Too far...
; wait %waitTime
; return #false ;corpse not completely looted
;}
;Identify Items
;event Property #FINDID
;str pos #PROPERTY $
;set %endPos #STRRES - 1
;str left #PROPERTY %endPos
;set %foundString #STRRES
;event SysMessage %foundString obtained.
;exevent Drag #FINDID #FINDSTACK
;if %lootTypeReturn = 1
; exevent Dropc %myHoldingBag
;if %lootTypeReturn = 2
; exevent Dropc %myOtherBag
;if %lootTypeReturn = 3
;{
; if #FINDTYPE in %lootHolding
; exevent Dropc %myHoldingBag
; if #FINDTYPE in %lootNormal
; exevent Dropc %myOtherBag
; if #FINDTYPE in %lootJewels
; exevent Dropc %myJewelBag
;}
;wait %waitTime
;goto checkForLoot
}
sub OpenTarget
{
if #CONTID <> %targetID
{
gosub SaveLast
gosub SetTarget
set #NEXTCPOSX %openLocX
set #NEXTCPOSY %openLocY
event Macro 17
gosub LoadLast
wait %waitTime
}
return
}
sub SubBagUp
{
set %levelsDeep %levelsDeep + 1
set %mainContID . %levelsDeep %targetID
set %mainContType . %levelsDeep %targetType
set %targetType #FINDTYPE
set %targetID #FINDID
return
}
sub SubBagDown
{
set %targetID %mainContID . %levelsDeep
set %targetType %mainContType . %levelsDeep
set %levelsDeep %levelsDeep - 1
if %levelsDeep = 0
gosub OpenTarget
return
}