Page 1 of 1
Finding more than one type.
Posted: 2004-07-04 18:41:58
by Boydon
Is is possible to find two or more type at the same time?
I mean somethig like "finditem ABC_DEF_GHI" in easyuo.
If yes, how?

Posted: 2004-07-04 21:59:09
by Yoko
i started work on this but it was disabled when some strange bugs found. i havent finished this work til last published version.
Posted: 2004-07-04 23:04:57
by Boydon
Do you plan to finish this?
Anyway: an alternative solution?
I though i can put all the types in an a arry and then loop trought it: better ideas?

Posted: 2004-07-04 23:48:20
by Yoko
no, this is a general way.
only one exception in case of type numbers are continuous (0x1234, 0x1235, 0x1236...) In this case possible to use cycle with uo.Hex2Int conversion
Posted: 2004-07-05 10:56:07
by Boydon
Yes they are continous from 0xECA to 0xED2.
I can't figoure out a way to loop with Uo.Hex2Int(), can you help me or just make an example?
Maybe somethin like:
Code: Select all
FOR i=Uo.Hex2Int(0xECA) TO Uo.Hex2Int(0xED2)
Uo.findtype("i" , "-1" , "ground") ;<- I assume findtype accepts decimal, or i have to convert them back with Int2Hex?
//Some Other code here
NEXT
Posted: 2004-07-05 16:28:33
by Yoko
Boydon wrote:Yes they are continous from 0xECA to 0xED2.
I can't figoure out a way to loop with Uo.Hex2Int(), can you help me or just make an example?

Maybe somethin like:
Code: Select all
FOR i=Uo.Hex2Int(0xECA) TO Uo.Hex2Int(0xED2)
Uo.findtype("i" , "-1" , "ground") ;<- I assume findtype accepts decimal, or i have to convert them back with Int2Hex?
//Some Other code here
NEXT
"i" is not a decimal, it is a string consists of letter 'i'.
do not mix name of variable and it's value
this will surely work
Code: Select all
FOR i=Uo.Hex2Int("0xECA") TO Uo.Hex2Int("0xED2")
Uo.findtype(uo.Int2Hex(i) , "-1" , "ground")
//Some Other code here
NEXT
also you may try
Code: Select all
FOR i=0xECA TO 0xED2
Uo.findtype(str(i) , "-1" , "ground")
//Some Other code here
NEXT
Posted: 2004-07-05 19:55:13
by Boydon
Yoko wrote:"i" is not a decimal, it is a string consists of letter 'i'.
do not mix name of variable and it's value
this will surely work
Code: Select all
FOR i=Uo.Hex2Int("0xECA") TO Uo.Hex2Int("0xED2")
Uo.findtype(uo.Int2Hex(i) , "-1" , "ground")
//Some Other code here
NEXT
also you may try
Code: Select all
FOR i=0xECA TO 0xED2
Uo.findtype(str(i) , "-1" , "ground")
//Some Other code here
NEXT
While waiting for a reply I made some tries and used the simplest one:
Code: Select all
FOR i=3786 TO 3794
Uo.findtype(i,"-1","ground")
//some other code here
NEXT
And yes it does: findtype supports decimals.

What I want to point out is another thing; I used the previous for loop because while doing tests i found that code like this:
Code: Select all
FOR i=Uo.Hex2Int("0xECA") TO Uo.Hex2Int("0xED2")
uo.msg(i)
wait(1000)
NEXT
does not give any output: is this supposed to happen or it is a bug?
I've also tried with str() and int() and with uo.msg() instead of uo.print(), but notthing to do: no monitor output.
Posted: 2004-07-05 21:45:16
by Yoko
msg want string as argument, i is a number
uo.msg(str(i))