how to grap 50 form quantity 500 and repeat

Ask for help

Moderators: Murderator+, Murderator

Post Reply
Shokarta
Posts: 19
Joined: 2010-12-01 08:01:12

how to grap 50 form quantity 500 and repeat

Post by Shokarta »

hey guys, ive got this:


Code: Select all

sub grab()
uo.set("finddistance","2")

uo.findtype("0x19B9","-1","ground")
while UO.FindCount() > 0
            UO.moveitem("finditem","5","ground")                               
            wait(1000)
        wend
end sub


and what im trying to do is that if i have 500 ore and cant lift it up because it too heavy, so i want to make a script which would grab only 50 each time and repeat it... but it seem that uo.set(finddistance,2) doesnt work...

It takes first 50 from pack of 500, but then its lifting those 50 from what i already moved :(...

any ideas?
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: how to grap 50 form quantity 500 and repeat

Post by Mirage »

Shokarta wrote:

Code: Select all

sub grab()
uo.set("finddistance","2")
uo.findtype("0x19B9","-1","ground")
    while UO.FindCount() > 0
            UO.moveitem("finditem","5","ground")  ; 5 ore on the ground                               
            wait(1000)
   wend
end sub


It takes first 50 from pack of 500, but then its lifting those 50 from what i already moved :(...

where you have a 50 ore? Only 5.

you move the ore to the "ground". Change the "ground" to 'backpack' or ignore it.

for example

Code: Select all

sub main()
GET(OreTYPE, 'ground', 1, 50) ; you have no ore (<1), it is necessary to take 50

PUT(OreTYPE, 'ground') ; you have ore, it is necessary to put it
endsub


var timemove, itemM
Sub GET(item, cont, min, max) ; предмет, откуда, минимум, сколько брать
   If UO.Count( item ) < min Then
      UO.FindType( item, '-1', cont )
      if UO.FindCount() > 0 Then
         itemM=UO.GetSerial('finditem')
         timemove=UO.Timer()
         while UO.ContainerOf(itemM)==cont && timemove+20>UO.Timer()
            uo.moveitem('finditem', max, 'backpack')
            wait(300)
         wend
      endif
   Endif
end sub
Sub PUT(item, cont)
   while UO.Count( item ) > 0
      UO.FindType( item, -1, -1 )
      itemM=UO.GetSerial('finditem')
      timemove=UO.Timer()
      UO.MoveItem( 'finditem', 0, cont )
      while UO.ContainerOf(itemM)=='my' && timemove+20>UO.Timer()
         wait(300)
      wend
   wend
end sub
Shokarta
Posts: 19
Joined: 2010-12-01 08:01:12

Re: how to grap 50 form quantity 500 and repeat

Post by Shokarta »

ok sorry for misundertnding.

So what i am trying to do is an afk mining, which would always take all iron ore with me as i move....
so imagine you have a 500 iron ore and then you do a step, so you want to take the ore but because all is too heavy you have to grap 50 ore each time...

so the thing is... you have 500 ore in distance of 2 form ya, you move 50 and it drips under your legs, so now you have to same itemtypes on the ground (first is in distance of 2, another is ditance 0)...

how you make the script to move the farest 1 insted of the one under your legs?

if i want to explain it simply, im trying to move 500 ore from one stop to another (on the ground) by 50 each time as 500 is too heavy to grab it together
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: how to grap 50 form quantity 500 and repeat

Post by Mirage »

You can't do as you want. Search by distance identifies all objects within a radius of search, but not those who are at a given distance. The only option to move all the ore at the same time.

PS I'm sorry for my mistakes in English ;)

PPS try this when will move

Code: Select all

sub LootGr()
   repeat
      UO.FindType('0x19B9',-1,'ground')
      if UO.FindCount('finditem') then
         UO.MoveItem('finditem', 0, 'backpack')
         wait(200)
      endif
   until UO.Dead()
end sub
Post Reply