Jump to content
Sign in to follow this  

Pixelsearch doesn't work =[

Recommended Posts


; Press Esc to terminate script, Pause/Break to "pause"
; ----------------------------------------------------------------------------
;   AutoIt Version:
;   Author: BakedBeanss0802
; ----------------------------------------------------------------------------
#include <INet.au3>
#include <GuiButton.au3>
#include <GuiToolBar.au3>
#include <GuiConstantsEx.au3>

GuiCreate("Notepad Shtuff",314,299,585,333)
$button2=GuiCtrlCreateButton("Start typin",65,232,183,50)
$label1=GuiCtrlCreateLabel("Notepad typer",100,25,94,15)
$label2=GuiCtrlCreateLabel("How to Setup",56,52,260,15)
$label3=GuiCtrlCreateLabel("1. open notepad",7,73,180,15)
$label4=GuiCtrlCreateLabel("2. whatcha wanna type?",6,94,224,15)
While 1
If $msg=-3 Then Exit
If $msg=$button1 Then button1()
If $msg=$button2 Then button2()

Func button1()
MsgBox(32, "-About", "Program Created by BakedBeanss0802")
Func button2()
if GUICtrlRead($input1) = "Copper" Then
   Opt("PixelCoordMode", 2) ;1=absolute, 0=relative, 2=client
      $aCoords = PixelSearch(269, 200, 309, 227, 0x926A45, 5, 2, "[CLASS:SunAwtFrame]")
    If @error = 0 Then
      ControlSend("[CLASS:Notepad]", "", "[Edit]", $input1)
   MsgBox(32, "-About", "Program Crea12342313214dBeanss0802")

It always does MsgBox(32, "-About", "Program Crea12342313214dBeanss0802") even though the pixel is on the screen

Share this post

Link to post
Share on other sites

change If @error = 0 then to If NOT @error then is not the same...

  • Like 1

Share this post

Link to post
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
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.