[EasyUO] Cleaning Treasure Chest~

If you make a Client-side script you can publish it here for other players to use
jackpod
Expert Scribe
Posts: 37
Joined: Mon Dec 22, 2014 10:41 pm

[EasyUO] Cleaning Treasure Chest~

Post by jackpod »

hi guys~

I tried to find a simple script to clean the treasure chests, but couldn't find one from easyuo site or our forum so i just wrote one for myself. Made a few adjustments for others to use the script, hope someone will find this useful~!!

The script will move magery scrolls, gems, and magery/necro reagents out of box.


p.s. I only tested this 3 times, cannot guarantee it will work. please comment or pm "jack skellington" for inquiry~

1/10/2015
the script will pause if it finds enemy after each dump from the chest.

Code: Select all

;Excelsior Shard, http://uoex.net/
;http://www.uoex.net/forum/viewtopic.php?f=39&t=8977
;by Jack Skellington 12/29/2014
;added spawn check (sub FindEnemy) before each drag and drop 1/10/2015

;this is vocational script, no updates will be guaranteed.
;this will clean both Regs and Scrolls
;To Change Hotkey, go to "HOTKEY" section below.
;send pm to Jack Skellington in game if you have any question~


set #LPC 100
set %GarbageReg DUF_SZF_JZF_RZF_WZF_MZF_IUF_TZF_UZF_KZF_JUF_KUF_YZF_
set %GarbageScroll NXL_QXL_PXL_AYL_ZXL_CYL_BYL_WXL_VXL_YXL_XXL_IYL_HYL_KYL_JYL_EYL_DYL_GYL_FYL_STL_RTL_UTL_TTL_OTL_NTL_QTL_PTL_AUL_ZTL_CUL_BUL_WTL_VTL_YTL_XTL_IUL_HUL_KUL_JUL_EUL_DUL_GUL_FUL_QUL_PUL_SUL_RUL_MUL_LUL_OUL_NUL_YUL_XUL_AVL_ZUL_UUL_TUL_WUL_VUL_GVL_FVL_IVL_HVL_CVL_
set %Gem UVF_NVF_HVF_VVF_GVF_BVF_EVF_ZVF_RVF_GXS_FXS_AXS_TWS_VWS_UWS_ZWS_WWS_
set %EnemyType DD_WD_PD_HD_XC_R_EB_EJ_RI_OD_BD_FD_MD_KE_ME_DBB_Q_DF_CD_YE_XE_

;Lvl6 Enemy: _KE_ME_DBB_Q_DF_CD_YE_XE_  ;OD from lvl5
;Lvl5 Enemy: _R_EB_EJ_RI_OD_BD_FD_MD_
;Lvl4 Enemy: _PD_HD_XC_ ;lich lord, gazer, deamon in lvl5
;Lvl3 Enemy: _DD_WD_ ;air eli, dread, ogreL from lvl4


;check if backpack has enough room, normal max @ 125
;possible max # of dump items to "40", so limit max# of item < 125-40 = 85
event property #BackPackID
str pos #property items
set %itemDel_1 #Strres
set %itemDel_2 #Strres + 20
str del #property %itemdel_1 %itemdel_2
set %itemdel_3 #StrRes
str del %itemdel_3 1 9
set %itemdel_final #StrRes
if %itemdel_final <= 124
{
event ExMsg #CharID 3 50 There are %itemdel_final items, #weight / #maxweight stones in your backpack!
}
if %itemdel_final > 124 || #weight > #MaxWeight - 50 || #weight > 300
{
display ok You are holding too much. $Please note that $1. Total # of items in backpack needs to be "LESS than 85" $2. Current Weight is BELOW "300" AND "Maxweight - 50" $Go unload some stuff and restart.
halt
}

display ok Please target your trash bag
set #targcurs 1
waitforclick:
if #targcurs = 1
  goto waitforclick
set %TrashBag #LTargetID

display ok Please target your REAGENTS bag $(If you don't want to keep Reagents, target Trash bag again)
set #targcurs 1
waitforclick:
if #targcurs = 1
  goto waitforclick
set %RegBag #LTargetID

display ok Please target your GEM pouch $(If you don't want to keep gems, target Trash bag again)
set #targcurs 1
waitforclick:
if #targcurs = 1
  goto waitforclick
set %GemBag #LTargetID

;HOTKEY
hotkey:
event ExMsg #CharID 3 50 Press -F4- to start
repeat
onhotkey f4
    goto Start
until #false


Start:
gosub FindChest
gosub Dump
set %ContOpenTimer #null
event ExMsg #CharID 3 50 Finished Cleaning
goto hotkey


;1.
;find chest within 5 tiles and move to it
Sub FindChest
FindItem IIF_IKF G_ , 5
set %ChestID #FindID
set #LObjectID #FindID
set %ChestX #FindX
set %ChestY #FindY
    if #FindKind <> 1
    {
    event ExMsg #CharID 3 50 cannot find treasure chest nearby. Stopping!
    halt
    }
    if %ContOpenTimer > 2
    {
    event ExMsg #CharID 3 50 cannot open chest. Please make sure it's not locked. Going back...
    set %ContOpenTimer #null
    goto hotkey
    }
    if #FindKind = 1 && #FindDist > 1
    {
    event ExMsg #CharID 3 50 moving to chest~
    move %ChestX %ChestY 1 2s
    gosub FindChest
    }
event macro 17 0
wait 10
    if #FindKind = 1 && #ContSize <> 180_240
    {
    event ExMsg #CharID 3 50 trying to open the chest
    event macro 17 0
    wait 20
    set %ContOpenTimer %ContOpenTimer + 1
    gosub FindChest
    }
return
;2.
;chest garbage dump
sub Dump
gosub FindEnemy
FindItem %GarbageScroll C_ , %ChestID
    if #Findkind = 0
    {
    ExEvent Drag #findID #findstack
    event ExMsg #CharID 3 50 cleaning scrolls
    wait 10
    ExEvent Dropc %TrashBag
    wait 10
    gosub dump
    }
FindItem %GarbageReg C_ , %ChestID
    if #Findkind = 0
    {
    ExEvent Drag #findID #findstack
    event ExMsg #CharID 3 50 cleaning reagents
    wait 10
    ExEvent Dropc %RegBag
    wait 10
    gosub dump
    }
FindItem %Gem C_ , %ChestID
    if #Findkind = 0
    {
    ExEvent Drag #findID #findstack
    event ExMsg #CharID 3 50 moving gems
    wait 10
    ExEvent Dropc %GemBag
    wait 10
    gosub dump
    }

return

sub FindEnemy
ignoreitem #CharID
if #Hits < #MaxHits * 8 / 10
{
msg $
msg [bandself$
}
FindItem %EnemyType G_ , 6
if #FindCnt > 0
{
      if #stamina < #maxstam * 2 / 3
      {
      event macro 15 205
      }
event ExMsg #CharID 3 50 Enemy Found!! -F4- to continue
repeat
onhotkey f4
    return
until #false
}
return
Last edited by jackpod on Sat Jan 10, 2015 10:26 pm, edited 3 times in total.
aaron
Grandmaster Scribe
Posts: 79
Joined: Wed Jul 18, 2012 2:28 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by aaron »

Hey I just tried it and the script seems to work very well. Thanks for submitting it! Would you be able to add support for gems too? If you could add the ability to drag the gems to a gem pouch that would be awesome. Thanks again!
jackpod
Expert Scribe
Posts: 37
Joined: Mon Dec 22, 2014 10:41 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by jackpod »

good idea. just edited the script, added gem sorting; but only tested twice, let me know if it doesn't work!
aaron
Grandmaster Scribe
Posts: 79
Joined: Wed Jul 18, 2012 2:28 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by aaron »

This has been working great for me so far. Just a warning for the higher maps, it can make the monsters spawn quite quickly so be careful if you cannot take on too many at once. I did a level 6 and had 3 balrons, an ancient wyrm and a titan all whacking me because the script basically pulls an item per second from the chest.
korndogg
Grandmaster Scribe
Posts: 96
Joined: Fri Aug 09, 2013 6:19 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by korndogg »

I have F4 assigned to curse weapon. When I pressed it to activate the scripts, my first thought was thank you to the writer because that makes sense. Then I realized it wasn't part of the script but simply because that's what I have assigned to. It may help you in tough situations. Just a thought. GL. I actually was on a tiny island and the same thing happened to me. I put a screenshot of it just yesterday
Randy Marsh
jackpod
Expert Scribe
Posts: 37
Joined: Mon Dec 22, 2014 10:41 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by jackpod »

I have added pause upon "finding an enemy" after each instance of moving items away from the TChest.

Enemies/mobs between level 3-6 were tested and added~~ (haven't added monsters from level 1&2 because i don't have tmaps.) If the script does not recognize an enemy as it is supposed to, please post the error here and i'll look at it to fix it!!!
User avatar
apocalypse
Elder Scribe
Posts: 127
Joined: Sat Feb 22, 2014 4:12 am
Location: Alberta, Canada

Re: [EasyUO] Cleaning Treasure Chest~

Post by apocalypse »

Thank you, Thank you, Thank you.
Works great, and is saving me a ton of time!
Jean Luc Picard in game
jackpod
Expert Scribe
Posts: 37
Joined: Mon Dec 22, 2014 10:41 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by jackpod »

that's good to hear =) thank you for using this script~!!
User avatar
Mystery Man
Elder Scribe
Posts: 156
Joined: Thu Nov 04, 2010 2:13 pm
Location: Connecticut

Re: [EasyUO] Cleaning Treasure Chest~

Post by Mystery Man »

Script works awesome...Thanks Jack for creating it.
After everything i've been threw, i'm still smiling...Not because i'm strong...But because i'm crazy!
Now that should scare you.....
User avatar
Joker0003
Novice Scribe
Posts: 6
Joined: Fri Jan 09, 2015 2:13 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by Joker0003 »

Thats awesome, thank you. i changed myself healing in the findenemy-sub. i use" event macro 1 0 [bandself " , so i haven´t to clear the queue and it wasn´t wrote to it.
IG: Maurice-Delan
User avatar
Aster
Grandmaster Scribe
Posts: 81
Joined: Thu Feb 21, 2013 6:23 pm
Location: Italy

Re: [EasyUO] Cleaning Treasure Chest~

Post by Aster »

Nice script :)
This is your life and it's ending one minute at a time.
heyyo
Legendary Scribe
Posts: 210
Joined: Mon Jul 11, 2011 4:11 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by heyyo »

Works great! Thanks for the script.
wspawn
Journeyman Scribe
Posts: 24
Joined: Wed Jan 14, 2015 9:21 am

Re: [EasyUO] Cleaning Treasure Chest~

Post by wspawn »

fine usueful script but a small problem , that the script try move scroll but the chest don't allowe to take item and place it other way in treasure chest . any idee how fixe that ?
jackpod
Expert Scribe
Posts: 37
Joined: Mon Dec 22, 2014 10:41 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by jackpod »

wspawn wrote:fine usueful script but a small problem , that the script try move scroll but the chest don't allowe to take item and place it other way in treasure chest . any idee how fixe that ?
can you explain me with more details? i'll try to fix it for you.
User avatar
Old Fart
Novice Scribe
Posts: 8
Joined: Fri Aug 31, 2012 7:59 pm

Re: [EasyUO] Cleaning Treasure Chest~

Post by Old Fart »

This looks like an awesome script. Have not tried it yet but will do for sure. I wanted to ask if there is a script for unloading/clearing treasure chests that are spawned in say for example town banks and prison camps or dungeon spawns ? my right finger and I thank you...
The sum of the whole is equal to the sum of it's parts ! However, if there are any parts left over after completing the whole then just through them away then shhhh... *(whisper) don't tell anybody....
Locked