;Jebbits House Organizer
;9/25/04
;ver 1.2
set %mover 3
set %colorchoice #true
ignoreitem #backpackid 1

gosub display
set %o 0
SET %COUNT 0
set %set 0
set %sett -80
set %set1
set %bagrelease 0
set %loot 0
set %lootids 0

loop:
finditem %conttype g_4
SET %COUNT %COUNT + 1
IF %COUNT = 6
{
SET %SET 0
SET %SETT %SETT + 150
set %count 1
}
if #findid = x
{
set %set 0
SET %SETT 275
SET %COUNT 1
goto loopp
}
if #findid <> x
set #lobjectid #findid
event macro 17 0
wait 20
contpos %set %sett
set %set %set + 150
ignoreitem #findid
goto loop

loopp:
if %done = 1
goto finish
if %no <> no
{
set %done 1
set %second 1
gosub display
}
finish:
finditem %conttype c_
set %count %count + 1
if %count = 9
{
set %count 0
set %set 0
set %sett %sett + 70
}
if #findid = x
{
set %last %o
set %o 0
ignoreitem reset %bagrelease
goto main
}
set %o %o + 1
set %item . %o #findid
set #lobjectid #findid
event macro 17 0
wait 10
contpos %set %sett
set %set %set + 70
ignoreitem #findid
goto loopp

main:
gosub idd
pause

sub containers
set %contType %contType , _KKF_ZTD_cud_hkf ; small crate
set %contType %contType , _VMF_WMF ; medium crate
set %contType %contType , _UMF ; large crate
set %contType %contType , _JIF_KIF ; large chest
set %contType %contType , _BDE_EDE ; wooden shelf
set %contType %contType , _BVD_NVD ; armoire (red)
set %contType %contType , _DVD_EVD_QVD_PVD ; armoire
set %contType %contType , _JKF ; keg
set %contType %contType , _ZJF_kud ; backpack
set %contType %contType , _CKF ; a bag
set %contType %contType , _LKF ; a pouch
set %contType %contType , _OKF ; picnic basket
set %contType %contType , _HIF_IIF ; metal chest
set %contType %contType , _BKF ; large barrel
return


sub display
if %no = no
goto bottom
if %second = 1
display yesno Do you wish to open a specific type of container within the secure. Slect yes to choose what type. no for all containers inside the boxes.
else
display yesno Do you wish to open a particular type of container. Yes for specific No for all.
if #DISPRES = no
{
set %no no
gosub containers
}
if #DISPRES = yes
{
set #targcurs 1
wait 20
target:
if #targcurs = 1
goto target
wait 20
finditem #ltargetid
wait 20
set %contType #findtype
}
bottom:
return

SUB IDD
again:
ignoreitem reset 1
menu hide
if %once <> 1
display msg Click ok and target the item you want to transfer. This message will only appear once. After the first item is moved it will give you a target to continue moving the next item.
set %once 1
set #targcurs 1
set #ltargetid NULL
bagloop:
if #ltargetid = NULL
goto bagloop
WAIT 5
FINDITEM #LTARGETID
set #lobjectid #ltargetid
set %color #findcol
WAIT 10
set %item #findtype
event drag #lobjectid
if #findstack > 0
{
wait 5
msg $
wait 5
}
ignoreitem #lobjectid 1
if %once2 <> 1
display msg Click ok and drop the item you wish to transfer into the bag or spot. make sure to put the item close to the left of a pack if you have a lot. This script will slightly off stack items for viewing. This screen will not be see again.
set %once2 1
bagloopP:
if #lliftedkind = 1
goto bagloopP
set %click1 #cursorx
set %click2 #cursory
loopit:
finditem %item c_
ignoreitem #findid 1
IF #FINDID = X
goto again
if %color <> #findcol && %colorchoice = #true
goto loopit
if #findKind = 0
{
event drag #findid
if #findstack > 0
{
wait 5
msg $
wait 5
}
wait 10
if #findstack < 2
set %click1 %click1 + %mover
tryagain:
click %click1 %click2 p
WAIT 10
scanjournal
if #targcurs <> 0 && can_not_pick notin #journal 2
set %click1 %click1 + 10
goto tryagain
goto loopit
return