Yoko

All sides of Injection
It is currently 2025-10-28 00:54:48

All times are UTC+02:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Help with macro!
PostPosted: 2006-09-26 05:52:59 
Offline

Joined: 2004-12-09 13:25:07
Posts: 18
Hi,

What I'm trying to do is somewhat complex. I have a bag in my house that hold my reagents. Sometimes, I get home with 4, 5 bags with regs of others players that I've looted. So, I want to :

1.) emptycontainer all those bags to my backpack
2.) Move all the regs in my backpack to the main reagent bag in my house
3.) Transfer 50 of each reagent from the main reagent bag to my reagent bag in my backpack.

I could write the steps 2 and 3, but not the one IF AND ONLY IF THERE'S TWO BAGS OF THE SAME KIND IN MY BACKPACK. I've tried this, please, someone help me:

Code:
sub restock() 
var i
dim a[8]
dim b[4]

b[0]="0x0E76"
b[1]="0x0E75"
b[2]="0x09A9"
b[3]="0x0E79"

for i = 0 to 3
UO.FindType(b[i],"-1","backpack")
if UO.FindCount() < 2 then
 UO.EmptyContainer("0", "finditem", "backpack")
 else
 for j = 1 to UO.FindCount()
 UO.EmptyContainer("0", "finditem[j]", "backpack")
end if
wait(90)
next

UO.Exec("set quiet 1")
UO.SetReceivingContainer("mainbagreg")

a[0]="0x0F86"
a[1]="0x0F7A"
a[2]="0x0F84"
a[3]="0x0F8D"
a[4]="0x0F8C"
a[5]="0x0F85"
a[6]="0x0F88"
a[7]="0x0F7B"
for i = 0 to 7
UO.FindType(a[i],"0","backpack")
UO.Grab("0","finditem")
wait(90)
next
UO.SetReceivingContainer("myregbag")
for i = 0 to 7
UO.FindType(a[i],"0","mainregbag")
UO.Grab("50","finditem")
wait(90)
next
UO.Exec("set quiet 0")

end sub

_________________
"Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation." - Oscar Wilde


Top
   
 Post subject:
PostPosted: 2006-09-26 06:43:46 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
its simple... you must find 'my' not 'backpack' like
Code:
uo.findtype('reg','col','my')

now you are finding in you, on you and even in bags in your backpack, but injection cant find anything if that bag was never opened, so firstly you must find bags, open it and then you can search for reagents in your backpack :roll:

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2006-09-27 04:14:55 
Offline

Joined: 2004-12-09 13:25:07
Posts: 18
NMY wrote:
its simple... you must find 'my' not 'backpack' like
Code:
uo.findtype('reg','col','my')

now you are finding in you, on you and even in bags in your backpack, but injection cant find anything if that bag was never opened, so firstly you must find bags, open it and then you can search for reagents in your backpack :roll:


The first part of the script, that:

Code:
dim b[4]

b[0]="0x0E76"
b[1]="0x0E75"
b[2]="0x09A9"
b[3]="0x0E79"

for i = 0 to 3
UO.FindType(b[i],"-1","backpack")
if UO.FindCount() < 2 then
 UO.EmptyContainer("0", "finditem", "backpack")
 else
 for j = 1 to UO.FindCount()
 UO.EmptyContainer("0", "finditem[j]", "backpack")
end if
wait(90)
next


is exactly to search any backback and emptycontainer it. The problem, NMY, is if I have 2 bags of the same type, Injection will use only the first one.

I've tried do the macro with the "my" object, but I have to loop the search for reags as many times as I have bags in my backpack, because if not, the script will transfer only the first find item.

For instance, if I have a backpack with NS, GA and MR, and other with SS, BP and SA, the macro will work fine, but if I have one bag with MR, and other with MR, the macro will transfer only the reags from the first bag. So, you've helped me, but I'm still suffering from the same problem.

_________________
"Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation." - Oscar Wilde


Top
   
 Post subject:
PostPosted: 2006-09-27 04:22:17 
Offline

Joined: 2004-12-09 13:25:07
Posts: 18
OK, done. Thanks, NMY. I've added a for to count the bags, and sum it to a variable. This variable holds the number of bags, and I loop as many times as needed.

Thanks =)

_________________
"Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation." - Oscar Wilde


Top
   
 Post subject:
PostPosted: 2006-09-28 23:29:09 
Offline

Joined: 2004-12-09 13:25:07
Posts: 18
Hey, how can I search the bags within my bag and open it, so that Injection can count the regs within?

_________________
"Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation." - Oscar Wilde


Top
   
 Post subject:
PostPosted: 2006-09-29 07:53:49 
Offline
Expert!
User avatar

Joined: 2005-09-14 15:31:58
Posts: 2152
Location: Latvia
Paul wrote:
Hey, how can I search the bags within my bag and open it, so that Injection can count the regs within?

Code:
uo.findtype('bagtype')
while uo.findcount()
uo.useobject('finditem')
wait(250)
uo.findtype('bagtype')
wend

_________________
Уроки языка Injection
Основные команды языка Injection
Yoko Injection Code Sweeper
Drw (2009) скрипты
2017 Начал играть на Uorpg.net


Top
   
 Post subject:
PostPosted: 2006-10-04 05:36:22 
Offline

Joined: 2004-12-09 13:25:07
Posts: 18
NMY wrote:
Paul wrote:
Hey, how can I search the bags within my bag and open it, so that Injection can count the regs within?

Code:
uo.findtype('bagtype')
while uo.findcount()
uo.useobject('finditem')
wait(250)
uo.findtype('bagtype')
wend


This loops forever, NMY...

ohh I forgot :roll:
Code:
uo.findtype('bagtype')
while uo.findcount()
uo.useobject('finditem')
uo.ignore('finditem')
wait(250)
uo.findtype('bagtype')
wend
uo.ignorereset()

_________________
"Most people are other people. Their thoughts are someone else's opinions, their lives a mimicry, their passions a quotation." - Oscar Wilde


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited