Jump to content

Help for making a colourbot


Recommended Posts

@ technotronix

Is het een Flash Game waarmee je dat probeert?

Of een echt Online-Game?

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

Yay! I was bored. Here you go :)

$Pause = 500
$DllUser32 = DllOpen('user32.dll')
HotKeySet('{ESC}', 'Quit')
MsgBox(0,'Select a Color','Put the mouse over the color then press {F1} to select it.')
$PauseOff = 0
While 1
    If _IsPressed(112) Then
        $Color = PixelGetColor(MouseGetPos('left'),MouseGetPos('top'))
        MsgBox(0,'ColorClicker','To toggle play and pause press {F2}.')
    EndIf
    If $PauseOff And _IsPressed(113) Then
        $PauseOff = 0
        TrayTip('ColorCliker','Pause is ON',1)
        While _IsPressed(113)
        WEnd
    ElseIf _IsPressed(113) Then
        $PauseOff = 1
        TrayTip('ColorCliker','Pause is OFF',1)
        While _IsPressed(113)
        WEnd
    EndIf
    If $PauseOff And $Color = PixelGetColor(MouseGetPos('left'),MouseGetPos('top')) Then
        MouseClick('left')
        Sleep($Pause)
    EndIf
WEnd
Func _IsPressed($hexKey)
   Local $aR
   $aR = DllCall($DllUser32, "int", "GetAsyncKeyState", "int", $hexKey)
   If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
      Return 1
   Else
      Return 0
   EndIf
EndFunc  ;==>_IsPressed
Func quit()
    $ans = MsgBox(4,'ColorClicker','Are you sure you want to quit?')
    If $ans <> 7 Then
        DllClose($DllUser32)
        Exit
    EndIf
EndFunc

Change the $Pause variable as you like. It is the break between clicks in miliseconds.

Edited by GotX
Link to comment
Share on other sites

Thanks for this dude :) now tell me how to run this :$

If you've downloaded AutoIt all you need to do is open a text document paste the code in and save it as an .au3 file.

Autoit can run those files directly or you can compile it into a .exe file

Edited by GotX
Link to comment
Share on other sites

ok when i saved it to the exe. and want to start it, it asks me to select a colour, i do than i click ok, but the game doesnt run >_< stuk :)

Oh sorry for not clarifying... you click OK first then hover your mouse over the color then press F1 to get the color. Then click OK on the pop up and press F2 to run and pause and ESC to exit.

By the way... this is the one that clicks when your mouse is over the color... it doesn't follow the color around the screen

Edited by GotX
Link to comment
Share on other sites

Alright i changed it around a bit and here it is...

Numpad 7 (Home) -> Exit Script

Numpad 8 (up arrow) -> Start/Pause

Numpad 9 (Pgup) -> select color

$Pause = 500
$DllUser32 = DllOpen('user32.dll')
HotKeySet('{NUMPAD7}', 'Quit')
MsgBox(0,'Select a Color','Put the mouse over the color then press 9 (PgUp) to select it. (Close this dialog first)')
$PauseOff = 0
$win = 0
While 1
    If _IsPressed(105) Then
        $Color = PixelGetColor(MouseGetPos('left'),MouseGetPos('top'))
    EndIf
    If $PauseOff And _IsPressed(104) Then
        $PauseOff = 0
        While _IsPressed(104)
        WEnd
    ElseIf _IsPressed(104) Then
        $PauseOff = 1
        While _IsPressed(104)
        WEnd
    EndIf
    If $PauseOff And $Color = PixelGetColor(MouseGetPos('left'),MouseGetPos('top')) Then
        MouseClick('left')
        Sleep($Pause)
    EndIf
WEnd
Func _IsPressed($hexKey)
   Local $aR
   $aR = DllCall($DllUser32, "int", "GetAsyncKeyState", "int", $hexKey)
   If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then
      Return 1
   Else
      Return 0
   EndIf
EndFunc  ;==>_IsPressed
Func quit()
    DllClose($DllUser32)
    Exit
EndFunc
Edited by GotX
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...