Skip to content
Outlands Hub

Razor script

Pick and loot treasure chest

by t.lore · 112 lines
Download

Compatibility unverified

This community Razor script has not been tested in game by the Hub. Read its setup and client requirements before use.

This script unlocks and completely loots a treasure chest. How it works: The script first asks you to set a specific loot bag. The script then searches the ground for a metal or wooden chest. Once found, it initiates lockpicking and waits…

CombatThievingOrganizingLockpicking
Pick and loot treasure chest.razor
1# This is an automated backup - check out https://outlands.uorazorscripts.com/script/0ec12cb0-9f95-4d22-8523-cd31493fe954 for latest2# Automation by Jaseowns3## Script: Pick and loot treasure chest4## Created by: t.lore#05#############################################6 7# This script unlocks and completely loots a treasure chest.8# =============9# Author: Khas10# =============11# How it works: 12# The script first asks you to set a specific loot bag.13# The script then searches the ground for a metal or wooden chest.14# Once found, it initiates lockpicking and waits for it to complete.15# Once complete, it immediately loots all items, prioritizing 16#   rare and special loot first down to magic items last.17 18# Constants19@setvar! lootDelayMs 20020 21# Set loot bag22if varexist lootBag and find lootBag backpack23    overhead 'Loot bag set'24else25    @setvar! lootBag26    replay27endif28 29 30# Find chest31if findtype 'wooden chest' ground -1 -1 2 as chest32    overhead 'Found'33    setvar treasureChest chest34elseif findtype 'metal chest' ground -1 -1 2 as chest35    overhead 'Found'36    setvar treasureChest chest37else38    overhead 'Chest not found!' 3539    overhead 'Move closer!' 3540    stop41endif42 43# Pick chest44getlabel treasureChest chestLabel45if 'stones' in chestLabel46else47    if counttype 'lockpicks' backpack = 048        overhead 'No lockpicks!' 3549        stop50    endif51    dclick treasureChest52    pause 50053    gumpresponse 454    while counttype 'lockpicks' backpack > 055        if insysmsg 'You successfully pick the lock.'56            break57        endif58        overhead 'Picking lock...' 2059        @clearsysmsg60        wait 50061    endwhile62    overhead 'Picking done' 6363endif64getlabel treasureChest chestLabel65if 'stones' in chestLabel66else67    overhead 'Picking failed!' 3568    # If you get this message, you probably ran out of picks part way through.69    # Alternatively, there could be something else wrong with the loop waiting for picking to finish.70endif71 72# Loot73# Rares, specials74while findtype 43206|3985|17686|576|8826|5356|29030|17087|22336|39898|23997|23996|24434|4026|22326 treasureChest as item75    lift item 1000076    drop lootBag77    wait lootDelayMs78endwhile79# Dyes, runes80while findtype 'bottle|rune' treasureChest as item81    lift item 1000082    drop lootBag83    wait lootDelayMs84endwhile85# Gold86while findtype 'gold coin' treasureChest as item87    lift item 1000088    drop backpack89    wait lootDelayMs90endwhile91# Scrolls, regs, consumes, gems92while findtype 3827|3981|3976|3963|3974|3972|3973|3980|3962|3617|3903|7163|8022|8022|8023|8024|3856|3861|3873|3862|3877|3865|3859|3878|3885 treasureChest as item93    lift item 1000094    drop lootBag95    wait lootDelayMs96endwhile97# Armor, weapons98while findtype 5056|5059|5060|5061|5063|5070|5074|5075|5076|5078|5085|5089|5090|5101|5103|5105|5106|5129|5131|5132|5135|5138|5139|5142|5143|5144|5146|5201|5203|5204|5205|5207|7169|7170|7173|7175|7177|7179|7181|7610|7947|31003|31004|31005|31006|31007|31008|31009|31010|31011|31012|31015|31191|31017|31019|31021|31023|31025|31027|31029|31031|31033|31035|31037|31038|31041|31043|31045|31047|31049|31051|31053|31055|3834|3740|3742|3762|3763|10245|20006|20008|20010|20012|20014|20016|7026|7027|7029|7031|7033|7034|7035|7107|7109|31002|31130|3920|5042|5117|30990|30993|30994|30995|31184|31186|3719|3922|3938|5121|5123|5125|30989|30992|30996|30997|30998|31176|31188|3568|3713|3721|3932|5040|5044|5112|5127|5177|5179|5181|30991|30999|31000|31001|31014|31178|31180|31182|3909|3911|3913|3915|3917|3934|3937|5046|5049|5115|5119|5182|5185|5187|30988|31128|31190|22187|31141|31142|31169|31172 treasureChest as item99    lift item 10000100    drop lootBag101    wait lootDelayMs102endwhile103 104# Final check105getlabel treasureChest chestLabel106if "0 items" in chestLabel107    overhead 'Looted!' 70108else109    overhead 'Chest not empty!' 35110    # If you get this message, there is an item not accounted for.111    # Send the Id to Khas if you would be so kind.112endif