snakeman2058 Posted June 15, 2008 Posted June 15, 2008 HotKeySet("{f7}", "tp") $color = 0x800080 $shadevar = 25 $step = 1 Func Tp() $size = WinGetClientSize ( "runescape"); <--- The Window Tool is Awesome. $Pix = PixelSearch( ($size[1])/2, ($size[0])/2, ($size[1])/2, ($size[0])/2, 0xff0000, 25, 1) Opt( "MouseCoordMode", 2) Sleep( 2000 ) MouseClick( "Left", $Pix[0], $Pix[1]) EndFunc while 1 Sleep( 5000 ) WEnd i get this: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\AutoIt3\Test.au3" C:\Program Files\AutoIt3\Test.au3 (19) : ==> Subscript used with non-Array variable.: $Pix = PixelSearch( ($size[1])/2, ($size[0])/2, ($size[1])/2, ($size[0])/2, 0xff0000, 25, 1) $Pix = PixelSearch( ($size^ ERROR >Exit code: 1 Time: 4.895 please help!
narayanjr Posted June 15, 2008 Posted June 15, 2008 HotKeySet("{f7}", "tp") $color = 0x800080 $shadevar = 25 $step = 1 Func Tp() $size = WinGetClientSize ( "runescape"); <--- The Window Tool is Awesome. if isArray($size) then $Pix = PixelSearch( ($size[1])/2, ($size[0])/2, ($size[1])/2, ($size[0])/2, 0xff0000, 25, 1) Opt( "MouseCoordMode", 2) Sleep( 2000 ) MouseClick( "Left", $Pix[0], $Pix[1]) else msgbox(0,"","Didnt find window") endif EndFunc while 1 Sleep( 5000 ) WEnd
bf2forlife Posted June 15, 2008 Posted June 15, 2008 (edited) EDIT: Nothing Edited June 15, 2008 by bf2forlife
snakeman2058 Posted June 15, 2008 Author Posted June 15, 2008 HotKeySet("{f7}", "tp") $color = 0x800080 $shadevar = 25 $step = 1 Func Tp() $size = WinGetClientSize ( "RuneScape"); <--- The Window Tool is Awesome. if isArray($size) then $Pix = PixelSearch( ($size[1])/2, ($size[0])/2, ($size[1])/2, ($size[0])/2, 0xff0000, 25, 1) Opt( "MouseCoordMode", 2) Sleep( 2000 ) MouseClick( "Left", $Pix[0], $Pix[1]) else msgbox(0,"","Didnt find window") endif EndFunc while 1 Sleep( 5000 ) WEnd turns out i had the window wrong but now when i run it i get C:\Program Files\AutoIt3\Test.au3 (23) : ==> Subscript used with non-Array variable.: MouseClick( "Left", $Pix[0], $Pix[1]) MouseClick( "Left", $Pix^ ERROR >Exit code: 1 Time: 4.709
sandin Posted June 15, 2008 Posted June 15, 2008 (edited) if you get that error it means your script did not found pixel color you were looking for. HotKeySet("{F7}", "tp") $color = 0x800080 $shadevar = 25 $step = 1 $client_name = "RuneScape" Func Tp() if WinExists($client_name) Then WinActivate($client_name) $size = WinGetClientSize ($client_name); <--- The Window Tool is Awesome. $handle = WinGetHandle($client_name) Opt("PixelCoordMode", 2) $Pix = PixelSearch( 0, 0, $size[0], $size[1], $color, 25, 1, $handle) if @error Then MsgBox(0, "", "didn't found your color in the client") Else Opt( "MouseCoordMode", 2) Sleep( 2000 ) MouseClick( "Left", $Pix[0], $Pix[1]) EndIf else msgbox(0,"","Didn't found client's window") endif EndFunc while 1 Sleep( 5000 ) WEnd edit: Your coordinates wasn't correct, now the script searches for a desired pixel color in the client's window area. Edited June 15, 2008 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
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