Page 1 of 1

Array of items ..

Posted: 2005-02-10 01:15:30
by pim
Hey YOKO or someone, I wish to make an array of items on my backpack.. is there any automatic function that outputs an array or i could do something such as:

For i=0 to Totalbpitems

myarray[i] = FindType()[totalbpitems]

next

a loop like such.. something like that, so i could easily separate force / might / power etc stuff from my backpack

thanks..

Posted: 2005-02-10 11:42:06
by Edred

Code: Select all

Sub CreateArrayBpack( items )
   VAR i
   UO.TextOpen()
   UO.TextClear()
   for i = 0 to 255
      items[i] = ''
   next
   i = 0
   UO.Findtype( '-1', '-1' )
   While UO.FindCoutn() > 0
      items[i] = UO.GetSerial('finditem')
      UO.TextPrint( 'I found item with ID=' + item[i] )
      UO.Ignore('finditem')
      i = i+1
      If i > 255 Then
         UO.Print( 'Error scaning backpack! You need drop and move to trash your backpack! )
         return
      Endif
      UO.Findtype( '-1', '1' )
   Wend
endsub


Use:

sub main()
DIM items[255]
.........................
CreateArrayBpack( items )
.........................
you can use this array but you must remember what some elements of array are empty

...........
endsub