Official ScriptUO EasyUO Scripts > Script Debug

Trick or treat starter

<< < (9/9)

Gaderian:
you may need to specifically 'white list' the scriptuo executable.

baldielocks:
How do I break out of the  "for" loop? I want to throw in a journal scan for full back pack. I tried a few times, and couldn't come up with a clean way to do it.

--- Code: ---sub specials
 finditem %specialsonly c_ , #backpackid
 if #findcnt > 0
  {
  for #findindex 1 #findcnt
   {
   exevent drag #findid #findstack
   wait 10
   exevent dropc %Specialstash
   wait 20
   }
  }
return
--- End code ---


--- Code: ---sub specials
 finditem %specialsonly c_ , #backpackid
 if #findcnt > 0
  {
  for #findindex 1 #findcnt
   {
gosub Journalscan NAME ; as a place holder   
exevent drag #findid #findstack
   wait 10
   exevent dropc %Specialstash
gosub Journal sync name valid container_full
if full
{
do something
}
   wait 20
   }
  }
return
--- End code ---

The Ghost:

If you look , most of the sub are geniric, so we can use it  in multiple situation.

This is what I use in my Crafting Factory build

This can look like this for you
gosub TG_ClearPack %loot %hardcode_dump_candy_bag


--- Code: ---;======================= TG_ClearPack =============================

; gosub TG_ClearPack (Item) (Container)
sub TG_ClearPack
; %1 Item to move
; %2 Container to move too
Namespace Push
   Namespace Local TGCP
  finditem %1 C_ , #backpackid
  if #findcnt < 1 2
    NameSpace Pop
    return
  for #findindex 1 #findcnt
  {
      exevent drag #findid #findstack
    exevent dropc %2
    wait 20
  }
  Namespace Pop
return
; ---------------------------------------------------------------------

--- End code ---

 Most of Lumber/mining script have this kind of build.   TM/ C2/ MWnic   just to name a few have those basic sub. 





Gaderian:
The 2 keywords that help you control loops are break and continue.

Continue = skip processing left in the loop and advance to the next iteration of the loop
break = end the current loop immediately


Gaderian

baldielocks:
Thanks Gaderian!!! I'll work on that.

You mentioned "setting a flag" for advancing the rune if there is a block. I am struggling to comprehend that. I THINK you mean like you showed me with the find sub, but put it down in the TM travel sub..  Since there is already a flag there in the find loop, how do I differentiate?

Navigation

[0] Message Index

[*] Previous page

Go to full version