Sign in to follow this  
Followers 0
Evil_Has_Survived

Help Pixel Mouse Mover

18 posts in this topic

#1 ·  Posted (edited)

I want to make a program that you set the pixel and the mouse clicks on it, but with this script im not sure were I should start not to good with GUI. I got this so far but I don't know the commands I should use.

#include <GUIConstants.au3>
#include <File.au3>
GuiCreate("PiXel Clicker", 392, 402, -1, -1, -1)
$Label_1 = GuiCtrlCreateLabel("Hi Welcome to my PiXel finder, this is a nice little program, you find the pixel set the x,y axis if you need to incase youre pixel doesn't move but you need to click it.This program will also let you set ten colors that you want to be clicked, (so if you set green and tell it to run the bot it will click on the green)", 10, 10, 380, 90)
$Group_1 = GUICtrlCreateGroup("Pixel Search Area", 10, 170, 370, 100)
$Label_1 = GUICtrlCreateLabel("Left           Top             Right         Bottom          Color variation", 20, 190, 350, 20)
GuiCtrlCreateInput("Left", 20, 210, 40, 20)
GuiCtrlCreateInput("Top", 80, 210, 40, 20)
GuiCtrlCreateInput("Right", 140, 210, 40, 20)
GuiCtrlCreateInput("Bottom", 200, 210, 40, 20)
GuiCtrlCreateInput("Color variation", 270, 210, 40, 20)
$Group_2 = GUICtrlCreateGroup("Colors to Search  -  10 Max", 10, 280, 370, 70)
GUICtrlCreateLabel("1", 20, 300, 50, 20)
GUICtrlCreateLabel("2", 70, 300, 50, 20)
GUICtrlCreateLabel("3", 120, 300, 50, 20)
GUICtrlCreateLabel("4", 170, 300, 50, 20)
GUICtrlCreateLabel("5", 220, 300, 50, 20)
GUICtrlCreateLabel("6", 20, 320, 50, 20)
GUICtrlCreateLabel("7", 70, 320, 50, 20)
GUICtrlCreateLabel("8", 120, 320, 50, 20)
GUICtrlCreateLabel("9", 170, 320, 50, 20)
GUICtrlCreateLabel("10", 220, 320, 50, 20)
GUICtrlCreateButton("Get Area", 280, 240, 90, 25)
GUICtrlCreateButton("Get Colors", 280, 290, 90, 25)
GUICtrlCreateButton("Clear All", 280, 320, 90, 25)
GUICtrlCreateButton("Save Game Info", 10, 360, 110, 30)
GUICtrlCreateButton("Run GameBot", 140, 360, 110, 30)
GUICtrlCreateButton("Exit GameBot", 270, 360, 110, 30)
GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
;;;
    EndSelect
WEnd
Exit

maybe I can cut some stuff out of this

#include <GUIConstants.au3>
#include <File.au3>

Dim $ver = "1.0.2"
Dim $pos = "", $CHex = "", $Cpos = "", $Count = 0, $data[11], $Label_[11], $Run, $Launcher, $cwait = 0
Dim $pause, $left = 0, $right = @DesktopWidth, $top = 0, $bottom = @DesktopHeight, $wait = 1000, $Vary = 5, $Skip = 5
Dim $Gloc = @ScriptDir & "\Games\", $Ginfo

Opt("PixelCoordMode", 0)      ;1=absolute, 0=relative, 2=client
Opt("MouseCoordMode", 0)      ;1=absolute, 0=relative, 2=client

HotKeySet("{ESC}", "Terminate")

$Gamebot = GUICreate("GameBot - Builder   by, QTasc  v" & $ver, 392, 402, -1, -1, -1, $WS_EX_ACCEPTFILES)
$Group_1 = GUICtrlCreateGroup("Game Select", 10, 10, 370, 60)
$Combo_2 = GUICtrlCreateCombo("New Game", 20, 34, 110, 21)
$Button_3 = GUICtrlCreateButton("Select Game", 150, 30, 100, 30)
Set_Game_List()
$Button_4 = GUICtrlCreateButton("Delete Game", 270, 30, 100, 30)
$Group_5 = GUICtrlCreateGroup("Game Launch", 10, 80, 370, 80)
$Radio_6 = GUICtrlCreateRadio("Run URL", 30, 100, 80, 20)
$Radio_7 = GUICtrlCreateRadio("Run Game exe", 110, 100, 100, 20)
$Input_8 = GUICtrlCreateInput("Type or Drag & Drop  -  URL or Game exe/link", 20, 130, 340, 20, -1, $WS_EX_ACCEPTFILES)
GUICtrlSetState(-1, $GUI_DROPACCEPTED)
GUICtrlSetState(-1, $GUI_DISABLE)
$Radio_9 = GUICtrlCreateRadio("Dont Launch Anything", 230, 100, 130, 20)
GUICtrlSetState(-1, $GUI_CHECKED)
$Group_10 = GUICtrlCreateGroup("Pixel Search Area", 10, 170, 370, 100)
$Label_11 = GUICtrlCreateLabel("Left              Top             Right         Bottom      Varience      Skip", 20, 190, 350, 20)
$Input_12 = GUICtrlCreateInput($left, 20, 210, 40, 20)
$Input_13 = GUICtrlCreateInput($top, 80, 210, 40, 20)
$Input_14 = GUICtrlCreateInput($right, 140, 210, 40, 20)
$Label_16 = GUICtrlCreateLabel("Color Wait", 20, 243, 50, 20)
$Input_19 = GUICtrlCreateInput($cwait, 80, 240, 40, 20)
$Input_15 = GUICtrlCreateInput($bottom, 200, 210, 40, 20)
$Label_16 = GUICtrlCreateLabel("Search Wait", 135, 243, 60, 20)
$Input_17 = GUICtrlCreateInput($Vary, 260, 210, 40, 20)
$Input_18 = GUICtrlCreateInput($wait, 200, 240, 40, 20)
$Group_19 = GUICtrlCreateGroup("Colors to Search  -  10 Max", 10, 280, 370, 70)
$Input_20 = GUICtrlCreateInput($Skip, 320, 210, 40, 20)
$Label_[1] = GUICtrlCreateLabel("1", 20, 300, 50, 20)
$Label_[2] = GUICtrlCreateLabel("2", 70, 300, 50, 20)
$Label_[3] = GUICtrlCreateLabel("3", 120, 300, 50, 20)
$Label_[4] = GUICtrlCreateLabel("4", 170, 300, 50, 20)
$Label_[5] = GUICtrlCreateLabel("5", 220, 300, 50, 20)
$Label_[6] = GUICtrlCreateLabel("6", 20, 320, 50, 20)
$Label_[7] = GUICtrlCreateLabel("7", 70, 320, 50, 20)
$Label_[8] = GUICtrlCreateLabel("8", 120, 320, 50, 20)
$Label_[9] = GUICtrlCreateLabel("9", 170, 320, 50, 20)
$Label_[10] = GUICtrlCreateLabel("10", 220, 320, 50, 20)
$Button_29 = GUICtrlCreateButton("Get Area", 280, 240, 90, 25)
$Button_30 = GUICtrlCreateButton("Get Colors", 280, 290, 90, 25)
$Button_31 = GUICtrlCreateButton("Clear All", 280, 320, 90, 25)
$Button_32 = GUICtrlCreateButton("Save Game Info", 10, 360, 110, 30)
$Button_33 = GUICtrlCreateButton("Run GameBot", 140, 360, 110, 30)
$Button_34 = GUICtrlCreateButton("Exit GameBot", 270, 360, 110, 30)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_34
            ExitLoop
        Case $msg = $Button_3
            $Ginfo = GUICtrlRead($Combo_2)
            If $Ginfo = "" Then
           ; nada
            ElseIf $Ginfo = "New Game" Then
                Set_new_game()
            Else
                Set_game()
            EndIf
        Case $msg = $Button_4
            $Ginfo = GUICtrlRead($Combo_2)
            If $Ginfo = "New Game" Or $Ginfo = "" Then
           ; nada
            Else
                FileDelete($Gloc & $Ginfo & ".ini")
                Set_Game_List()
            EndIf
        Case $msg = $Radio_6
            GUICtrlSetState($Radio_7, $GUI_UNCHECKED)
            GUICtrlSetState($Radio_9, $GUI_UNCHECKED)
            GUICtrlSetState($Input_8, $GUI_ENABLE)
            GUICtrlSetState($Radio_6, $GUI_CHECKED)
            GUICtrlSetState($Input_8, $GUI_DROPACCEPTED)
        Case $msg = $Radio_7
            GUICtrlSetState($Radio_6, $GUI_UNCHECKED)
            GUICtrlSetState($Radio_9, $GUI_UNCHECKED)
            GUICtrlSetState($Input_8, $GUI_ENABLE)
            GUICtrlSetState($Radio_7, $GUI_CHECKED)
            GUICtrlSetState($Input_8, $GUI_DROPACCEPTED)
        Case $msg = $Radio_9
            GUICtrlSetState($Radio_6, $GUI_UNCHECKED)
            GUICtrlSetState($Radio_7, $GUI_UNCHECKED)
            GUICtrlSetState($Input_8, $GUI_DISABLE)
            GUICtrlSetState($Radio_9, $GUI_CHECKED)
        Case $msg = $Button_29
            Get_Area()
        Case $msg = $Button_30
            Get_Colors()
        Case $msg = $Button_31
            Clear_Colors()
        Case $msg = $Button_32
            Save_Game()
        Case $msg = $Button_33
            Set_Run()
        Case Else
       ;;;
    EndSelect
WEnd
Exit

; --------------------- Functions -----------------------

Func Set_new_game()
    If FileExists($Gloc & $Ginfo & ".ini") Then
        MsgBox(262208, "Sorry!", "That File Already Exists!   " & @CRLF & $Gloc & $Ginfo & ".ini   ", 5)
        Return
    EndIf
    $NewG = InputBox("New GameBot", "Please type in a New Game Name ", "", "", 200, 120)
    If $NewG = "" Then Return
    DirCreate($Gloc)
    FileWrite($Gloc & $NewG & ".ini", "")
    GUICtrlSetState($Radio_9, $GUI_CHECKED)
    GUICtrlSetState($Radio_7, $GUI_UNCHECKED)
    GUICtrlSetState($Radio_6, $GUI_UNCHECKED)
    GUICtrlSetData($Input_8, "Type or Drag & Drop  -  URL or Game exe/link")
    GUICtrlSetState($Input_8, $GUI_DISABLE)
    GUICtrlSetData($Input_12, 1)
    GUICtrlSetData($Input_13, 1)
    GUICtrlSetData($Input_14, @DesktopWidth)
    GUICtrlSetData($Input_15, @DesktopHeight)
    GUICtrlSetData($Input_17, 5)
    GUICtrlSetData($Input_18, 1000)
    GUICtrlSetData($Input_19, 1000)
    GUICtrlSetData($Input_20, 5)
    Set_Game_List()
EndFunc ;==>Set_new_game

Func Set_Game_List()
    $FileList = _FileListToArray ($Gloc)
    If (Not IsArray($FileList)) Or (@error = 1) Then
        MsgBox(262208, "Sorry!", "No Files\Folders Found in." & @CRLF & $Gloc & "   ", 5)
        Return
    EndIf
    GUICtrlSetData($Combo_2, "")
    For $x = 1 To $FileList[0]
        GUICtrlSetData($Combo_2, StringTrimRight($FileList[$x], 4) & "|", 1)
    Next
    GUICtrlSetData($Combo_2, "New Game")
EndFunc ;==>Set_Game_List

Func Set_game()
    If Not FileExists($Gloc & $Ginfo & ".ini") Then
        MsgBox(262208, "Sorry!", "That File Does Not Exist!   " & @CRLF & $Gloc & $Ginfo & ".ini   " & @CRLF & 'Please choose "New Game" to Create a New GameBot   ', 5)
        Return
    EndIf
    $Run = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Run", "0")
    If $Run = 0 Then
        GUICtrlSetState($Radio_9, $GUI_CHECKED)
        GUICtrlSetState($Radio_7, $GUI_UNCHECKED)
        GUICtrlSetState($Radio_6, $GUI_UNCHECKED)
        GUICtrlSetData($Input_8, "No Launch")
        GUICtrlSetState($Input_8, $GUI_DISABLE)
        $Launcher = ""
    ElseIf $Run = 1 Then
        GUICtrlSetState($Radio_7, $GUI_UNCHECKED)
        GUICtrlSetState($Radio_9, $GUI_UNCHECKED)
        $Launcher = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Launcher", "Not Found")
        GUICtrlSetState($Input_8, $GUI_ENABLE)
        GUICtrlSetData($Input_8, $Launcher)
        GUICtrlSetState($Radio_6, $GUI_CHECKED)
    ElseIf $Run = 2 Then
        GUICtrlSetState($Radio_6, $GUI_UNCHECKED)
        GUICtrlSetState($Radio_9, $GUI_UNCHECKED)
        $Launcher = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Launcher", "Not Found")
        GUICtrlSetState($Input_8, $GUI_ENABLE)
        GUICtrlSetData($Input_8, $Launcher)
        GUICtrlSetState($Radio_7, $GUI_CHECKED)
    EndIf
; pixel search
    $left = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Left", "None")
    GUICtrlSetData($Input_12, $left)
    $top = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Top", "None")
    GUICtrlSetData($Input_13, $top)
    $right = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Right", "None")
    GUICtrlSetData($Input_14, $right)
    $bottom = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Bottom", "None")
    GUICtrlSetData($Input_15, $bottom)
    $Vary = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Vary", "5")
    GUICtrlSetData($Input_17, $Vary)
    $cwait = IniRead($Gloc & $Ginfo & ".ini", "Settings", "CWait", "0")
    GUICtrlSetData($Input_19, $cwait)
    $wait = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Wait", "1000")
    GUICtrlSetData($Input_18, $wait)
    $Skip = IniRead($Gloc & $Ginfo & ".ini", "Settings", "Skip", "5")
    GUICtrlSetData($Input_20, $Skip)
; colors
    If IniRead($Gloc & $Ginfo & ".ini", "Colors", "1", "") = "" Then
        MsgBox(262208, "Sorry!", "No Colors were Found!   ", 5)
        Return
    EndIf
    $Colors = IniReadSection($Gloc & $Ginfo & ".ini", "Colors")
    For $i = 0 To $Colors[0][0]
        $data[$i] = IniRead($Gloc & $Ginfo & ".ini", "Colors", $i, "")
   ;GUICtrlSetData($Label_[$i], $data[$i])
        GUICtrlSetBkColor($Label_[$i], $data[$i])
        If $i >= 10 Then ExitLoop
    Next
    
EndFunc ;==>Set_game

Func Get_Colors()
    $Ginfo = GUICtrlRead($Combo_2)
    If $Ginfo = "New Game" Or $Ginfo = "" Then
        MsgBox(262208, "Sorry!", "Please Select a Game Name First   ", 5)
        Return
    EndIf
    If GUICtrlRead($Button_30) = "Get Colors" Then
        HotKeySet("{F9}", "set_color")
        ToolTip('Press "F9" to Get the Color under the Mouse, Click "Done" when Finished', 0, 0)
        GUICtrlSetData($Button_30, "Done")
        Return
    Else
        HotKeySet("{F9}")
        ToolTip('')
        GUICtrlSetData($Button_30, "Get Colors")
        MsgBox(262208, "Saved!", "The Colors have been Saved to " & @CRLF & $Gloc & $Ginfo & ".ini" & "   ", 5)
        $Count = 0
    EndIf
EndFunc ;==>Get_Colors

Func set_color()
    $Ginfo = GUICtrlRead($Combo_2)
    $pos = MouseGetPos()
    $CHex = Hex(PixelGetColor($pos[0], $pos[1]), 6)
    $Count = $Count + 1
    If $Count > 10 Then
        MsgBox(262208, "Sorry!", "Colors pre-selected is Full!    ", 5)
        Return
    Else
        IniWrite($Gloc & $Ginfo & ".ini", "Colors", $Count, "0x" & $CHex)
        GUICtrlSetBkColor($Label_[$Count], "0x" & $CHex)
    EndIf
EndFunc ;==>set_color

Func Clear_Colors()
    For $x = 1 To 10
        GUICtrlSetBkColor($Label_[$x], 0xECE9D8)
    Next
    $Count = 0
EndFunc ;==>Clear_Colors

Func Get_Area()
    $Ginfo = GUICtrlRead($Combo_2)
    If $Ginfo = "New Game" Or $Ginfo = "" Then
        MsgBox(262208, "Sorry!", "Please Select a Game Name First   ", 5)
        Return
    EndIf
    $Count = 0
    If GUICtrlRead($Button_29) = "Get Area" Then
        HotKeySet("{F9}", "set_Area")
        ToolTip('Press "F9" to Get the Area under the Mouse Left-Top-Right-Bottom, Click "Done" when Finished', 0, 0)
        GUICtrlSetData($Button_29, "Done")
        Return
    Else
        HotKeySet("{F9}")
        ToolTip('')
        GUICtrlSetData($Button_29, "Get Area")
        $Count = 0
    EndIf
EndFunc ;==>Get_Area

Func set_Area()
    $Count = $Count + 1
    $Mpos = MouseGetPos()
    If $Count = 1 Then GUICtrlSetData($Input_12, $Mpos[0])
    If $Count = 2 Then GUICtrlSetData($Input_13, $Mpos[1])
    If $Count = 3 Then GUICtrlSetData($Input_14, $Mpos[0])
    If $Count = 4 Then GUICtrlSetData($Input_15, $Mpos[1])
    If $Count >= 4 Then $Count = 0
EndFunc ;==>set_Area

Func Save_Game()
    $Ginfo = GUICtrlRead($Combo_2)
    If $Ginfo = "New Game" Or $Ginfo = "" Then
        MsgBox(262208, "Sorry!", "Please Select a Game Name First   ", 5)
        Return
    EndIf
    If Not FileExists($Gloc & $Ginfo & ".ini") Then
        MsgBox(262208, "Sorry!", "That File Does Not Exist!   " & @CRLF & $Gloc & $Ginfo & ".ini   " & @CRLF & 'Please choose "New Game" to Create a New GameBot   ', 5)
        Return
    EndIf
    $Run = "L"
    If BitAND(GUICtrlRead($Radio_9), $GUI_CHECKED) = $GUI_CHECKED Then
        $Run = 0
        $Launcher = "No Launch"
    ElseIf BitAND(GUICtrlRead($Radio_7), $GUI_CHECKED) = $GUI_CHECKED Then
        $Run = 2
        $Launcher = GUICtrlRead($Input_8)
    ElseIf BitAND(GUICtrlRead($Radio_6), $GUI_CHECKED) = $GUI_CHECKED Then
        $Run = 1
        $Launcher = GUICtrlRead($Input_8)
    EndIf
    If $Run = "L" Or $Launcher = "" Then
        MsgBox(262208, "Sorry!", "Run Select Error   ", 5)
        MsgBox(0, $Run, $Launcher)
        Return
    EndIf
    $left = GUICtrlRead($Input_12)
    $top = GUICtrlRead($Input_13)
    $right = GUICtrlRead($Input_14)
    $bottom = GUICtrlRead($Input_15)
    $Vary = GUICtrlRead($Input_17)
    $wait = GUICtrlRead($Input_18)
    $cwait = GUICtrlRead($Input_19)
    $Skip = GUICtrlRead($Input_20)
    If $Run = 0 Then
        IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Run", $Run)
        IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Launcher", "No Launch")
    Else
        IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Run", $Run)
        IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Launcher", $Launcher)
    EndIf
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Left", $left)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Top", $top)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Right", $right)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Bottom", $bottom)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Vary", $Vary)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "CWait", $cwait)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Wait", $wait)
    IniWrite($Gloc & $Ginfo & ".ini", "Settings", "Skip", $Skip)
    MsgBox(262208, "Done!", "File appears to be written Correctly!   ", 5)
EndFunc ;==>Save_Game

Func Set_Run()
    $Ginfo = GUICtrlRead($Combo_2)
    If $Ginfo = "New Game" Or $Ginfo = "" Then
        MsgBox(262208, "Sorry!", "Please Select a Game Name First   ", 5)
        Return
    EndIf
    If Not FileExists($Gloc & $Ginfo & ".ini") Then
        MsgBox(262208, "Sorry!", "That File Does Not Exist!   " & @CRLF & $Gloc & $Ginfo & ".ini   " & @CRLF & 'Please choose "New Game" to Create a New GameBot   ', 5)
        Return
    EndIf
    If IniRead($Gloc & $Ginfo & ".ini", "Colors", "1", "") = "" Then
        MsgBox(262208, "Sorry!", "No Colors were Found!   ", 5)
        Return
    EndIf
    If $Run = 1 Then
        Run(@ComSpec & " /c Start " & $Launcher, "", @SW_HIDE)
    ElseIf $Run = 2 Then
        $Launched = FileGetShortName($Launcher)
        Run(@ComSpec & " /c Start " & $Launched, "", @SW_HIDE)
    EndIf
    GUISetState(@SW_MINIMIZE, $Gamebot)
    ToolTip('Press F9 to Start Game', 0, 0)
    _ReduceMemory()
    HotKeySet("{F9}", "_start")
EndFunc ;==>Set_Run

Func _start()
    $Colors = IniReadSection($Gloc & $Ginfo & ".ini", "Colors")
    For $i = 0 To $Colors[0][0]
        $data[$i] = IniRead($Gloc & $Ginfo & ".ini", "Colors", $i, "")
        If $i >= 10 Then ExitLoop
    Next
    $pause = Not $pause
    While $pause
        ToolTip('GameBot is "Running"..   Press F9 to Quit', 0, 0)
        $t = 0
        Do
            $t = $t + 1
            If $t > 10 Then ExitLoop
            Sleep($cwait)
            $Cpos = PixelSearch($left, $top, $right, $bottom, $data[$t], $Vary, $Skip)
        Until Not @error
        If $t > 10 Then ContinueLoop
        MouseClick("left", $Cpos[0], $Cpos[1], 1, 0)
   ;MouseMove($left, $top)
        Sleep($wait)
    WEnd
    ToolTip('')
    GUISetState(@SW_RESTORE, $Gamebot)
    HotKeySet("{F9}")
EndFunc ;==>_start

Func _ReduceMemory()
    Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    Return $ai_Return[0]
EndFunc ;==>_ReduceMemory

Func Terminate()
    Exit
EndFunc ;==>Terminate

but not sure were to begin

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

well first step is color picking and with misc.au3 theres a func

_choosecolor that can be some helpbut it really looks like ur making it reallllly complicated, whats with all the buttons?

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I want to make a program that you set the pixel and the mouse clicks on it, but with this script im not sure were I should start not to good with GUI. I got this so far but I don't know the commands I should use.

but not sure were to begin

Your question is not very well explained.

If you simply want a program where you "set the pixel" meaning you set the x,y coordinates then you can do it in one line (minus declaring the x and y variables):

MouseClick('left',$x, $y,1,0)

If you mean set a particular color by, "set the pixel", and you want it to search for that color and click on it then you could do it like this:

While 1
$coord = PixelSearch(10, 10, 800, 580, $searchcolor)
If IsArray($coord) = 1 Then
    MouseClick('left',$coord[0], $coord[1],1,0)
EndIf
WEnd
Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

well he wants to make a GUI and all that its simple i mean make a small gui

with a button u press it it calls _choosecolor, sets that color and yeah just use ur pixel search, but also probaly search a certain area for a pixel so theres going to be a few functions not just pixel searching the entire screen

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

well he wants to make a GUI and all that its simple i mean make a small gui

with a button u press it it calls _choosecolor, sets that color and yeah just use ur pixel search, but also probaly search a certain area for a pixel so theres going to be a few functions not just pixel searching the entire screen

I guess until he actually explains what he wants it is difficult to help him.

I mean, we are already having to infer that "set the pixel" = "set a color for a pixel and have a script search for the color."

And the small pixelsearch loop I wrote doesnt search the entire screen. It searches a preset area. (Just ripped from one of the scripts I have open right now)

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

yes i know but he wants to basicaly make a bot for all games that will ull be able to choose different functions and then do different stuff, im actualy going to do this i know there are alot already made im still bored and feel like doin it

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

well to make it easy, I find the pixel I want, say red with the autoit info tool, then tell the script to search for the red either the exact color of it, or a variation of the color, then it clicks on that color.

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

Dim $remmber,$keeper
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{end}", "Terminate")
HotKeySet("{f1}", "Dance")
HotKeySet("{f2}", "Steps")
HotKeySet("{f3}", "Forget")
ToolTip("F1 to move.   F2 to record.   F3 to erase.   End to exit.",0,0)
While 1
    Sleep(0x000001)
WEnd


Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func Forget()
   $remmber="" 
EndFunc


Func Steps()
$pos = MouseGetPos()
$remmber=$remmber&$pos[0]&","&$pos[1]&","
$keeper=StringSplit ($remmber, ",")
EndFunc

Func Dance()
HotKeySet("{f1}")
if $remmber="" then 
else
for $x = 1 to $keeper[0] -1
MouseClick("left",$keeper[$x], $keeper[$x + 1], 1,0)
$x = $x +1
next
endif
HotKeySet("{f1}", "Dance")
EndFunc

this can be modified easily...


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

Wrote this real quick. It has a GUI so you can get some experience with those, it has an input box for the color you want and you can use the "ColorSelect" button to select a color as well.

Enjoy

-Simucal

#include <guiconstants.au3>
#include <misc.au3>

Global $SearchState = "No"

HotkeySet("{Space}", "StopSearch")

$PixelSearchForm = GUICreate("Pixel Click", 309, 151, 192, 125)
$SearchColorInput = GUICtrlCreateInput("", 10, 48, 89, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlCreateLabel('Manually type your color code here or click "Select Color"', 10, 24, 276, 17)
GUICtrlCreateLabel("Hit [Space] to stop Auto Clicker", 150, 117, 276, 17)
$Status = GUICtrlCreateLabel("PixelSearch: Off",10,95,137,17)
$SelectButton = GUICtrlCreateButton("Select Color", 192, 48, 97, 25)
$RunButton = GUICtrlCreateButton("Run PixelSearch Clicker", 10, 112, 137, 25)
GUISetState(@SW_SHOW)

While 1
        While $SearchState = "Yes"
            $coord = PixelSearch(0,0,@DesktopWidth,@DesktopHeight,$SearchColor)
            If IsArray($coord) = 1 Then
                MouseClick('left',$coord[0], $coord[1],1,0)
            EndIf
        WEnd
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $SelectButton
        $SearchColorValue = _ChooseColor(2)
        GuiCtrlSetData($SearchColorInput, $SearchColorValue)
    Case $msg = $RunButton
        $SearchState = "Yes"
        GuiCtrlSetData($Status, "PixelSearch: On")
        $SearchColor = GuiCtrlRead($SearchColorInput)
    EndSelect
WEnd
Exit

Func StopSearch()
    $SearchState = "No"
    GuiCtrlSetData($Status, "PixelSearch: Off")
EndFunc

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Dim $remmber,$keeper
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{end}", "Terminate")
HotKeySet("{f1}", "Dance")
HotKeySet("{f2}", "Steps")
HotKeySet("{f3}", "Forget")
ToolTip("F1 to move.   F2 to record.   F3 to erase.   End to exit.",0,0)
While 1
    Sleep(0x000001)
WEnd
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func Forget()
   $remmber="" 
EndFunc
Func Steps()
$pos = MouseGetPos()
$remmber=$remmber&$pos[0]&","&$pos[1]&","
$keeper=StringSplit ($remmber, ",")
EndFunc

Func Dance()
HotKeySet("{f1}")
if $remmber="" then 
else
for $x = 1 to $keeper[0] -1
MouseClick("left",$keeper[$x], $keeper[$x + 1], 1,0)
$x = $x +1
next
endif
HotKeySet("{f1}", "Dance")
EndFunc

this can be modified easily...

can you explain how I would edit this, just to set pixel and click on it

Thanks in advance

Share this post


Link to post
Share on other sites

I just wrote you an example script?


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

I just wrote you an example script?

sorry didn't see, god your smart lol thanks so much :think::(;)

edited: how would I set it to something other then desktop give it the right path,,

re-edited :) I also would like to know how I would do this, say I found the pixel, how could I add a command that will click the pixel with OUT using the GUI script, so say

this is my script

this is my code
.....................
.....................
.....................
.....................
and this is my pixel = 0xB2B4BF
how would I tell it to click that pixel with Out the GUI

maybe

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
If Not @error Then
    MouseClick("left")
EndIf

or something like that

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

hump


Thanks in advance

Share this post


Link to post
Share on other sites

hump

rofl I meant bump :think:


Thanks in advance

Share this post


Link to post
Share on other sites

I'll give you a heads up here, if it's for counter-Strike it won't work. At least the one I made... If your interested in the one I made let me know... It should have worked in theroy with the color models.. but it need a hitbox sorta thing.. Ie. you set how big a area it would search for, but this area would move with your redical, not sure how to go about doing that. Also VAC2 has a way to detect ControlSends I believe.. So they may need to be in RAW.

Of couse this only if your doing this for counter-Strike..


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

I'll give you a heads up here, if it's for counter-Strike it won't work. At least the one I made... If your interested in the one I made let me know... It should have worked in theroy with the color models.. but it need a hitbox sorta thing.. Ie. you set how big a area it would search for, but this area would move with your redical, not sure how to go about doing that. Also VAC2 has a way to detect ControlSends I believe.. So they may need to be in RAW.

Of couse this only if your doing this for counter-Strike..

lol when I bought my pc it came with counter strike never palyed it still in its case, any ways no its not a aim bot I made many other postes and everything I asked for, people said why are you making a aimbot, but its not, all I need is a porgram that can work with pixel finding and mouse clicking, so I need a script

that can open up my program, I set the pixels and it will click on the pixels, sounds pretty easy, well it is i bet but im not to good with pixels atleast not with autoit, but autoit is easy so I guess I do suck at pixels lol,

can someone make me a script that sort of looks like this pretty please with 1000 cherrys on top :think:

WinSetState("MyProgram", "", @SW_MAXIMIZE)
sleep(2000)
$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 )
If Not @error Then
    MouseClick("left")
EndIf
EndIf
Wend

so what I am doing is maximizing my program, telling to search for this pixel 0xFF0000, then click mouse left, atleast that's what is is soppose to do, now you've seen it all a guy trying write a script when hes been up all night :">

edited; althoguh this isn't a aimbot maybe your counter strike one might help if it tell it to click on a pixel

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

WinSetState("MyProgram", "", @SW_MAXIMIZE)

WinWaitActive("MyProgram")

While 1

$coord = PixelSearch( 0, 0, 20, 300, 0xFF0000 ) ; note that 0,0,20,300 is the search area you have setup.. and it is a narrow strip

If IsArray($coord) = 1 Then

MouseClick('left',$coord[0], $coord[1],1,0)

EndIf

WEnd

Edited by Simucal

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Hope this can help a bit. Gui is basic but it does what it needs to do. It also makes a Ini.

; Made by Jeff H. Beta .3v

#include <GuiConstants.au3>
#NoTrayIcon

Dim $color = 0x00FFCC
Dim $var = 15

Opt("GUICloseOnESC", 0)
Opt("OnExitFunc", "_ScriptClose")
Opt("GuiOnEventMode", 1)

WinActive ( "Counter-Strike Source")


$hWnd = WinGetHandle("Counter-Strike Source")
If @error Then
    MsgBox(16, Random(150, 10000, 1), "Counter-Strike Source process not found. Will exit now.")
    _ScriptClose()
EndIf

$gui = GUICreate(Random(100, 10000, 1), 135, 60, (@DesktopWidth-135)/2, (@DesktopHeight-75)/2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS - $WS_MAXIMIZEBOX - $WS_SIZEBOX)
GUISetOnEvent($GUI_EVENT_CLOSE, "_ScriptClose")

$colorlabel = GUICtrlCreateLabel("Hex Color:", 5, 12)
$colorbox = GUICtrlCreateInput(IniRead("Settings.ini", "Settings", "color", "00FFCC"), 60, 10, 70, 20)
GUICtrlSetOnEvent(-1, "_SetColor")
_SetColor()

$varlabel = GUICtrlCreateLabel("Variation:", 5, 37)
$variation = GUICtrlCreateInput(IniRead("Settings.ini", "Settings", "variation", 15), 60, 35, 70, 20)
GUICtrlSetOnEvent(-1, "_SetVariation")
$varupdown = GUICtrlCreateUpdown($variation)
GUICtrlSetOnEvent(-1, "_SetVariation")
_SetVariation()

GUISetState()

$timer = TimerInit()

While WinExists($hWnd)
    If TimerDiff($timer) >= 10000 Then
        _SetVariation()
        _SetColor()
        WinSetTitle($gui, "", Random(100, 10000, 1))
        $timer = TimerInit()
    EndIf
    
    If Not WinActive($hWnd) Then
        Sleep(100)
        ContinueLoop;keeps the aimbot from aiming while the game is not the active window
    EndIf
    
    If _IsPressed(0x01) Then
        _Aim()
    EndIf
    
    Sleep(10)
WEnd

MsgBox(64, WinGetTitle($gui), "Game exited, program will now terminate.", 15)
_ScriptClose()

Func _Aim()
    Local $PixSearch = PixelSearch(100, 100, 100, 100, $color, $var, 2)
;Local $PixSearch = PixelSearch(412, 284, 612, 484, $color, $var, 2);Box
    If Not @error And IsArray($PixSearch) Then;make sure to check that $PixSearch is an array otherwise $PixSearch[0] will throw an error
    ;MouseClick("Left", $PixSearch[0], $PixSearch[1], 1, 1)
        MouseMove($PixSearch[0], $PixSearch[1], 0)
    sleep(100)
    EndIf
EndFunc

Func _SetColor()
    $color = "0x" & GUICtrlRead($colorbox)
    IniWrite("Settings.ini", "Settings", "color", GUICtrlRead($colorbox))
EndFunc

Func _SetVariation()
    $var = GUICtrlRead($variation)
    IniWrite("Settings.ini", "Settings", "variation", GUICtrlRead($variation))
EndFunc

Func _IsPressed($hexKey)
    Local $ret = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey)
    If Not @error And BitAND($ret[0], 0x8000) = 0x8000 Then
        Return True
    Else
        Return False
    EndIf
EndFunc

Func _ScriptClose()
    Exit
EndFunc

It only looks for the hex-color when the mouse button is pushed. Then i't moves to that color.


[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

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  
Followers 0