DelioPontes Posted July 20, 2014 Posted July 20, 2014 (edited) Hi all! I need your help again... I tried to use this example below to stop a loop with a hotkey'?do=embed' frameborder='0' data-embedContent>> But for some reason the script give a error...: "Func" statement has no matching "EndFunc".:Func _Stop() Can someone help me showing me what Im doing wrong? Thanks in advance! The code until now: expandcollapse popup#include <MsgBoxConstants.au3> Example() Func Example() Local $sAnswer = InputBox("BUZ OFF!!!", @CRLF & "Project name?", "" , "", 200,150) & "" If @error = 1 Then Exit MsgBox($MB_SYSTEMMODAL, "BUZ OFF!!!", "OK. Bye!" & @CRLF & @CRLF & "Closing in 5 seconds...", 5) if not WinExists($sAnswer) then Exit Msgbox(0,"BUZ OFF!!","Sorry, no Project found!" & @CRLF & @CRLF & "Closing in 5 seconds...", 5) $count = -1 HotKeySet("{ESC}", "_Stop") Global $Stop = 0 WinActivate ($sAnswer) Do Local $hWnd = WinWait($sAnswer) WinSetState($hWnd, "", @SW_SHOWNORMAL) if WinExists("Colorize scan"& "") then WinWaitClose("Colorize scan"& "") endif if WinExists("Saving shared data...") then WinWaitClose("Saving shared data...") EndIf if WinExists("Saving shared data... (Not Responding)") then WinWaitClose("Saving shared data... (Not Responding)") EndIf IF WinExists($sAnswer) Then WinActivate ($sAnswer) Send("^s") $count += 1 EndIf if WinExists("Share Changes") then WinActivate ("Share Changes") ControlClick("Share Changes", "", "[CLASS:Button; INSTANCE:1]") $count += 1 endif if WinExists("SCENE","Saving shared data failed! Error Code: 18.") then WinActivate ("SCENE","Saving shared data failed! Error Code: 18.") ControlClick("SCENE", "", "[CLASS:Button; INSTANCE:1]") $count += 1 endif if WinExists("SCENE","Saving shared data failed! Error Code: 25.") then WinActivate ("SCENE","Saving shared data failed! Error Code: 25.") ControlClick("SCENE", "", "[CLASS:Button; INSTANCE:1]") EndIf Until $Stop = 1 or WinExists("SCENE", "Successfully saved shared data to revision" & "") Msgbox(0,"BUZ OFF!!", @CRLF & " Number of automatic clicks:" & " " & $Count & @CRLF & @CRLF & "Version 1.0") Func _Stop() $Stop = 1 EndFunc Exit Edited July 20, 2014 by Melba23 Added code tags
Geir1983 Posted July 20, 2014 Posted July 20, 2014 Please post in code tags in the future.. Your problem is the first lines, you call the function Example and then defines the function, but it has no matching end func, further you then declare another function inside this function. As i see it you can just remove these two lines as they make no sense. Example() Func Example""
smsabbir480 Posted July 20, 2014 Posted July 20, 2014 I also need help.Because i am facing this similar problem too.
Bert Posted July 20, 2014 Posted July 20, 2014 I strongly suggest seeing how both of you are new to coding to take AutoIt 1 2 3. You can find it in the Examples section in the forum. The Vollatran project My blog: http://www.vollysinterestingshit.com/
232showtime Posted July 20, 2014 Posted July 20, 2014 (edited) Hi all! I need your help again... I tried to use this example below to stop a loop with a hotkey'?do=embed' frameborder='0' data-embedContent>> But for some reason the script give a error...: "Func" statement has no matching "EndFunc".: Func _Stop() Can someone help me showing me what Im doing wrong? Thanks in advance! The code until now: expandcollapse popup#include <MsgBoxConstants.au3> Example() Func Example() Local $sAnswer = InputBox("BUZ OFF!!!", @CRLF & "Project name?", "" , "", 200,150) & "" If @error = 1 Then Exit MsgBox($MB_SYSTEMMODAL, "BUZ OFF!!!", "OK. Bye!" & @CRLF & @CRLF & "Closing in 5 seconds...", 5) if not WinExists($sAnswer) then Exit Msgbox(0,"BUZ OFF!!","Sorry, no Project found!" & @CRLF & @CRLF & "Closing in 5 seconds...", 5) $count = -1 HotKeySet("{ESC}", "_Stop") Global $Stop = 0 WinActivate ($sAnswer) Do Local $hWnd = WinWait($sAnswer) WinSetState($hWnd, "", @SW_SHOWNORMAL) if WinExists("Colorize scan"& "") then WinWaitClose("Colorize scan"& "") endif if WinExists("Saving shared data...") then WinWaitClose("Saving shared data...") EndIf if WinExists("Saving shared data... (Not Responding)") then WinWaitClose("Saving shared data... (Not Responding)") EndIf IF WinExists($sAnswer) Then WinActivate ($sAnswer) Send("^s") $count += 1 EndIf if WinExists("Share Changes") then WinActivate ("Share Changes") ControlClick("Share Changes", "", "[CLASS:Button; INSTANCE:1]") $count += 1 endif if WinExists("SCENE","Saving shared data failed! Error Code: 18.") then WinActivate ("SCENE","Saving shared data failed! Error Code: 18.") ControlClick("SCENE", "", "[CLASS:Button; INSTANCE:1]") $count += 1 endif if WinExists("SCENE","Saving shared data failed! Error Code: 25.") then WinActivate ("SCENE","Saving shared data failed! Error Code: 25.") ControlClick("SCENE", "", "[CLASS:Button; INSTANCE:1]") EndIf Until $Stop = 1 or WinExists("SCENE", "Successfully saved shared data to revision" & "") Msgbox(0,"BUZ OFF!!", @CRLF & " Number of automatic clicks:" & " " & $Count & @CRLF & @CRLF & "Version 1.0") Func _Stop() $Stop = 1 EndFunc Exit I also need help.Because i am facing this similar problem too. Maybe this one can help: #include <MsgBoxConstants.au3> HotKeySet("{ESC}", "_Stop") Example() Func Example() ;script goes here EndFunc Func _Stop() $Stop = 1 EndFunc Edit: and try to read the help file... Edited July 20, 2014 by 232showtime ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon.
DelioPontes Posted July 20, 2014 Author Posted July 20, 2014 Please post in code tags in the future.. Your problem is the first lines, you call the function Example and then defines the function, but it has no matching end func, further you then declare another function inside this function. As i see it you can just remove these two lines as they make no sense. Example() Func Example"" Thanks a lot for help!!! Its working fine now! And I will keep in mind code tags!
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