iCrypto Posted January 7, 2016 Share Posted January 7, 2016 Hey,I made a script with a decent amount of Ifs, and now I have a ton of Problemsexpandcollapse popup#include <FFC.au3> #include <String.au3> _FFStart("www.howrse.de") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) $loggedin = StringInStr($html, "Equus") MsgBox (0, "title", $loggedin) if $loggedin = 0 or @error then MsgBox ( 0, "Achtung", "Sie sind nicht eingeloggt, bitte in Firefox einloggen") else _FFOpenURL("http://www.howrse.de/elevage/chevaux/?elevage=all-horses") if _FFisConnected() then $html = _FFReadHTML() MsgBox(0, "title", $html) ;<a href="/elevage/chevaux/cheval?id=54133288" class="horsename">Achal-Tekkiner#</a> EndIf EndIf EndIf $id = _StringBetween($html, 'a href="/elevage/chevaux/cheval?id=', " class=") $anzahl = Ubound($id) if IsDeclared($anzahl) Then for $i = 0 to $anzahl $resturl = "http://www.howrse.de/elevage/chevaux/cheval?id=" $url = $resturl & $id[$i] _FFOpenURL($url) If _FFisConnected() then $html = _FFReadHTML() $alter = _StringBetween($html, '<strong>Alter:</strong>', "</td>") Next EndIf func Einstallen() $eingestallt = StringInStr($html, "Melde Dein Pferd") if $eingestallt = 0 or @error Then Else $urlStall = "www.howrse.de/elevage/chevaux/centreInscription?id=" & $id[$i] MsgBox(0,"",$urlStall) ;type="submit" style="" onclick=" "> ></button> $javascript = _StringBetween($html,'type="submit" style="" onclick="','"> ></button>') _FFCmd($javascript) _FFOpenUrl($url) EndIf EndFunc Einstallen() if $alter = "1 Monat" or "2 Monate" or "3 Monate" or "4 Monate" or "5 Monate" or "6 Monate" Then $rand = Random (1000,5000,1) sleep ($rand) _FFCmd("$('#boutonAllaiter').css('position','absolute').fadeOut(500);$('#boutonAllaiter-inactive').css('position','relative').fadeIn(500);$('#form-do-suckle').submit();") $rand = Random (1000,5000,1) sleep ($rand) _FFCmd("$('#boutonPanser').css('position','absolute').fadeOut(500);$('#boutonPanser-inactive').css('position','relative').fadeIn(500);$('#form-do-groom').submit();") $rand = Random (1000,5000,1) sleep ($rand) else $rand = Random (1000,5000,1) sleep ($rand) _FFCMD ('removeFieldsErro _FFClick("feed-button",'id') Elsers(); showConsoleBlockTab("care", "feed", function() { $("#tutoriel-highlight-nourrir").hide(); $("#tutoriel-highlight-nourrir-astuce").show(); });') $rand = Random (1000,5000,1) sleep ($rand) MsgBox (0, "Fehler", "ERROR: Keine Pferde gefunden") EndIf MsGbox(0, "Lol","text") NextWhat am I doing wrong? When I add endIfs its saying syntax error and statement cannot be just an expression Thanks in advance Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2016 Moderators Share Posted January 7, 2016 iCrypto,You have Next instead of EndIf on lines 36 & 77 - and EndIf instead of Next on line 37. Once those errors are corrected the script passes syntax checks.M23P.S. if you use Tidy (a utility that comes with the SciTE4AutoIt3 package which you can download here) then you can set the correct indenting which really helps debug this sort of problem. 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...
iCrypto Posted January 7, 2016 Author Share Posted January 7, 2016 Its still broken, expandcollapse popup#include <FFC.au3> #include <String.au3> _FFStart("www.howrse.de") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) $loggedin = StringInStr($html, "Equus") MsgBox(0, "title", $loggedin) If $loggedin = 0 Or @error Then MsgBox(0, "Achtung", "Sie sind nicht eingeloggt, bitte in Firefox einloggen") Else _FFOpenURL("http://www.howrse.de/elevage/chevaux/?elevage=all-horses") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) ;<a href="/elevage/chevaux/cheval?id=54133288" class="horsename">Achal-Tekkiner#</a> EndIf EndIf EndIf $id = _StringBetween($html, 'a href="/elevage/chevaux/cheval?id=', " class=") $anzahl = UBound($id) If IsDeclared($anzahl) Then For $i = 0 To $anzahl $resturl = "http://www.howrse.de/elevage/chevaux/cheval?id=" $url = $resturl & $id[$i] _FFOpenURL($url) If _FFisConnected() Then $html = _FFReadHTML() $alter = _StringBetween($html, '<strong>Alter:</strong>', "</td>") ;### Tidy Error -> "next" is closing previous "if" on line 33 Next ;### Tidy Error -> "endif" is closing previous "for" on line 28 EndIf EndIf Func Einstallen() $eingestallt = StringInStr($html, "Melde Dein Pferd") If $eingestallt = 0 Or @error Then Else $urlStall = "www.howrse.de/elevage/chevaux/centreInscription?id=" & $id[$i] MsgBox(0, "", $urlStall) ;type="submit" style="" onclick=" "> ></button> $javascript = _StringBetween($html, 'type="submit" style="" onclick="', '"> ></button>') _FFCmd($javascript) _FFOpenUrl($url) EndIf EndFunc ;==>Einstallen Einstallen() If $alter = "1 Monat" Or "2 Monate" Or "3 Monate" Or "4 Monate" Or "5 Monate" Or "6 Monate" Then $rand = Random(1000, 5000, 1) Sleep($rand) _FFCmd("$('#boutonAllaiter').css('position','absolute').fadeOut(500);$('#boutonAllaiter-inactive').css('position','relative').fadeIn(500);$('#form-do-suckle').submit();") $rand = Random(1000, 5000, 1) Sleep($rand) _FFCmd("$('#boutonPanser').css('position','absolute').fadeOut(500);$('#boutonPanser-inactive').css('position','relative').fadeIn(500);$('#form-do-groom').submit();") $rand = Random(1000, 5000, 1) Sleep($rand) Else $rand = Random(1000, 5000, 1) Sleep($rand) _FFCMD('removeFieldsErrors(); showConsoleBlockTab("care", "feed", function() { $("#tutoriel-highlight-nourrir").hide(); $("#tutoriel-highlight-nourrir-astuce").show(); });') $rand = Random(1000, 5000, 1) Sleep($rand) _FFClick("feed-button", 'id') Else MsgBox(0, "Fehler", "ERROR: Keine Pferde gefunden") EndIf MsgBox(0, "Lol", "text") ;### Tidy Error: "next" is likely missing it's opening statement. next line creates a negative tablevel. EndIf ;### Tidy Error: "endif" is likely missing it's opening statement. next line creates a negative tablevel. EndIf ;### Tidy Error: "endif" is likely missing it's opening statement. next line creates a negative tablevel. EndIf ;### Tidy Error: "endif" is likely missing it's opening statement. next line creates a negative tablevel. EndIf ;### Tidy Error: "endif" is likely missing it's opening statement. next line creates a negative tablevel. EndIf Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2016 Moderators Share Posted January 7, 2016 iCrypto,If someone replies, at least read what they say:You have Next instead of EndIf on lines 36 [...] - and EndIf instead of Next on line 37.And you have now added several extraneous EndIf lines at the end of the script. 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...
iCrypto Posted January 7, 2016 Author Share Posted January 7, 2016 expandcollapse popup#include <FFC.au3> #include <String.au3> _FFStart("www.howrse.de") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) $loggedin = StringInStr($html, "Equus") MsgBox(0, "title", $loggedin) If $loggedin = 0 Or @error Then MsgBox(0, "Achtung", "Sie sind nicht eingeloggt, bitte in Firefox einloggen") Else _FFOpenURL("http://www.howrse.de/elevage/chevaux/?elevage=all-horses") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) ;<a href="/elevage/chevaux/cheval?id=54133288" class="horsename">Achal-Tekkiner#</a> EndIf EndIf EndIf $id = _StringBetween($html, 'a href="/elevage/chevaux/cheval?id=', " class=") $anzahl = UBound($id) If IsDeclared($anzahl) Then For $i = 0 To $anzahl $resturl = "http://www.howrse.de/elevage/chevaux/cheval?id=" $url = $resturl & $id[$i] _FFOpenURL($url) If _FFisConnected() Then $html = _FFReadHTML() $alter = _StringBetween($html, '<strong>Alter:</strong>', "</td>") ;### Tidy Error -> "next" is closing previous "if" on line 33 EndIf ;### Tidy Error -> "endif" is closing previous "for" on line 28 Next EndIf Func Einstallen() $eingestallt = StringInStr($html, "Melde Dein Pferd") If $eingestallt = 0 Or @error Then Else $urlStall = "www.howrse.de/elevage/chevaux/centreInscription?id=" & $id[$i] MsgBox(0, "", $urlStall) ;type="submit" style="" onclick=" "> ></button> $javascript = _StringBetween($html, 'type="submit" style="" onclick="', '"> ></button>') _FFCmd($javascript) _FFOpenUrl($url) EndIf EndFunc ;==>Einstallen Einstallen() If $alter = "1 Monat" Or "2 Monate" Or "3 Monate" Or "4 Monate" Or "5 Monate" Or "6 Monate" Then $rand = Random(1000, 5000, 1) Sleep($rand) _FFCmd("$('#boutonAllaiter').css('position','absolute').fadeOut(500);$('#boutonAllaiter-inactive').css('position','relative').fadeIn(500);$('#form-do-suckle').submit();") $rand = Random(1000, 5000, 1) Sleep($rand) _FFCmd("$('#boutonPanser').css('position','absolute').fadeOut(500);$('#boutonPanser-inactive').css('position','relative').fadeIn(500);$('#form-do-groom').submit();") $rand = Random(1000, 5000, 1) Sleep($rand) Else $rand = Random(1000, 5000, 1) Sleep($rand) _FFCMD('removeFieldsErrors(); showConsoleBlockTab("care", "feed", function() { $("#tutoriel-highlight-nourrir").hide(); $("#tutoriel-highlight-nourrir-astuce").show(); });') $rand = Random(1000, 5000, 1) Sleep($rand) _FFClick("feed-button", 'id') Else MsgBox(0, "Fehler", "ERROR: Keine Pferde gefunden") EndIf MsgBox(0, "Lol", "text")Here i fixed it but there are some bugs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2016 Moderators Share Posted January 7, 2016 iCrypto,I do not use FF so I cannot help further.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...
iCrypto Posted January 7, 2016 Author Share Posted January 7, 2016 its endif bug Link to comment Share on other sites More sharing options...
iCrypto Posted January 7, 2016 Author Share Posted January 7, 2016 You dont need FF its saying missing EndIf Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2016 Moderators Share Posted January 7, 2016 iCryptoexpandcollapse popup#include <FFC.au3> #include <String.au3> _FFStart("www.howrse.de") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) $loggedin = StringInStr($html, "Equus") MsgBox(0, "title", $loggedin) If $loggedin = 0 Or @error Then MsgBox(0, "Achtung", "Sie sind nicht eingeloggt, bitte in Firefox einloggen") Else _FFOpenURL("http://www.howrse.de/elevage/chevaux/?elevage=all-horses") If _FFisConnected() Then $html = _FFReadHTML() MsgBox(0, "title", $html) ;<a href="/elevage/chevaux/cheval?id=54133288" class="horsename">Achal-Tekkiner#</a> EndIf EndIf EndIf $id = _StringBetween($html, 'a href="/elevage/chevaux/cheval?id=', " class=") $anzahl = UBound($id) If IsDeclared($anzahl) Then For $i = 0 To $anzahl $resturl = "http://www.howrse.de/elevage/chevaux/cheval?id=" $url = $resturl & $id[$i] _FFOpenURL($url) If _FFisConnected() Then $html = _FFReadHTML() $alter = _StringBetween($html, '<strong>Alter:</strong>', "</td>") EndIf Next EndIf Func Einstallen() $eingestallt = StringInStr($html, "Melde Dein Pferd") If $eingestallt = 0 Or @error Then Else $urlStall = "www.howrse.de/elevage/chevaux/centreInscription?id=" & $id[$i] MsgBox(0, "", $urlStall) ;type="submit" style="" onclick=" "> ></button> $javascript = _StringBetween($html, 'type="submit" style="" onclick="', '"> ></button>') _FFCmd($javascript) _FFOpenUrl($url) EndIf EndFunc ;==>Einstallen Einstallen() If $alter = "1 Monat" Or "2 Monate" Or "3 Monate" Or "4 Monate" Or "5 Monate" Or "6 Monate" Then $rand = Random(1000, 5000, 1) Sleep($rand) _FFCmd("$('#boutonAllaiter').css('position','absolute').fadeOut(500);$('#boutonAllaiter-inactive').css('position','relative').fadeIn(500);$('#form-do-suckle').submit();") $rand = Random(1000, 5000, 1) Sleep($rand) _FFCmd("$('#boutonPanser').css('position','absolute').fadeOut(500);$('#boutonPanser-inactive').css('position','relative').fadeIn(500);$('#form-do-groom').submit();") $rand = Random(1000, 5000, 1) Sleep($rand) Else $rand = Random(1000, 5000, 1) Sleep($rand) _FFCMD('removeFieldsErrors(); showConsoleBlockTab("care", "feed", function() { $("#tutoriel-highlight-nourrir").hide(); $("#tutoriel-highlight-nourrir-astuce").show(); });') $rand = Random(1000, 5000, 1) Sleep($rand) _FFClick("feed-button", 'id') Else MsgBox(0, "Fehler", "ERROR: Keine Pferde gefunden") EndIf MsgBox(0, "Lol", "text")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...
iCrypto Posted January 7, 2016 Author Share Posted January 7, 2016 Still errors, 2 EndIf Missing Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2016 Moderators Share Posted January 7, 2016 iCrypto,You have 2 Else sections inside the section starting at line 68:If $alter = "1 Monat" Or "2 Monate" Or "3 Monate" Or "4 Monate" Or "5 Monate" Or "6 Monate" Then [...] Else [...] Else [...] EndIfYou need to recast that section so that you have only one.And having looked at the website you are attempting to automate, I see it is a game - so I suggest you read the Forum rules now - particularly the bit about not discussing game automation - and then you will understand why you will get no more help and this thread will now be locked.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...
Recommended Posts