Yoko

All sides of Injection
It is currently 2025-12-24 21:51:09

All times are UTC+02:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: 2004-07-04 18:41:58 
Offline

Joined: 2004-06-16 00:44:18
Posts: 56
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? :)


Top
   
 Post subject:
PostPosted: 2004-07-04 21:59:09 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
i started work on this but it was disabled when some strange bugs found. i havent finished this work til last published version.


Top
   
 Post subject:
PostPosted: 2004-07-04 23:04:57 
Offline

Joined: 2004-06-16 00:44:18
Posts: 56
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? :)


Top
   
 Post subject:
PostPosted: 2004-07-04 23:48:20 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
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


Top
   
 Post subject:
PostPosted: 2004-07-05 10:56:07 
Offline

Joined: 2004-06-16 00:44:18
Posts: 56
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:
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


Top
   
 Post subject:
PostPosted: 2004-07-05 16:28:33 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
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:
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:
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:
FOR i=0xECA TO 0xED2
   Uo.findtype(str(i) , "-1" , "ground")
   //Some Other code here
NEXT


Top
   
 Post subject:
PostPosted: 2004-07-05 19:55:13 
Offline

Joined: 2004-06-16 00:44:18
Posts: 56
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:
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:
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:
FOR i=3786 TO 3794
      Uo.findtype(i,"-1","ground")
      //some other code here
NEXT

And yes it does: findtype supports decimals. :D

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:
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.


Top
   
 Post subject:
PostPosted: 2004-07-05 21:45:16 
Offline
Site Admin
User avatar

Joined: 2004-04-03 16:49:38
Posts: 1964
msg want string as argument, i is a number
uo.msg(str(i))


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 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:  
Powered by phpBB® Forum Software © phpBB Limited