Array of items ..

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
pim
Posts: 5
Joined: 2005-02-05 22:28:14

Array of items ..

Post 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..
Edred
Expert!
Posts: 2544
Joined: 2004-04-03 17:36:29
Location: Saint-Petersburg

Post 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
Post Reply