Yoko
http://forum.yoko.com.ua/

simple sort
http://forum.yoko.com.ua/viewtopic.php?f=3&t=9254
Page 1 of 1

Author:  Taya [ 2006-11-04 16:53:13 ]
Post subject:  simple sort

Hi,

I try to make the following:

there is a bag with 149 thing. some of them maybe except. to find them i try to read the journal

Code:
sub ExceptFind()
        uo.deletejournal()
        # easy-nr ob the bag is VXOXCSD
        uo.findtype(-1,"-1",'VXOXCSD')
        uo.click('finditem')
        # here i can see the new line in the journal
        if uo.InJournal('except')
            # move the item to except bag
        else
            # move the item to normal bag
        endif
end sub


the inJournal will not work in this way. how can i do it right?
and how can i move the finditem to a specific bag?

there shoud be also a loop.

please help me to unterstand injection!

thanks

taya

Author:  Scripts Writer [ 2006-11-04 18:13:28 ]
Post subject: 

Code:
sub Move()
  var container = ' ID '
  var ExpBag = ' ID '
  var Bag = ' ID '
  uo.UseObject(container)
  uo.FindType('-1','-1',container)
  while uo.FindCount()
    uo.DeleteJournal()
    if uo.FindCount() then
      uo.Click('finditem')
      wait(250)
      if uo.InJournal('except') then
        uo.moveitem('finditem','all',ExpBag)
        wait(750)
      else
        uo.moveitem('finditem','all',Bag)
        wait(750)
      end if
   end if
   uo.FindType('-1','-1',container)
  wend
end sub

Author:  Infectous [ 2006-11-04 18:19:28 ]
Post subject: 

Code:
sub ExceptFind()
var except = '0x00000000'
        repeat # starts loop
        uo.deletejournal()
        # easy-nr ob the bag is VXOXCSD
        uo.findtype(-1,"-1",'VXOXCSD')
        uo.click('finditem')
        # here i can see the new line in the journal
        # insert a pause to be sure injection has time to read it
              wait(1000)
        if uo.InJournal('except')
            # move the item to except bag
except=UO.JournalSerial(UO.InJournal( 'except' )-1)
       UO.MoveItem( 'except', -1, "except bag" ) # var or addobject to the bag
        else
            # move the item to normal bag
       UO.MoveItem( 'finditem', -1, "normal bag" ) # var or addobject to the bag
        uo.findtype(-1,"-1",'VXOXCSD')
        until uo.findcount() == 0 # ends loop
        endif
end sub


play with it a bit hopefully this will help get you started to what you want
also here is an example of a script I used to trash items that uses a different approach by simply ignoring certain items

Code:
sub tickets()
uo.canceltarget()
uo.print('Target the bag if items...')
uo.exec('addobject rewardbag')
while uo.targeting()
wait(100)
Wend
uo.useobject('rewardbag')
wait(500)
uo.findtype('0x0E76',"-1",'rewardbag','my')
while uo.findcount() > 0
uo.ignore('finditem')
uo.findtype('0x0E76',"-1",'rewardbag','my')
wend
uo.findtype('0x0F0E',"-1",'rewardbag','my')
while uo.findcount() > 0
uo.ignore('finditem')
uo.findtype('0x0F0E',"-1",'rewardbag','my')
wend
uo.ignore('finditem')
uo.findtype('-1',"-1",'rewardbag','my')
repeat
uo.waittargetobject('finditem')
uo.usefromground('0x0E77','0x079A')
wait(250)
uo.lclick(87,169)
wait(250)
uo.lclick(306,329)
wait(250)
checklag()
uo.findtype('-1',"-1",'rewardbag','backpack')
until uo.findcount() == 0
uo.canceltarget()
end sub


and yet another that I used to bank certain items (note: its an older one that I don't loop the movement)

Code:
sub Bankshit()
Uo.Say("bank")
wait(1000)
var i,r,j,c
var RegsBag = '0x4007CABE' ; ,info ID your own bags in bank
var JewelsBag = '0x40074C80'
var GoldsBag = '0x402AD1CF'
Dim A[20]
A[1] = 0x0f7b ;BloodMoss
A[2] = 0x0f7a ;BlackPearl
A[3] = 0x0f84 ;Garlic
A[4] = 0x0f85 ;Ginseng
A[5] = 0x0f86 ;MandrakeRoot
A[6] = 0x0f88 ;Nightshade
A[7] = 0x0f8c ;SulphorousAsh
A[8] = 0x0f8d ;SpidersSilk
A[9] = 0x0E34 ;Scrolls
A[10] = 0x0f10 ;Emerald
A[11] = 0x0f13 ;Ruby
A[12] = 0x0f15 ;Citrine
A[13] = 0x0f16 ;Amethyst
A[14] = 0x0f11 ;Sapphire
A[15] = 0x0f0f ;Star Sapphire
A[16] = 0x0f25 ;Piece of Amber
A[17] = 0x0f26 ;Diamond
A[18] = 0x0f18 ;Tourmaline
A[19] = 0x0F13 ;Player Tickets
A[20] = 0x14EB ;Maps
i=100
FOR r=1 TO 9
uo.findtype(A[r],"-1","backpack")
if uo.findcount() > 0 then
UO.MoveItem( 'finditem', 0, RegsBag )
uo.print("Found "+str(uo.findcount()))
wait(i)
END if
next
FOR j=10 TO 18
uo.findtype(A[j],"-1","backpack")
if uo.findcount() > 0 then
UO.MoveItem( 'finditem', 0, JewelsBag )
uo.print("Found "+str(uo.findcount()))
wait(i)
END if
next
FOR c=19 TO 20
uo.findtype(A[c],"-1","backpack")
if uo.findcount() > 0 then
UO.MoveItem( 'finditem', 0, GoldsBag )
uo.print("Found "+str(uo.findcount()))
wait(i)
END if
next
UO.Findtype('0x0F0E','0x0000',"backpack") ;MTbottles
if Uo.FindCount() then
UO.MoveItem( 'finditem', 0, RegsBag )
end if
UO.Findtype('0x0F0E','0x00AC',"backpack") ;poisons
if Uo.FindCount() then
UO.MoveItem( 'finditem', 0, RegsBag )
end if
UO.Findtype('0x0F13','0x0055',"backpack") ;Player Tickets
if Uo.FindCount() then
UO.MoveItem( 'finditem', 0, GoldsBag )
end if
UO.Findtype('0x0EED','0x0000',"backpack") ;gold coins
if Uo.FindCount() then
UO.MoveItem( 'finditem', 0, GoldsBag )
end if
end sub


and one I use to actually move certain multiple items ("Lavaya was the name of my char at the time i used for the var)

Code:
sub move()
       UO.Deletejournal()
       UO.Print('Target the Container you want to move the objects to....')
       UO.Exec('addobject Bag')
 While UO.Targeting()
   Wait(100)
 Wend
       UO.Print('Target one of the objects you want to move all of')
       UO.Exec('addtype Lavaya')
 While UO.Targeting()
   Wait(100)
 Wend
    If UO.Count( 'Lavaya' ) > 0 then
   Repeat
       UO.FindType( 'Lavaya', -1, 'my' )
       UO.MoveItem( 'finditem', -1, "Bag" )
   Wait( 50 )
  Until UO.Count( 'Lavaya' ) == 0   
 End If
end sub


and oh yeah what he said :)

Author:  Taya [ 2006-11-04 18:35:07 ]
Post subject: 

wow thanks. that was fast!

i'll try it.

hopefully
taya

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/