Deni Posted April 27, 2009 Share Posted April 27, 2009 (edited) Yo! Im kinda new here ( not really but never posted... Forgot of the site and the program). But now im on again due i heard that my friend started to make scripts with autoit3. So i tought i give it one more chance. But i made a whole good script for a web game ( Impulse.nu ) but i get a error in the middle of the script... It says that C:\Documents and Settings\ERM!!!!!\Mina dokument\Denis Dokument\Impulse.au3 (51) : ==> "Func" statement has no matching "EndFunc".: func para() Heres that part of the script. func para() $para = 0 Then MouseClick("left", 942, 105) Send("http://www.impulse.nu/?sida=stan/stan&bankomat=in&q=") MouseClick("left", 1014, 690, 2) Sleep(300) MouseClick("left", 203, 541) Send(10000); Skriver hur mkt pengar du ska ta ut MouseClick("left", 305, 546) sleep(700) para() EndFunc EndIf Help please never got this prob on autoit2. any ideas how i can fix it ? Thanks Denis Edited April 27, 2009 by Deni Link to comment Share on other sites More sharing options...
Mat Posted April 27, 2009 Share Posted April 27, 2009 (edited) i presume you want: func para() If $para = 0 Then MouseClick("left", 942, 105) Send("http://www.impulse.nu/?sida=stan/stan&bankomat=in&q=") MouseClick("left", 1014, 690, 2) Sleep(300) MouseClick("left", 203, 541) Send(10000); Skriver hur mkt pengar du ska ta ut MouseClick("left", 305, 546) sleep(700) para(); messy, but will work. be careful to add in a hotkey to end the script though, as you are creating an infinite loop here EndIf EndFunc the problem was with your if test, not the function tags. this can get quite confusing!! MDiesel edit: beat melba off the mark, and we ended up with identical scripts too!! edit2: and we both commented on the infinite loop too!! Edited April 27, 2009 by mdiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 27, 2009 Moderators Share Posted April 27, 2009 Deni,You could try changing your code so that the Func...EndFunc and If...EndIf are properly nested:Func para() If $para = 0 Then MouseClick("left", 942, 105) Send("http://www.impulse.nu/?sida=stan/stan&bankomat=in&q=") MouseClick("left", 1014, 690, 2) Sleep(300) MouseClick("left", 203, 541) Send(10000); Skriver hur mkt pengar du ska ta ut MouseClick("left", 305, 546) sleep(700) para() EndIf EndFuncI presume function para() is defined elsewhere and you have some way of exiting this infinite loop? ;-)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Deni Posted April 27, 2009 Author Share Posted April 27, 2009 OKey guys will try. Melba23 i tryed that didint work.. Thanks for fast response too. Link to comment Share on other sites More sharing options...
Deni Posted April 27, 2009 Author Share Posted April 27, 2009 (edited) Sry for bump but u guys maybe wouldent see that i have posted again ( edited ) I tryed both of your ideas but non of them worked... I will put out the whole script in this post. expandcollapse popup; Gjord av Denis. ; Far ej användas utan mitt tillstand!!!! ; Var inloggad pa impulse global $paused HotKeySet("{F3}", "togglepause") HotKeySet("{ESC}", "terminate") Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc WinWaitActive("Impulse - The battle for power") $para; Pengar pa blatte sprak typ hehe $baxa; Tjuva $snattevilja; LOL ( Energi ) $liv; Som kebab :P Sleep(1000) $lvl = InputBox("Välj Niva Jao!", "baxa1 för juvel butiken ( Mer kommer i nästa version sa sluta klaga" sleep(300) If $lvl = "rob1" Then rob1() EndIf Func snattevilja() $sattevilja = 0 Then WinWaitActive("Impulse - The battle for power") MouseClick("left", 942, 105) Send("http://www.impulse.nu/?sida=stan/frukter&kop=1") Sleep(400) If WinActivate("Internet Explorer", "Du köpte") Then Send("{Enter}") Sleep(300) ElseIf Func para() If $para = 0 Then MouseClick("left", 942, 105) Send("http://www.impulse.nu/?sida=stan/stan&bankomat=in&q=") MouseClick("left", 1014, 690, 2) Sleep(300) MouseClick("left", 203, 541) Send(10000); Skriver hur mkt pengar du ska ta ut MouseClick("left", 305, 546) sleep(700) para() EndIf EndFunc If $lvl = "baxa1" Then baxa1() EndIf EndFunc Func baxa1() While $baxa1 = 1 Sleep(500) MouseClick("left", 942, 105) Send("http://www.impulse.nu/?sida=jobb/olagliga_jobb&q=juvelbutik&p=redo") Sleep(200) If WinActivate("Internet Explorer", "Du har tjänat") sleep(200) Send("{Enter}") sleep(300) Send("{Enter}") Sleep(300) If WinActivate("Internet Explorer", "Du har inte") Then Send("{Enter}") $snattevilja = 0 $baxa = 0 snattevilja() Else Send("{Enter}") Sleep(200) If WinActivate("Internet Explorer", "Du har gatt") Then Send("{Enter}") Sleep(500) EndIf Sleep(500) $finkan = PixelSearch( 175, 430, 191, 501, 0xCA660B, 5, 2 ) $para = $para + 1 If @error Then ;Ofta inget sa klart Else MouseClick("left",$finkan[0],$finkan[1]) Sleep(1000) Send("{ENTER}") Sleep(1000) MouseClick("left", 942, 105) Sleep(100) Send("http://www.impulse.nu/?sida=vakter&q=fri") Sleep(300) Send("{ENTER}") Sleep(500) If WinActivate("Internet Explorer","Du har inte") Then finkan4eva() EndIf If $para = 20 Then Sleep(200) MouseClick("left", 942, 105) Sleep(100) Send("http://www.impulse.nu/?sida=stan/stan&bankomat=in&q=") Sleep(100) Send("{ENTER}") Sleep(100) MouseClick("left", 1014, 690, 2) Sleep(300) MouseClick("left", 203, 541) Sleep(100) Send("10000") Sleep(300) MouseClick("left", 305, 546) If WinActivate("Internet Explorer", "Du har inte") Then Send("{ENTER}") EndIf $para = 0 EndIf EndIf WEnd EndFunc While 1 Sleep(100) WEnd Func finkan4ever() ;Om du inte har rad i finkan, stannar den automatisk i 200 sekunder (sparar CPU kraft o.s.v) Send("{ENTER}") Sleep(200000) $money = 19;19! Nästan 20! Nästa gang pa baxa kommer det plussas pa till 20 och da kommer detta aktiveras sa den tar ut pengar If $lvl = "rob1" Then rob1() EndIf EndFunc Edited April 27, 2009 by Deni Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27, 2009 Developers Share Posted April 27, 2009 OKey guys will try.Melba23 i tryed that didint work..Thanks for fast response too.Run your script through Tidy.exe and see what it tells you....Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Deni Posted April 27, 2009 Author Share Posted April 27, 2009 Run your script through Tidy.exe and see what it tells you....JosDunno whats that ^^ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 27, 2009 Moderators Share Posted April 27, 2009 Deni,Looking again at your code, I see you have an infinite recursive loop here = big, big trouble. Do you really need to call the function recursively? Surely you must have an exit strategy?M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27, 2009 Developers Share Posted April 27, 2009 Dunno whats that ^^Install the full SciTE4AutoIt3 installer, Open your script in SciTE and hit Ctrl+T. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Deni Posted April 27, 2009 Author Share Posted April 27, 2009 Deni,Looking again at your code, I see you have an infinite recursive loop here = big, big trouble. Do you really need to call the function recursively? Surely you must have an exit strategy?M23Well yea i dont know how to explain exaclty why i need it but its a game that you steal and etc. So this buys energy whole time and so on Link to comment Share on other sites More sharing options...
Mat Posted April 27, 2009 Share Posted April 27, 2009 (edited) your nesting is once again the problem, you cannot nest functions inside of other functions as you are doing. neither can if tests run across functions. MDiesel Edited April 27, 2009 by mdiesel AutoIt Project Listing Link to comment Share on other sites More sharing options...
Deni Posted April 27, 2009 Author Share Posted April 27, 2009 ok but first i will try tidy hold on. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 27, 2009 Developers Share Posted April 27, 2009 (edited) Well yea i dont know how to explain exaclty why i need it but its a game that you steal and etc. So this buys energy whole time and so onsure, well I am pretty sure recursion is not needed in this func .... but whatever works for you as long as you don't complain about the script being closed when the recursion levels get too high.Your posted code is a clear indication you need to learn some basics first before continuing.Jos Edited April 27, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Deni Posted April 27, 2009 Author Share Posted April 27, 2009 (edited) Install the full SciTE4AutoIt3 installer, Open your script in SciTE and hit Ctrl+T.Thanks Jos It told me what to do and corrected my script Big thanks for you and your others taht tryed to help.And i'm still learning from another script due i think its easier but thanks anyway.Close or something cause we got a fix here 'One More thing what the hell is SYntax error ?! Edited April 27, 2009 by Deni 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