Sign in to follow this  
Followers 0
Frit

Pixel Bot

4 posts in this topic

Hello again, people!

I'm learning a lot of Autoit, but I'm still with some problems.

Like this script:

;hotkeys
HotKeySet("{ESC}", "ExitPrg")

;Gui's objects
GuiCreate("Rot Bot by Frit", 100, 100)
$radio = GuiCtrlCreateRadio("Ativar", 10, 10)

GuiSetstate()

;Getting pixel color
While 1
$rot = PixelGetcolor (985, 398)
Wend

;testing radio to call start
While 1
If GuiCtrlRead ($radio) = 1 Then
Call ("Start")
Wend

;Check if pixel color is 4329988(dec), click there, sleep 10 sec
Func Start()
While 1
If $rot = 4329988 Then
MouseClick ("left", 985, 398)
Sleep (10000)
EndIf
Wend
EndFunc

;exiting
Func ExitPrg()
    Exit
EndFunc

All I want it to do is to Check if the radio is marked, Check if there's the right color in the right place and click there.

It seems to be all ok, but it doesn't works...

Any help will be welcome!

Share this post


Link to post
Share on other sites



Hello again, people!

I'm learning a lot of Autoit, but I'm still with some problems.

Like this script:

;hotkeys
HotKeySet("{ESC}", "ExitPrg")

;Gui's objects
GuiCreate("Rot Bot by Frit", 100, 100)
$radio = GuiCtrlCreateRadio("Ativar", 10, 10)

GuiSetstate()

;Getting pixel color
While 1
$rot = PixelGetcolor (985, 398)
Wend

;testing radio to call start
While 1
If GuiCtrlRead ($radio) = 1 Then
Call ("Start")
Wend

;Check if pixel color is 4329988(dec), click there, sleep 10 sec
Func Start()
While 1
If $rot = 4329988 Then
MouseClick ("left", 985, 398)
Sleep (10000)
EndIf
Wend
EndFunc

;exiting
Func ExitPrg()
    Exit
EndFunc

All I want it to do is to Check if the radio is marked, Check if there's the right color in the right place and click there.

It seems to be all ok, but it doesn't works...

Any help will be welcome!

I would suggest taking a look at the AutoIt tutorials provided for you by some of the users.

[center]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.[/center]

Share this post


Link to post
Share on other sites

If GUICtrlRead($radio) = 1 Then

.. your code goes here ..

EndIf

Just place this in your while and leave the pixelcolor getting out of their, if this is really only what you want. The radio checkbox seems to have a state of 4 when not checked and 1 when it is,.. i'm not 100% sure but its easy to find out with some msgBox's :)

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