Jump to content

If Problem


Death
 Share

Recommended Posts

HotKeySet("{HOME}" , "Search")
HotKeySet("{END}","Quit")
While 1
    sleep(100)
WEnd

Func Search()
If
$pic = True Then
msgbox( 0, "Correct Color", "Correct!" )
Else
msgbox( 1, "Wrong Color", "Wrong!!" )
EndIf
EndFunc

Func Quit()
    Exit
End Func


Func $pic
    PixelSearch( 629, 389, 629, 389, "0000ff" ) = True
EndFunc

Any insight would be nice.

Edited by Death
Link to comment
Share on other sites

  • Moderators

HotKeySet("{HOME}" , "Search")
HotKeySet("{END}","Quit")
While 1
    sleep(100)
WEnd

Func Search()
If
$pic = True Then
msgbox( 0, "Correct Color", "Correct!" )
Else
msgbox( 1, "Wrong Color", "Wrong!!" )
EndIf
EndFunc

Func Quit()
    Exit
End Func


Func $pic
    PixelSearch( 629, 389, 629, 389, "0000ff" ) = True
EndFunc

Any insight would be nice.

Here's a suggestion... Take the tutorials provided on the forum.

http://www.autoitscript.com/forum/index.php?showtopic=21048

http://www.autoitscript.com/forum/index.php?showtopic=84960

2 Things spotted quickly:

You must have all conditional statements on 1 line.

You can't use variables when declaring function names.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

HotKeySet("{HOME}" , "Search")
HotKeySet("{END}", "Quit")

While 1
    Sleep(100)
WEnd

Func Search()
    If _Pic() = True Then
        Msgbox( 0, "Correct Color", "Correct!" )
    Else
        Msgbox( 1, "Wrong Color", "Wrong!!" )
    EndIf
EndFunc

Func Quit()
    Exit
EndFunc


Func _Pic()
    Return $pic = PixelSearch( 629, 389, 629, 389, "0000ff" )
EndFunc

AlmarM

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

HotKeySet("{HOME}" , "Search")
HotKeySet("{END}", "Quit")

While 1
    Sleep(100)
WEnd

Func Search()
    If _Pic() = True Then
        Msgbox( 0, "Correct Color", "Correct!" )
    Else
        Msgbox( 1, "Wrong Color", "Wrong!!" )
    EndIf
EndFunc

Func Quit()
    Exit
EndFunc


Func _Pic()
    Return $pic = PixelSearch( 629, 389, 629, 389, "0000ff" )
EndFunc

AlmarM

Thanks :)

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