Jump to content

Func not working


Recommended Posts

Hi, im trying to make a simple program to loop pixelsearch, if the program founds the pixel then i want a msgbox to show up, i also want it to loop

but i get this error and i dont know why =(

HotKeySet ("{F1}", "Start")
HotKeySet ("{F3}", "_Exit")
While 1
     Sleep(250)
WEndFunc Start()
     While 1
             Local $coord = PixelSearch(0, 0, 20, 300, 0xFF0000)
If Not @error Then
MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
             EndIf
     WEnd
EndFuncFunc _Exit()
     Exit
Edited by skillsa2
Don't take life too seriously. You'll never escape it alive anyway.
Link to comment
Share on other sites

Tada!:

HotKeySet("{F1}", "Start")
HotKeySet("{F3}", "_Exit")
While 1
    Sleep(250)
WEnd

Func Start()
    While 1
        Local $coord = PixelSearch(0, 0, 20, 300, 0xFF0000)
        If Not @error Then
            MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1])
        EndIf
    WEnd
EndFunc   ;==>Start

Func _Exit()
    Exit
EndFunc   ;==>_Exit

As Scite said you don't have closed your Func status.

Hi!

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Link to comment
Share on other sites

Could you please give your threads a meaningful title? "Doesn't work" doesn't help us to decide if it is worth to read the thread.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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