ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Tana on April 01, 2016, 11:18:31 PM

Title: check to see if container is open if not go to open it
Post by: Tana on April 01, 2016, 11:18:31 PM
im trying to figure out how to make sure a bag gump is open. the way im checking for weight is item count in a bad and it only works if the bag is open so i want it to check to amke sure the bad is open every time
id imagine id look a little something like this


Code: [Select]
FINDITEM %containerid
 if FINDKIND <> -1
{
gosub opencontainer
}

return
 
Title: Re: check to see if container is open if not go to open it
Post by: The Ghost on April 02, 2016, 05:21:04 AM
This should be working

This will open your bag and count
Code: [Select]
sub openlootbag
finditem %lootbag in C_ , #BackpackID
set #LOBJECTID #FINDID
wait 10
event Macro 17 0
finditem %Map in C_ , %lootbag
wait 1s
if #findCnt < 100
{
return
}
else
{
  gosub home
}
return
Title: Re: check to see if container is open if not go to open it
Post by: Tana on April 03, 2016, 11:45:38 AM
hey ghost since youve been so helpful i have another question.. how do you make sure a BOS has charges? i know it has something to do with #property but you know im a noob and cant figure *bleep* out lol
Title: Re: check to see if container is open if not go to open it
Post by: The Ghost on April 03, 2016, 12:09:26 PM
top on head not sure,   look around using the search button and you might find a looting script with BOS option.    I  only scan for bag itself, not the charge.
Title: Re: check to see if container is open if not go to open it
Post by: The Ghost on April 03, 2016, 12:15:00 PM
Look here http://www.scriptuo.com/index.php?topic=7270.0;highlight=bos   Crome did the leg work for you.
Title: Re: check to see if container is open if not go to open it
Post by: Tana on April 03, 2016, 12:29:58 PM
thanks ghost. also the sub you wrote broke my looting script not sure why. lol ill post it here

Code: [Select]
sub loot
FINDITEM %CORPSE G_3
if ( #FINDKIND > -1 ) && ( %attacking = #false ) && ( %looting = #false )
   {
   set %noloot #false
   goto lootloop
   }
if #findkind = -1
   {
   set %noloot #true
   }

lootloop:
set %newcorpse #findID
set #LOBJECTID %newcorpse
if #CONTTYPE = %CORPSE
{
  set %opencorpse #CONTID
}
nextCPos 25 450
wait 20
EVENT MACRO 17
wait 20
FINDITEM %loot C_ , %opencorpse
if #findcnt > 0
 {
  set %looting #true
   exevent drag #findID
   wait 10
   EXEVENT DROPC %mapbag
   wait 10
 }
if #findcnt < 1
 {
 set %looting #false
 }
;FINDITEM POF C_ , %opencorpse
;if ( #findcnt > 0 ) && ( %USEBOS = #true )
; {
;   exevent drag #findID #findstack
;   wait 10
;   EXEVENT DROPC #BACKPACKID
;   wait 10
; }
ignoreitem %newcorpse 1
return
Title: Re: check to see if container is open if not go to open it
Post by: Tana on April 03, 2016, 12:36:46 PM
yeah i found how to do it i guess i just didn search enough
Title: Re: check to see if container is open if not go to open it
Post by: The Ghost on April 03, 2016, 05:25:28 PM
Trying to follow to logic, but not sure I'm on the same road as you :)   This is the logic I have in mind.  Hope that work.

Code: [Select]
sub loot
FINDITEM %CORPSE G_2   ;  Should be 2 title
if ( #FINDKIND = 1 ) && ( %attacking = #false ) && ( %looting = #false )   
   set %noloot #true   <  not sure
else
 return

set #lobjectid #findid
event macro 17 0
ignoreitem #findid
nextCPos 25 450
wait 20
if #CONTTYPE = YFM
    set %corpse #contid
FINDITEM %loot C_ , %corpse
If #findkind = -1
 {
 set %looting #false
  return
}
if #findcnt > 0
 {
  set %looting #true
   exevent drag #findid #findstack
   exevent dropc %mapbag
   wait 20
 }
return