Jump to content

One little question about IF


6momo6
 Share

Recommended Posts

Ive got one question:

I want to make a IF sense  but dont know exactly how to begin.

How can i write this:  If  cordinate  11, 62  isnt able to click  Then restart script. start in a new beginninig.

thx in advance

-momo

<{POST_SNAPBACK}>

I am a little confused about what you are asking. All coordinates are clickable; the coordinate that is clicked may not do anything special, but you can click it. If by clicking that coordinate, something is supposed to happen, like a window popping up, you can do a WinWaitActive().

If WinWaitActive ("My Cool Window") Then MsgBox (0, "Yay!", "My Window Opened")

Please be more specific in what you are trying to do.

Link to comment
Share on other sites

Hi dude

Thanx for your reply first.

Ive got SOO much ideas and i cannot explain how they are.

Yes they are clickable but i mean if the cordinate for example "X=12, Y=14" this is click able! But for a reason this coordinate isnt mopore click able the click button is empty so the script must just restart.

If 12,14 the button is empty then restart script // begin from 0. You get it what i mean?

-momo

Edited by Larry
Link to comment
Share on other sites

If WinWaitActive ("My Cool Window") Then MsgBox (0, "Yay!", "My Window Opened")

<{POST_SNAPBACK}>

This would be better written as:

winWaitActive("My Cool Window")
msgBox(0, "Yay!", "My Window Opened")

They are two separate commands with no relation -- when you don't specify a timeout for WinWaitActive(), it will never return false to prevent execution of the MsgBox().

Link to comment
Share on other sites

This would be better written as:

winWaitActive("My Cool Window")
msgBox(0, "Yay!", "My Window Opened")

They are two separate commands with no relation -- when you don't specify a timeout for WinWaitActive(), it will never return false to prevent execution of the MsgBox().

<{POST_SNAPBACK}>

Certainly disagree. The 2 separate commands are related to displaying if the WinWaitActive is True, then the messagebox will show. How do you get more related then that? The If statement is not incorrect.

Timeout or not, both will do the same, but what SerialKiller displays is a line that is more readable and applies more so in other similar approaches. ;)

Link to comment
Share on other sites

Hi thanx all for replay.

You didnt get exactly what im looking for ;)

AT the moment i cant post my scrippt here because its empty :P.

I just want to write a script like this :

If Clickbuttonempty(12,14)

then restartscript.

sounds very simple, its nothing about winactive thing!! Not any popup etc.. Someone know the command for restart a script ??

-momo

Edited by 6momo6
Link to comment
Share on other sites

I just want to write a script like this :

If Clickbuttonempty(12,14)

then restartscript.

You could wrap your entire script in a While..WEnd loop:

while (1)

   ; script lines
    if (buttonIsEmpty()) then continue
   ; script lines

   ; if you don't want the script to repeat at the end
    exitLoop

wEnd

Certainly disagree. The 2 separate commands are related to displaying if the WinWaitActive is True, then the messagebox will show. How do you get more related then that? The If statement is not incorrect.

Timeout or not, both will do the same, but what SerialKiller displays is a line that is more readable and applies more so in other similar approaches. ;)

<{POST_SNAPBACK}>

Not to cause an argument here -- just to learn more about others' views:

This use of WinWaitActive() here does not return a varying value. It always returns a true equivalent. To me it doesn't make sense to wrap something unconditionally true into an If statement -- it implies falsely that the WinWaitActive() command might return a false equivalent, and therefore prevent the message box from displaying -- which will never be the case.

I do agree that most of the time it is a good thing to wrap AutoIt functions in an If..Then construct (as almost every single function returns a boolean value). The only equivalent example I can come up with to this however is:

if msgBox(0, "Message Box", "With OK button only") then doWork()

Would you agree that this is a nonsensical use of If..Then (where MsgBox() will always return 1)? If so then how does it differ from the above example?

Edit: Missing comma from code.

Edited by LxP
Link to comment
Share on other sites

Thanx for the reply.

Its not what iam looking for. Should i ask Jon ???? He have to know, that ??

I cant believe about 1000 users here and no one can help me out.

its just a simple script.

IF Clickbuttonempty(12, 14)

Then restart script.

Its really as hard as say ??

-momo

ps.

Jon you has been received a PM *lol*

Link to comment
Share on other sites

Do you mean if the mouse cursor ISN'T over the button, therefore, the clickbutton is empty? If so...

While 1 = 1
   $Pos = GetMousePos()
   If $Pos[0] = 14 AND $Pos[1] = 16 Then 
      MsgBox(0,"Clickable!","This button is clickable!")
   EndIf
wEnd

Just a lil' somethin to get you on your way

Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite
Link to comment
Share on other sites

Ok again i try my best to explain!

X=14 , Y=16 These are the xy cordinates. IF 14, 16 click Cordinate ISNT click able then exit script . reload script. Thats all!

If Clickbutton (14, 16) is empty then exit script. // reload after, i dont need any MSG box etc.. it should make all automaticly.

thx in advance

-momo

Edited by 6momo6
Link to comment
Share on other sites

Ok again i try my best to explain!

X=14 , Y=16  These are the xy cordinates.  IF 14, 16 click Cordinate ISNT click able then exit script .  reload script.  Thats all!

If Clickbutton (14, 16) is empty then exit script.  // reload after, i dont need any  MSG box etc..  it should make all automaticly.

thx in advance

-momo

<{POST_SNAPBACK}>

WHAT ???

again: WHAT ????

What is Clickbutton (14, 16)? What is Clickbutton()??

What do you mean by "If Clickbutton (14, 16) is empty"? What is "empty"???

What do you mean by "Cordinate ISNT click able"?

What do you mean by "i dont need any MSG box etc.. it should make all automaticly."?

I cant believe about 1000 users here and no one can help me out.

Well, I guess it's not the 1000 users, but your description of the problem.... Try to be more specific! What exactly are you trying to do?????

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

Ok here i add a small pic:  if this  button as you see (pic)  looks like this  = buttonempty  to reload the script.

Posted Image

What you need is PixelGetColor(), see help file sample and search the forum. To restart your script, use Run() and exit(). However, you'll have to compile your script for this!

Please try to understand what I said and come back with at least some code, before you ask further questions, otherwise the chances are rather high, that another 1000 users won't understand what you want.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

I know this code is really for laugh, I had no clue how to bring it right hehe.

glad for any help i get.

while 1
MouseClick("left", 506, 509)
   Do
Sleep(1300)
;Wait for page to finish loading
   Until  $oIE.busy = 0
MouseClick("left", 11, 62);back button
$coord = PixelSearch( 0, 0, 20, 300, 0xEBEBEC)
exit
run
wend

any Idea ?? I tested it didnt work ;)

Edited by 6momo6
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...