Page 1 of 2

[EasyUO] Cleaning Treasure Chest~

Posted: Mon Dec 29, 2014 10:22 pm
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

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Tue Dec 30, 2014 3:06 pm
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!

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Tue Dec 30, 2014 3:53 pm
by jackpod
good idea. just edited the script, added gem sorting; but only tested twice, let me know if it doesn't work!

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Mon Jan 05, 2015 2:21 pm
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.

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Fri Jan 09, 2015 2:16 am
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

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Sat Jan 10, 2015 10:31 pm
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!!!

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Sun Jan 11, 2015 12:19 am
by apocalypse
Thank you, Thank you, Thank you.
Works great, and is saving me a ton of time!

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Mon Jan 12, 2015 12:30 am
by jackpod
that's good to hear =) thank you for using this script~!!

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Mon Jan 12, 2015 8:21 am
by Mystery Man
Script works awesome...Thanks Jack for creating it.

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Tue Jan 13, 2015 3:25 am
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.

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Tue Jan 20, 2015 9:16 am
by Aster
Nice script :)

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Sun Feb 01, 2015 5:08 pm
by heyyo
Works great! Thanks for the script.

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Thu Feb 12, 2015 11:55 am
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 ?

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Thu Feb 12, 2015 6:51 pm
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.

Re: [EasyUO] Cleaning Treasure Chest~

Posted: Wed Sep 23, 2015 6:32 pm
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...