gosub TM_CheckBackpack 200 200
gosub TM_CheckPaperdoll 200 200
stop
sub TM_CheckBackpack
namespace push
namespace local CP
set !cnt %0
set !x %1
set !y %2
finditem * C_ , #BACKPACKID
if #FINDKIND = -1
{
event macro 8 7 ; open backpackid
gosub GumpAndSizeWait container_gump 230_204
if !cnt > 0
{
contpos !x !y
wait 10
}
}
namespace pop
return
;-----------------------------------------------------------------------
; gosub TM_CheckPaperdoll 200 200
; %1 = optional x coord
; %2 = optional x coord
sub TM_CheckPaperdoll
namespace push
namespace local CP
set !cnt %0
set !x %1
set !y %2
finditem ZJF C_ , #CHARID
if #FINDKIND = -1
{
event macro 8 1 ; open paperdoll
gosub GumpAndSizeWait paperdoll_gump 262_324
if !cnt > 0
{
contpos !x !y
wait 10
}
}
namespace pop
return
;-----------------------------------------------------------------------
; gosub GumpAndSizeWait generic_menu 200_200 20
; %1 = contname
; %2 = contsize
; %3 = timeout (defaults to 5 seconds if left blank.)
sub GumpAndSizeWait
namespace push
namespace local GASW
set #RESULT #FALSE
if %3 > 0 && %0 > 2
set !delay #SCNT + %3
else
set !delay #SCNT + 5 ; 5 seconds default
wait 5
repeat
until ( #CONTNAME = %1 && #CONTSIZE = %2 ) || #SCNT > !delay
if #SCNT > !delay
set #RESULT #TRUE ; error
namespace pop
return #RESULT