Zompy Posted January 18, 2009 Share Posted January 18, 2009 Hey, i've been testing the search pixel function etc, but i can't find out if you find a pixel how to click it, how to do that? Thanks alot Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 18, 2009 Moderators Share Posted January 18, 2009 Hey, i've been testing the search pixel function etc, but i can't find out if you find a pixel how to click it, how to do that?Thanks alotPixelSearch returns the x and y coords of the color found in an Array (if found at all, be sure to check @error). You then use MouseClick with those x and y coords. 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. Link to comment Share on other sites More sharing options...
Zompy Posted January 18, 2009 Author Share Posted January 18, 2009 This doesn't work, how should it be $coord = PixelSearch( 0, 0, 0, 0, 0XB28599, 2, 2 ) If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]) EndIf MouseClick("left", $coord) Link to comment Share on other sites More sharing options...
BrettF Posted January 18, 2009 Share Posted January 18, 2009 Try changing the MouseClick line, and move it in with the MsgBox. Heres a big hint: MouseClick ("left", X, Y) Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Zompy Posted January 18, 2009 Author Share Posted January 18, 2009 Need more hints it doesn't work Link to comment Share on other sites More sharing options...
BrettF Posted January 18, 2009 Share Posted January 18, 2009 Well posting no code doesn't tell us whats wrong. My crystal ball is cloudy... Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Pain Posted January 18, 2009 Share Posted January 18, 2009 (edited) $coord = PixelSearch(0, 0, 0, 0, 0xB28599, 2, 2); should be a rectangle, this is zero pixels so maybe try with 0, 0, 1, 1 If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this... MouseClick("left", $coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist EndIf Edited January 18, 2009 by Pain Link to comment Share on other sites More sharing options...
Zompy Posted January 18, 2009 Author Share Posted January 18, 2009 This was the whole code, im going to swin now, ill test it out soon, thanks alot Link to comment Share on other sites More sharing options...
Zompy Posted January 18, 2009 Author Share Posted January 18, 2009 Oh it works, i love you Link to comment Share on other sites More sharing options...
Zompy Posted January 18, 2009 Author Share Posted January 18, 2009 Im trying to let my mouse click the ball, but it doesn't workCurveballSleep(5000) $coord = PixelSearch(275, 580, 750, 275, 0xC8FF, 2, 2); should be a rectangle, this is zero pixels so maybe try with 0, 0, 1, 1 If Not @error Then ; MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this... Mousemove($coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist EndIf Link to comment Share on other sites More sharing options...
BrettF Posted January 18, 2009 Share Posted January 18, 2009 The coordinates don't look right to me. Try this: PixelSearch (275, 275, 750, 580, .....) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Zompy Posted January 19, 2009 Author Share Posted January 19, 2009 Still doesnt work, did you check the game? Link to comment Share on other sites More sharing options...
Zompy Posted January 19, 2009 Author Share Posted January 19, 2009 Still doesnt work, did you check the game? Link to comment Share on other sites More sharing options...
BrettF Posted January 20, 2009 Share Posted January 20, 2009 No I didn't. I have no intention of writing it for you. Also please don't bump your threads more than once every 24 hours. Try some debugging. Use mouse move to move your mouse to each corner of the rectangle. That will give you a visual example of where the rectangle is. Debug. Get AutoIt to tell you the return value/@error/@extended- debug it in other words. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Zompy Posted January 20, 2009 Author Share Posted January 20, 2009 Im sorry, but it just doesnt move at all Link to comment Share on other sites More sharing options...
ofLight Posted January 20, 2009 Share Posted January 20, 2009 $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xB28599, 2, 2); changed to search entire screen instead of only 4 pixels If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this... MouseClick("left", $coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist EndIf There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly Link to comment Share on other sites More sharing options...
Zompy Posted January 20, 2009 Author Share Posted January 20, 2009 $coord = PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0xB28599, 2, 2); changed to search entire screen instead of only 4 pixels If Not @error Then MsgBox(0, "X and Y are:", $coord[0] & "," & $coord[1]); useless, we already knew this... MouseClick("left", $coord[0], $coord[1]); if it's outside the IF and $coord = false we will get a error because $coord[X] doesn't exist EndIf Does that work at your place? Here that doesnt work either Link to comment Share on other sites More sharing options...
Pain Posted January 20, 2009 Share Posted January 20, 2009 See how Curveball Bot or Game Bot - Builder works and see if you can learn something from that. Link to comment Share on other sites More sharing options...
Zompy Posted January 20, 2009 Author Share Posted January 20, 2009 Thanks, but it says error while opening FF.au3 and gamebot builder isnt really pro is it, i want to learn it, not to use a bot... Link to comment Share on other sites More sharing options...
Zompy Posted January 29, 2009 Author Share Posted January 29, 2009 Still need help, Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now