ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Dan123The123Man on February 29, 2020, 06:07:51 AM

Title: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: Dan123The123Man on February 29, 2020, 06:07:51 AM
Can anyone help me figure out why this sub is not dropping all the boots/sandals that are in the backpack to the ground, instead it just drops one to the ground then it returns to the next gosub which is recalling out? Id like for it to drop all of them if #findkind = 1 keep dropping them until #findkind = 0 or -1

Code: [Select]
set %shoes QVI_PVI_CYI_CWI_NVI_TVI_ZVI_AWI_OVI_XVH

 sub dropboots
set %looper10 0
sandals:
finditem %shoes C , #backpackid
if #findkind = -1
      {
      return
      }
if %looper10 > 9
      {
      return
      }
set %item2 #findid
namespace push
  namespace local RT
  set !radius 2
  set !randx #RANDOM % !radius + 1
  set !randy #RANDOM % !radius + 1
  if #RANDOM > 500
    set !randx !randx * -1
  if #RANDOM > 500
    set !randy !randy * -1
  set !randx !randx + #CHARPOSX
  set !randy !randy + #CHARPOSY
  set #LTARGETX !randx
  set #LTARGETY !randy
  set #LTARGETZ #CHARPOSZ
  ;set #LTARGETKIND 2
  ;event pathfind !randx !randy
  wait 30
     ;set #lobjectid %bag
     exevent drag %item2
     wait 20
     exevent dropg !randx !randy #charposz
   namespace pop
;exevent drag %item2 #findstack
;wait 20
;exevent dropc %trassh
;wait 15
set %looper10 %looper10 + 1
goto sandals:
 until #findkind = -1 || ( #scnt > %safety_timer )
  set %overweight #FALSE
return
Title: Re: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: Crisis on February 29, 2020, 07:51:31 AM
The ground tile is most likely blocked after the first pair. Maybe try set it to drop them in a corpse or trash can?
Title: Re: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: The Ghost on February 29, 2020, 08:06:39 AM
Go get a goat,   feed him the shoe, this way you have no mess around you.   

And if you required to drop more them one items,  you need to loop.   

Those little syntax are usu full sometime
Quote

finditem xxxxx C_ , #backpackid
 for #findindex 1 #findcnt
        {
       do something
      }
Title: Re: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: Endless Night on March 01, 2020, 07:35:52 AM
Go get a goat,   feed him the shoe, this way you have no mess around you.   

And if you required to drop more them one items,  you need to loop.   

Those little syntax are usu full sometime
Quote

finditem xxxxx C_ , #backpackid
 for #findindex 1 #findcnt
        {
       do something
      }

That is some excellent advice right thier.
Title: Re: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: Endless Night on March 01, 2020, 07:41:51 AM
You could also try my old drag drop to ground sub It tries every spot around you.

http://www.scriptuo.com/index.php?topic=2454.msg33436#msg33436
Title: Re: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: Dan123The123Man on March 02, 2020, 06:05:46 AM
got it fixed ty
Title: Re: Drop Shoes Sub cannot get to drop ALL Shoes.
Post by: Endless Night on March 02, 2020, 06:43:28 AM
got it fixed ty
show us the end result so others can learn from it.