ScriptUO
		Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Crisis on July 06, 2017, 03:41:41 PM
		
			
			- 
				I am trying to finish a long past due major inscription script. I adjusted it so that it totals the crafted items instead of the attempts but I have run into a snag. When crafting a large number of scrolls, it moves a number of scrolls out of the backpack due to weight. The problem arises that it does not keep the count, but it starts over. Here is the code:
Sub AddCraftedItems
   finditem %Mage_Scrolls C_ , #backpackid
   set %crafted ( #findstack + %stackmoved )
   Menu Font Size 10
   Menu Font Color Black
   menu set Crafted %crafted
Return
It is not continuing to count the scrolls moved. So when I set it up to make 200 recalls, I had over 400 when I tabbed back to the screen and it was still crafting away.
			 
			
			- 
				If you need some inspiration you can always look at  TG Crafting Factory. 
http://www.scriptuo.com/index.php?topic=13169.0
Here the 2 main sub that kept my count.  
;;======================= TG_Clear Field =============================
 ; gosub TG_ClearPack (Item) (Container)
sub TG_ClearField
; %1 Item to move
; %2 Container to move too
Namespace Push
   Namespace Local TGCF
  finditem %1 G_2
  if #findcnt < 1 2
    NameSpace Pop
    return
  for #findindex 1 #findcnt
  {
    set %count %count + #findstack
 	  gosub DisplayCount
    exevent drag #findid #findstack
    exevent dropc %2
    wait 20
  }
  Namespace Pop
return
 ;=========================================================
; =================  Display Counter =============================
sub DisplayCount
  menu Font Name MS Sans Serif
  menu Font Size 8
  menu Font Style
  set %text %count , #SPC , %made
  menu delete EUOLabel4
  menu Text EUOLabel4 168 128 %text
return
; ---------------------------------------------------