dist7act Posted April 19, 2010 Share Posted April 19, 2010 i am trying to get it 2 press the f1 f2 and f3 keys when a specific pixel is and i keep getting errors here is my sytaxprod thing >"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /prod /AU3Check /in "C:\Program Files (x86)\AutoIt3\Include\Test 1.au3" +>14:05:22 Starting AutoIt3Wrapper v.2.0.1.24 Environment(Language:0409 Keyboard:00000409 OS:WIN_VISTA/Service Pack 2 CPU:X64 OS:X64) >Running AU3Check (1.54.19.0) from:C:\Program Files (x86)\AutoIt3 C:\Program Files (x86)\AutoIt3\Include\Test 1.au3(1,8) : ERROR: syntax error Func _Y) here is my code itself expandcollapse popupFunc _Y) $Y = PixelGetColor(758, 527) $Yd = 0 Select Case $Y = 0xffea8a and $Yd = 0 send("{F1 down}") $Yd = 1 Case $Y <> 0xffea8a and $Yd = 1 send("{F1 up}") EndSwitch endfunc Func _P() $P = PixelGetColor(800, 527) $Pd = 0 Select Case $P = 0xec95ff and $Pd = 0 send("{F2 down}") $Pd = 1 Case $P <> 0xec95ff and $Pd = 1 send("{F2 up}") EndSwitch endfunc Func _G $G = PixelGetColor(838, 531) $Gd = 0 Select Case $G = 0xc8ff87 and $G = 0 send("{F3 down}") $Gd = 1 Case $G <> 0xc8ff87 and $G = 1 send("{F3 up}") EndSwitch endfunc While 1 _Y() _P() _G() Wend Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 19, 2010 Share Posted April 19, 2010 So why don't you just add the missing bracket? What's the question here? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
dist7act Posted April 19, 2010 Author Share Posted April 19, 2010 (edited) So why don't you just add the missing bracket? What's the question here? im new to this be nice i did that and then i ran sytaxprod again expandcollapse popupFunc _Y() $Y = PixelGetColor(758, 527) $Yd = 0 Select Case $Y = 0xffea8a And $Yd = 0 Send("{F1 down}") $Yd = 1 Case $Y <> 0xffea8a And $Yd = 1 Send("{F1 up}") ;### Tidy Error -> "endswitch" is closing previous "select" on line 4 EndSwitch EndFunc ;==>_Y Func _P() $P = PixelGetColor(800, 527) $Pd = 0 Select Case $P = 0xec95ff And $Pd = 0 Send("{F2 down}") $Pd = 1 Case $P <> 0xec95ff And $Pd = 1 Send("{F2 up}") ;### Tidy Error -> "endswitch" is closing previous "select" on line 17 EndSwitch EndFunc ;==>_P Func _G() $G = PixelGetColor(838, 531) $Gd = 0 Select Case $G = 0xc8ff87 And $G = 0 Send("{F3 down}") $Gd = 1 Case $G <> 0xc8ff87 And $G = 1 Send("{F3 up}") ;### Tidy Error -> "endswitch" is closing previous "select" on line 30 EndSwitch EndFunc ;==>_G While 1 _Y() _P() _G() WEnd Edited April 19, 2010 by dist7act Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 19, 2010 Share Posted April 19, 2010 After every function you MUST have parentheses! _Y) should be _Y() _G should be _G() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
dist7act Posted April 19, 2010 Author Share Posted April 19, 2010 After every function you MUST have parentheses! _Y) should be _Y() _G should be _G() ok i fixed it now it doesnt show any sytax errors but it will not excute the key when the color is where it should be expandcollapse popupFunc _Y() $Y = PixelGetColor(758, 527) $Yd = 0 Select Case $Y = 0xffea8a And $Yd = 0 Send("{F1 down}") $Yd = 1 Case $Y <> 0xffea8a And $Yd = 1 Send("{F1 up}") EndSelect EndFunc ;==>_Y Func _P() $P = PixelGetColor(800, 527) $Pd = 0 Select Case $P = 0xec95ff And $Pd = 0 Send("{F2 down}") $Pd = 1 Case $P <> 0xec95ff And $Pd = 1 Send("{F2 up}") EndSelect EndFunc ;==>_P Func _G() $G = PixelGetColor(838, 531) $Gd = 0 Select Case $G = 0xc8ff87 And $G = 0 Send("{F3 down}") $Gd = 1 Case $G <> 0xc8ff87 And $G = 1 Send("{F3 up}") EndSelect EndFunc ;==>_G While 1 _Y() _P() _G() WEnd Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 19, 2010 Share Posted April 19, 2010 $G can't be both 0xc8ff87 and 0 at the same time! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
dist7act Posted April 19, 2010 Author Share Posted April 19, 2010 $G can't be both 0xc8ff87 and 0 at the same time!can u fix the code and show me what you mean? Link to comment Share on other sites More sharing options...
JohnOne Posted April 19, 2010 Share Posted April 19, 2010 This is what AdmiralAlkex means Case $G = 0xc8ff87 And $G = 0 that will never happen I think it should be Case $G = 0xc8ff87 And $Gd = 0 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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