repeat till variable = 1

06/07/2014 20:27 goldenapple007#1
I need to repeat something untill a variable is 1.

pause (1000)
MouseClick("left",$x,$y,1,10)
$IS = _ImageSearch(@ScriptDir&"\Images\Icon.png",1,$x,$y ,100)
If $IS = 1 Then

so I want it to repeat every 10 sec : MouseClick("left",$x,$y,1,10)
untill it finds the image.

Yes I know this is really easy, but I couldn't find it in the help file.
06/07/2014 20:56 alpines#2
Code:
While 1
	Sleep(1000)
	If _ImageSearch(@ScriptDir & "\Images\Icon.png", 1, $x, $y, 100) Then ExitLoop
	MouseClick("left", $x, $y, 1, 10)
WEnd
06/07/2014 20:58 goldenapple007#3
Quote:
Originally Posted by alpines View Post
Code:
While 1
	Sleep(1000)
	If _ImageSearch(@ScriptDir & "\Images\Icon.png", 1, $x, $y, 100) Then ExitLoop
	MouseClick("left", $x, $y, 1, 10)
WEnd
thanks a lot!
Hope that 1 day I'll be as good as you in auto it :handsdown:
06/08/2014 11:34 -SoulCr4ck-#4
Quote:
Originally Posted by goldenapple007 View Post
thanks a lot!
Hope that 1 day I'll be as good as you in auto it :handsdown:
You can also use a Do Until Function
Code:
Do
$i = pixelsearch ()
Sleep(10)
Until $i = 1
MsgBox (64,$i,$i)
06/08/2014 12:02 goldenapple007#5
Quote:
Originally Posted by x[Deadline View Post
You can also use a Do Until Function
Code:
Do
$i = pixelsearch ()
Sleep(10)
Until $i = 1
MsgBox (64,$i,$i)
tried that already and asked on autoit forums if it would work ...
I got banned for 5 days cus I used the word "game"
06/08/2014 16:32 fear-x#6
Quote:
Originally Posted by goldenapple007 View Post
tried that already and asked on autoit forums if it would work ...
I got banned for 5 days cus I used the word "game"
read the autoit forum rules... no game related threads or scripts allowed there....
06/08/2014 18:57 goldenapple007#7
Quote:
Originally Posted by fear-x View Post
read the autoit forum rules... no game related threads or scripts allowed there....
I know ...
first time I didn't read the rules ...
second time I posted a script that opens a game ( thought that was allowed ...)
:mad:
06/08/2014 19:07 alpines#8
No one's going to blame you for writing a script which opens a game.
ImageSearch is used for botting (mostly) and most games have a ToC which don't allow botting. Therefore it isn't allowed.
06/08/2014 21:48 fear-x#9
Quote:
Originally Posted by alpines View Post
No one's going to blame you for writing a script which opens a game.
ImageSearch is used for botting (mostly) and most games have a ToC which don't allow botting. Therefore it isn't allowed.
they will *blame* everyone and anyone .. for writing script to open a game hahah.... trust me .. ive had so many retarded occasions with melba there omg ... they think they are grown up.... loooool.. fucking bunch of kids ...

was asking about autoit and multitasking... list all the ways there are to do it in autoit ... but no ... melba goes apeshit on my thread ;D haha...

and i asked for a way to protect autoit .exe properly from the decompiler thats out there.....
and he answered me something... then i said again but i only want to protect the exe because there is a stupid decomper out there and all leechers can decomp .exes easy...

he went ape shit on me again just for saying word "decompiler" hahaha ... kids lol never gonna visit that forum again ever... useless
06/08/2014 22:29 goldenapple007#10
Quote:
Originally Posted by fear-x View Post
they will *blame* everyone and anyone .. for writing script to open a game hahah.... trust me .. ive had so many retarded occasions with melba there omg ... they think they are grown up.... loooool.. fucking bunch of kids ...

was asking about autoit and multitasking... list all the ways there are to do it in autoit ... but no ... melba goes apeshit on my thread ;D haha...

and i asked for a way to protect autoit .exe properly from the decompiler thats out there.....
and he answered me something... then i said again but i only want to protect the exe because there is a stupid decomper out there and all leechers can decomp .exes easy...

he went ape shit on me again just for saying word "decompiler" hahaha ... kids lol never gonna visit that forum again ever... useless
I have the same experience with that forum :(

Quote:
Originally Posted by alpines View Post
No one's going to blame you for writing a script which opens a game.
ImageSearch is used for botting (mostly) and most games have a ToC which don't allow botting. Therefore it isn't allowed.
I was learning how to script .... wanted to learn imagesearch.
So I created a bot to open minecraft.
I bet if I could ask Mojang if this is allowed they would say yes ...
There is no reason to not allow this :mad:
06/08/2014 23:43 alpines#11
Then get the proof that it is allowed. Without it isn't.
And you don't need ImageSearch for Minecraft.
06/14/2014 19:55 seanbrockest#12
Glad you got your answer. There a lot of different ways to do what you wanted, I for one prefer the do loop, or a for loop. This way if you wanted you can keep track of it and output the current loop iteration if you wanted to in the future.

As for the autoit forums, I even had a guy on the forums try to trick me into saying i was trying to code for a game. i was looking for help on autoit syntax and structure. Simple coding questions. He tried multiple times to trick me into admiting i was making a game script.

Be very careful with those forums, even some of the 10,000+ posters are .... well i'm gonna be friendly and not use that word :)