Jump to content

How to read specified text from HTML?


Recommended Posts

Speaking completely without code, and more so just theory/thoughts. I would write what _IEBodyReadHTML($ie1) to a .txt file.

Then do a search for src= and then have it 17 characters afterwords and store it as an array.

So using StringRight and _ArrayAdd.

EDIT: Wrong function and Typos. :/

Edited by AwAke
Link to comment
Share on other sites

Ok, here is my script:

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <IE.au3>
#Include <Constants.au3>


$LoginOkno = GUICreate("Travian SBOT v1.0", 500, 300)
GUICtrlCreateLabel("Welcome to Travian Super Bot v1.0.", 10, 10)
GUICtrlCreateLabel("For the begining please enter your username, pw and server information.", 10, 30)
GUICtrlCreateLabel("UserName:", 10, 70)
GUICtrlCreateLabel("PassWord:", 10, 100)
GUICtrlCreateLabel("Server:", 30, 130)
$_Upor = GUICtrlCreateInput("", 80, 67, 120, 20)
$_Geslo = GUICtrlCreateInput("", 80, 97, 120, 20, $ES_PASSWORD)
$_Server = GUICtrlCreateInput("s1.travian.com", 80, 127, 120, 20)
$Gumb = GUICtrlCreateButton("OK", 170, 200, 150)
GUISetState(@SW_SHOW)

While 1
    $msg = GUIGetMsg()
    $Upor = GUICtrlRead($_Upor)
    $Geslo = GUICtrlRead($_Geslo)
    $Server = GUICtrlRead($_Server)
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Gumb And $Upor = ""
            MsgBox(0, "Error", "Error. Please enter Your UserName")
        Case $msg = $Gumb And $Geslo = ""
            MsgBox(0, "Error", "Error. Please enter Your PassWord")
        Case $msg = $Gumb And $Server = ""
            MsgBox(0, "Error", "Error. Please enter server address")
        Case $msg = $Gumb
            $Preverjam = GUICreate("Login checker", 200, 50)
            GUICtrlCreateLabel("Working, please wait ...", 20, 10)
            GUISetState(@SW_SHOW)
            $IE1 = _IECreate($Server, 0, 1, 1, 0)
            $Load1 = _IELoadWait($IE1, 0, 10000)
            If $Load1 = 0 Then
            MsgBox(0, "Error", "Cannot open " & $Server & ". Please make sure that you entered correct URL and check if site is online.")
            _IEQuit($IE1)
            Exit
        EndIf
        $Form = _IEFormGetObjByName($IE1, "snd")
        $oElements = _IETagNameGetCollection ($IE1, "input")
        $Uporabnik = _IEFormElementGetObjByName($Form, "ef9309a")
        $Pw = _IEFormElementGetObjByName($Form, "ee1ee79")
        _IEFormElementSetValue($Uporabnik, $Upor)
        _IEFormElementSetValue($Pw, $Geslo)
        If $Uporabnik = 0 Then
            MsgBox(0, "Napaka", "Error code 001. Prilo je do napake. Preveri če je stran ikariam.si online, oz. če je dostopna. Če je poskusi ponovno čez nekaj časa, če se napaka e zmeraj pojavlja, napii BUG report(na forum) z Error kodo.")
            _IEQuit($IE1)
            Exit
            EndIf
            Sleep(5000)
            For $oElement In $oElements
                If String($oElement.value) = "Login" Then
                    $Klikn = _IEAction($oElement, "Click")
                EndIf
            Next
            Sleep(1000)
            $ZaLogin = _IEBodyReadHTML($IE1)
            If StringInStr($ZaLogin, "name=login") Then
                MsgBox(0, "Error", "You entered incorrect login info. Please try again.")
                _IEQuit($IE1)
            EndIf
            If StringInStr($ZaLogin, "dorf2.php") Then
                $Preberi = _IEBodyReadHTML($IE1)
                MsgBox(0, "null", $Preberi) ; this I will delete and here comes variables ...
            EndIf
        EndSelect
    WEnd

I'm doing on travian bot. Now I need buildings level ... I can get them from html (on picture). I just want this things in variables.

How can I use here StringRight ... because I dont have 1 line ... so I need something that I can enter which line .. ?

Edited by DoctorSLO
Link to comment
Share on other sites

OK, I make like this:

If StringInStr($Preberi, 's2.gif" id="rf1') Then
                $ID1 = 2
            ElseIf StringInStr($Preberi, 's1.gif" id="rf1') Then
                $ID1 = 1
            ElseIf StringInStr($Preberi, 's3.gif" id="rf1') Then
                $ID1 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf1') Then
                $ID1 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf1') Then
                $ID1 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf1') Then
                $ID1 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf1') Then
                $ID1 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf1') Then
                $ID1 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf1') Then
                $ID1 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf1') Then
                $ID1 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf1') Then
                $ID1 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf1') Then
                $ID1 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf1') Then
                $ID1 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf1') Then
                $ID1 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf1') Then
                $ID1 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf1') Then
                $ID1 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf1') Then
                $ID1 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf1') Then
                $ID1 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf1') Then
                $ID1 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf1') Then
                $ID1 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf2"') Then
                $ID2 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf2"') Then
                $ID2 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf2"') Then
                $ID2 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf2"') Then
                $ID2 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf2"') Then
                $ID2 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf2"') Then
                $ID2 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf2"') Then
                $ID2 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf2"') Then
                $ID2 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf2"') Then
                $ID2 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf2"') Then
                $ID2 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf2"') Then
                $ID2 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf2"') Then
                $ID2 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf2"') Then
                $ID2 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf2"') Then
                $ID2 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf2"') Then
                $ID2 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf2"') Then
                $ID2 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf2"') Then
                $ID2 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf2"') Then
                $ID2 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf2"') Then
                $ID2 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf2"') Then
                $ID2 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf3"') Then
                $ID3 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf3"') Then
                $ID3 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf3"') Then
                $ID3 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf3"') Then
                $ID3 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf3"') Then
                $ID3 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf3"') Then
                $ID3 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf3"') Then
                $ID3 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf3"') Then
                $ID3 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf3"') Then
                $ID3 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf3"') Then
                $ID3 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf3"') Then
                $ID3 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf3"') Then
                $ID3 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf3"') Then
                $ID3 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf3"') Then
                $ID3 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf3"') Then
                $ID3 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf3"') Then
                $ID3 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf3"') Then
                $ID3 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf3"') Then
                $ID3 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf3"') Then
                $ID3 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf3"') Then
                $ID3 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf4"') Then
                $ID4 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf4"') Then
                $ID4 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf4"') Then
                $ID4 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf4"') Then
                $ID4 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf4"') Then
                $ID4 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf4"') Then
                $ID4 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf4"') Then
                $ID4 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf4"') Then
                $ID4 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf4"') Then
                $ID4 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf4"') Then
                $ID4 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf4"') Then
                $ID4 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf4"') Then
                $ID4 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf4"') Then
                $ID4 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf4"') Then
                $ID4 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf4"') Then
                $ID4 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf4"') Then
                $ID4 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf4"') Then
                $ID4 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf4"') Then
                $ID4 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf4"') Then
                $ID4 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf4"') Then
                $ID4 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf5"') Then
                $ID5 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf5"') Then
                $ID5 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf5"') Then
                $ID5 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf5"') Then
                $ID5 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf5"') Then
                $ID5 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf5"') Then
                $ID5 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf5"') Then
                $ID5 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf5"') Then
                $ID5 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf5"') Then
                $ID5 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf5"') Then
                $ID5 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf5"') Then
                $ID5 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf5"') Then
                $ID5 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf5"') Then
                $ID5 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf5"') Then
                $ID5 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf5"') Then
                $ID5 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf5"') Then
                $ID5 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf5"') Then
                $ID5 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf5"') Then
                $ID5 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf5"') Then
                $ID5 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf5"') Then
                $ID5 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf6"') Then
                $ID6 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf6"') Then
                $ID6 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf6"') Then
                $ID6 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf6"') Then
                $ID6 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf6"') Then
                $ID6 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf6"') Then
                $ID6 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf6"') Then
                $ID6 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf6"') Then
                $ID6 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf6"') Then
                $ID6 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf6"') Then
                $ID6 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf6"') Then
                $ID6 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf6"') Then
                $ID6 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf6"') Then
                $ID6 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf6"') Then
                $ID6 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf6"') Then
                $ID6 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf6"') Then
                $ID6 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf6"') Then
                $ID6 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf6"') Then
                $ID6 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf6"') Then
                $ID6 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf6"') Then
                $ID6 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf7"') Then
                $ID7 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf7"') Then
                $ID7 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf7"') Then
                $ID7 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf7"') Then
                $ID7 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf7"') Then
                $ID7 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf7"') Then
                $ID7 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf7"') Then
                $ID7 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf7"') Then
                $ID7 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf7"') Then
                $ID7 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf7"') Then
                $ID7 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf7"') Then
                $ID7 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf7"') Then
                $ID7 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf7"') Then
                $ID7 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf7"') Then
                $ID7 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf7"') Then
                $ID7 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf7"') Then
                $ID7 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf7"') Then
                $ID7 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf7"') Then
                $ID7 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf7"') Then
                $ID7 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf7"') Then
                $ID7 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf8"') Then
                $ID8 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf8"') Then
                $ID8 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf8"') Then
                $ID8 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf8"') Then
                $ID8 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf8"') Then
                $ID8 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf8"') Then
                $ID8 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf8"') Then
                $ID8 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf8"') Then
                $ID8 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf8"') Then
                $ID8 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf8"') Then
                $ID8 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf8"') Then
                $ID8 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf8"') Then
                $ID8 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf8"') Then
                $ID8 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf8"') Then
                $ID8 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf8"') Then
                $ID8 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf8"') Then
                $ID8 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf8"') Then
                $ID8 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf8"') Then
                $ID8 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf8"') Then
                $ID8 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf8"') Then
                $ID8 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf9"') Then
                $ID9 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf9"') Then
                $ID9 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf9"') Then
                $ID9 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf9"') Then
                $ID9 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf9"') Then
                $ID9 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf9"') Then
                $ID9 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf9"') Then
                $ID9 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf9"') Then
                $ID9 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf9"') Then
                $ID9 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf9"') Then
                $ID9 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf9"') Then
                $ID9 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf9"') Then
                $ID9 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf9"') Then
                $ID9 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf9"') Then
                $ID9 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf9"') Then
                $ID9 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf9"') Then
                $ID9 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf9"') Then
                $ID9 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf9"') Then
                $ID9 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf9"') Then
                $ID9 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf9"') Then
                $ID9 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf10"') Then
                $ID10 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf10"') Then
                $ID10 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf10"') Then
                $ID10 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf10"') Then
                $ID10 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf10"') Then
                $ID10 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf10"') Then
                $ID10 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf10"') Then
                $ID10 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf10"') Then
                $ID10 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf10"') Then
                $ID10 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf10"') Then
                $ID10 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf10"') Then
                $ID10 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf10"') Then
                $ID10 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf10"') Then
                $ID10 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf10"') Then
                $ID10 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf10"') Then
                $ID10 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf10"') Then
                $ID10 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf10"') Then
                $ID10 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf10"') Then
                $ID10 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf10"') Then
                $ID10 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf10"') Then
                $ID10 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf11"') Then
                $ID11 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf11"') Then
                $ID11 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf11"') Then
                $ID11 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf11"') Then
                $ID11 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf11"') Then
                $ID11 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf11"') Then
                $ID11 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf11"') Then
                $ID11 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf11"') Then
                $ID11 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf11"') Then
                $ID11 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf11"') Then
                $ID11 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf11"') Then
                $ID11 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf11"') Then
                $ID11 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf11"') Then
                $ID11 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf11"') Then
                $ID11 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf11"') Then
                $ID11 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf11"') Then
                $ID11 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf11"') Then
                $ID11 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf11"') Then
                $ID11 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf11"') Then
                $ID11 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf11"') Then
                $ID11 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf12"') Then
                $ID12 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf12"') Then
                $ID12 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf12"') Then
                $ID12 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf12"') Then
                $ID12 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf12"') Then
                $ID12 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf12"') Then
                $ID12 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf12"') Then
                $ID12 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf12"') Then
                $ID12 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf12"') Then
                $ID12 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf12"') Then
                $ID12 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf12"') Then
                $ID12 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf12"') Then
                $ID12 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf12"') Then
                $ID12 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf12"') Then
                $ID12 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf12"') Then
                $ID12 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf12"') Then
                $ID12 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf12"') Then
                $ID12 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf12"') Then
                $ID12 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf12"') Then
                $ID12 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf12"') Then
                $ID12 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf13"') Then
                $ID13 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf13"') Then
                $ID13 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf13"') Then
                $ID13 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf13"') Then
                $ID13 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf13"') Then
                $ID13 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf13"') Then
                $ID13 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf13"') Then
                $ID13 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf13"') Then
                $ID13 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf13"') Then
                $ID13 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf13"') Then
                $ID13 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf13"') Then
                $ID13 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf13"') Then
                $ID13 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf13"') Then
                $ID13 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf13"') Then
                $ID13 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf13"') Then
                $ID13 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf13"') Then
                $ID13 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf13"') Then
                $ID13 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf13"') Then
                $ID13 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf13"') Then
                $ID13 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf13"') Then
                $ID13 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf14"') Then
                $ID14 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf14"') Then
                $ID14 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf14"') Then
                $ID14 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf14"') Then
                $ID14 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf14"') Then
                $ID14 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf14"') Then
                $ID14 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf14"') Then
                $ID14 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf14"') Then
                $ID14 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf14"') Then
                $ID14 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf14"') Then
                $ID14 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf14"') Then
                $ID14 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf14"') Then
                $ID14 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf14"') Then
                $ID14 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf14"') Then
                $ID14 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf14"') Then
                $ID14 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf14"') Then
                $ID14 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf14"') Then
                $ID14 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf14"') Then
                $ID14 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf14"') Then
                $ID14 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf14"') Then
                $ID14 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf15"') Then
                $ID15 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf15"') Then
                $ID15 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf15"') Then
                $ID15 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf15"') Then
                $ID15 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf15"') Then
                $ID15 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf15"') Then
                $ID15 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf15"') Then
                $ID15 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf15"') Then
                $ID15 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf15"') Then
                $ID15 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf15"') Then
                $ID15 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf15"') Then
                $ID15 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf15"') Then
                $ID15 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf15"') Then
                $ID15 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf15"') Then
                $ID15 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf15"') Then
                $ID15 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf15"') Then
                $ID15 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf15"') Then
                $ID15 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf15"') Then
                $ID15 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf15"') Then
                $ID15 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf15"') Then
                $ID15 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf16"') Then
                $ID16 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf16"') Then
                $ID16 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf16"') Then
                $ID16 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf16"') Then
                $ID16 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf16"') Then
                $ID16 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf16"') Then
                $ID16 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf16"') Then
                $ID16 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf16"') Then
                $ID16 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf16"') Then
                $ID16 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf16"') Then
                $ID16 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf16"') Then
                $ID16 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf16"') Then
                $ID16 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf16"') Then
                $ID16 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf16"') Then
                $ID16 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf16"') Then
                $ID16 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf16"') Then
                $ID16 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf16"') Then
                $ID16 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf16"') Then
                $ID16 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf16"') Then
                $ID16 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf16"') Then
                $ID16 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf17"') Then
                $ID17 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf17"') Then
                $ID17 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf17"') Then
                $ID17 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf17"') Then
                $ID17 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf17"') Then
                $ID17 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf17"') Then
                $ID17 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf17"') Then
                $ID17 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf17"') Then
                $ID17 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf17"') Then
                $ID17 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf17"') Then
                $ID17 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf17"') Then
                $ID17 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf17"') Then
                $ID17 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf17"') Then
                $ID17 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf17"') Then
                $ID17 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf17"') Then
                $ID17 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf17"') Then
                $ID17 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf17"') Then
                $ID17 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf17"') Then
                $ID17 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf17"') Then
                $ID17 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf17"') Then
                $ID17 = 20
            EndIf
                        
            If StringInStr($Preberi, 's1.gif" id="rf18"') Then
                $ID18 = 1
            ElseIf StringInStr($Preberi, 's2.gif" id="rf18"') Then
                $ID18 = 2
            ElseIf StringInStr($Preberi, 's3.gif" id="rf18"') Then
                $ID18 = 3
            ElseIf StringInStr($Preberi, 's4.gif" id="rf18"') Then
                $ID18 = 4
            ElseIf StringInStr($Preberi, 's5.gif" id="rf18"') Then
                $ID18 = 5
            ElseIf StringInStr($Preberi, 's6.gif" id="rf18"') Then
                $ID18 = 6
            ElseIf StringInStr($Preberi, 's7.gif" id="rf18"') Then
                $ID18 = 7
            ElseIf StringInStr($Preberi, 's8.gif" id="rf18"') Then
                $ID18 = 8
            ElseIf StringInStr($Preberi, 's9.gif" id="rf18"') Then
                $ID18 = 9
            ElseIf StringInStr($Preberi, 's10.gif" id="rf18"') Then
                $ID18 = 10
            ElseIf StringInStr($Preberi, 's11.gif" id="rf18"') Then
                $ID18 = 11
            ElseIf StringInStr($Preberi, 's12.gif" id="rf18"') Then
                $ID18 = 12
            ElseIf StringInStr($Preberi, 's13.gif" id="rf18"') Then
                $ID18 = 13
            ElseIf StringInStr($Preberi, 's14.gif" id="rf18"') Then
                $ID18 = 14
            ElseIf StringInStr($Preberi, 's15.gif" id="rf18"') Then
                $ID18 = 15
            ElseIf StringInStr($Preberi, 's16.gif" id="rf18"') Then
                $ID18 = 16
            ElseIf StringInStr($Preberi, 's17.gif" id="rf18"') Then
                $ID18 = 17
            ElseIf StringInStr($Preberi, 's18.gif" id="rf18"') Then
                $ID18 = 18
            ElseIf StringInStr($Preberi, 's19.gif" id="rf18"') Then
                $ID18 = 19
            ElseIf StringInStr($Preberi, 's20.gif" id="rf18"') Then
                $ID18 = 20
            EndIf

Is there any short kind of this, or this is good?

Link to comment
Share on other sites

Not sure what $preberi is meant to be, but maybe this?

For $i = 1 to 20
    If StringInStr ($Preberi, 's' & $i & '" id="rf') Then Assign ("ID" & $i, $i)
Next

Cheers,

Brett

Link to comment
Share on other sites

I have a lot of this, but this never ends ....

For $l = 0 To 100000 Step 1
            If StringInStr($Surovine, $a & ":" & $l & " na uro") Then
            $LesNaUro = $l
            EndIf
        Next
        GUICtrlSetData($Delam, "Gattering Clay/hr ...")
        GUICtrlSetData($Bar, 50)
        For $g = 0 To 100000 
            If StringInStr($Surovine, $b & ":" & $g & " na uro") Then
            $GlinaNaUro = $g
            EndIf
        Next
        GUICtrlSetData($Delam, "Gattering Iron/hr ...")
        GUICtrlSetData($Bar, 60)
        For $z = 0 To 100000 
            If StringInStr($Surovine, $c & ":" & $z & " na uro") Then
            $ZelezoNaUro = $z
            EndIf
        Next
        GUICtrlSetData($Delam, "Gattering Crop/hr ...")
        GUICtrlSetData($Bar, 70)
        For $z2 = -100000 To 100000 
            If StringInStr($Surovine, $d & ":" & $z2 & " na uro") Then
            $ZitoNaUro = $z2
            EndIf
        Next
        GUICtrlSetData($Delam, "Gattering resources info ...")
        GUICtrlSetData($Bar, 80)
        For $lo = 0 To 2000000 
            If StringInStr($Preberi, "<TD id=l4 title=28>" & $lo) Then
                $Les = $lo
            EndIf
        Next
        GUICtrlSetData($Bar, 90)
        For $ld = 0 To 2000000 
            If StringInStr($Preberi, "<TD id=l4 title=28>" & $Les &"/" & $ld) Then
                $LesMax = $ld
            EndIf
        Next
        For $go = 0 To 2000000
            If StringInStr($Preberi, '<td id=l3 title=32>' & $go) Then
                $Glina = $go
            EndIf
        Next
        For $gd = 0 To 2000000
            If StringInStr($Preberi, '<td id=l3 title=32>' & $Glina & '/' & $gd) Then
                $GlinaMax = $gd
            EndIf
        Next
        For $zo = 0 To 2000000
            If StringInStr($Preberi, '<td id=l2 title=32>' & $zo) Then
                $Zelezo = $zo
            EndIf
        Next
        For $zd = 0 To 2000000
            If StringInStr($Preberi, '<td id=l2 title=32>' & $Zelezo & '/' & $zd) Then
                $ZelezoMax = $zd
            EndIf
        Next
        For $z2o = 0 To 2000000
            If StringInStr($Preberi, '<td id=l1 title=6>' & $z2o) Then
                $Zito = $z2o
            EndIf
        Next
        For $z2d = 0 To 2000000
            If StringInStr($Preberi, '<td id=l1 title=6>' & $Zito & '/' & $z2d) Then
                $ZitoMax = $z2d
            EndIf
        Next

There where I have 2mil ... never ends (using 100% CPU)

What should I do ... I use some other function or what?

Edited by DoctorSLO
Link to comment
Share on other sites

Hi, I have one more question ... Why here says me error ==> Variable used without being declared.:

GUICtrlCreateButton($ID1, 143, 69, 20, 22)

GUICtrlCreateButton(^ ERROR

I have declared ID1 ...

If StringInStr($Preberi, 's2.gif" id="rf1') Then
                $ID1 = 2
            EndIf
            If StringInStr($Preberi, 's1.gif" id="rf1') Then
                $ID1 = 1
            EndIf
            If StringInStr($Preberi, 's3.gif" id="rf1') Then
                $ID1 = 3
            EndIf
            If StringInStr($Preberi, 's4.gif" id="rf1') Then
                $ID1 = 4
            EndIf
            If StringInStr($Preberi, 's5.gif" id="rf1') Then
                $ID1 = 5
            EndIf
            If StringInStr($Preberi, 's6.gif" id="rf1') Then
                $ID1 = 6
            EndIf
            If StringInStr($Preberi, 's7.gif" id="rf1') Then
                $ID1 = 7
            EndIf
            If StringInStr($Preberi, 's8.gif" id="rf1') Then
                $ID1 = 8
            EndIf
            If StringInStr($Preberi, 's9.gif" id="rf1') Then
                $ID1 = 9
            EndIf
            If StringInStr($Preberi, 's10.gif" id="rf1') Then
                $ID1 = 10
            EndIf
            If StringInStr($Preberi, 's11.gif" id="rf1') Then
                $ID1 = 11
            EndIf
            If StringInStr($Preberi, 's12.gif" id="rf1') Then
                $ID1 = 12
            EndIf
            If StringInStr($Preberi, 's13.gif" id="rf1') Then
                $ID1 = 13
            EndIf
            If StringInStr($Preberi, 's14.gif" id="rf1') Then
                $ID1 = 14
            EndIf
            If StringInStr($Preberi, 's15.gif" id="rf1') Then
                $ID1 = 15
            EndIf
            If StringInStr($Preberi, 's16.gif" id="rf1') Then
                $ID1 = 16
            EndIf
            If StringInStr($Preberi, 's17.gif" id="rf1') Then
                $ID1 = 17
            EndIf
            If StringInStr($Preberi, 's18.gif" id="rf1') Then
                $ID1 = 18
            EndIf
            If StringInStr($Preberi, 's19.gif" id="rf1') Then
                $ID1 = 19
            EndIf
            If StringInStr($Preberi, 's20.gif" id="rf1') Then
                $ID1 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf2"') Then
                $ID2 = 1
            EndIf
            If StringInStr($Preberi, 's2.gif" id="rf2"') Then
                $ID2 = 2
            EndIf
            If StringInStr($Preberi, 's3.gif" id="rf2"') Then
                $ID2 = 3
            EndIf
            If StringInStr($Preberi, 's4.gif" id="rf2"') Then
                $ID2 = 4
            EndIf
            If StringInStr($Preberi, 's5.gif" id="rf2"') Then
                $ID2 = 5
            EndIf
            If StringInStr($Preberi, 's6.gif" id="rf2"') Then
                $ID2 = 6
            EndIf
            If StringInStr($Preberi, 's7.gif" id="rf2"') Then
                $ID2 = 7
            EndIf
            If StringInStr($Preberi, 's8.gif" id="rf2"') Then
                $ID2 = 8
            EndIf
            If StringInStr($Preberi, 's9.gif" id="rf2"') Then
                $ID2 = 9
            EndIf
            If StringInStr($Preberi, 's10.gif" id="rf2"') Then
                $ID2 = 10
            EndIf
            If StringInStr($Preberi, 's11.gif" id="rf2"') Then
                $ID2 = 11
            EndIf
            If StringInStr($Preberi, 's12.gif" id="rf2"') Then
                $ID2 = 12
            EndIf
            If StringInStr($Preberi, 's13.gif" id="rf2"') Then
                $ID2 = 13
            EndIf
            If StringInStr($Preberi, 's14.gif" id="rf2"') Then
                $ID2 = 14
            EndIf
            If StringInStr($Preberi, 's15.gif" id="rf2"') Then
                $ID2 = 15
            EndIf
            If StringInStr($Preberi, 's16.gif" id="rf2"') Then
                $ID2 = 16
            EndIf
            If StringInStr($Preberi, 's17.gif" id="rf2"') Then
                $ID2 = 17
            EndIf
            If StringInStr($Preberi, 's18.gif" id="rf2"') Then
                $ID2 = 18
            EndIf
            If StringInStr($Preberi, 's19.gif" id="rf2"') Then
                $ID2 = 19
            EndIf
            If StringInStr($Preberi, 's20.gif" id="rf2"') Then
                $ID2 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf3"') Then
                $ID3 = 1
            EndIf
            If StringInStr($Preberi, 's2.gif" id="rf3"') Then
                $ID3 = 2
            EndIf
            If StringInStr($Preberi, 's3.gif" id="rf3"') Then
                $ID3 = 3
            EndIf
            If StringInStr($Preberi, 's4.gif" id="rf3"') Then
                $ID3 = 4
            EndIf
            If StringInStr($Preberi, 's5.gif" id="rf3"') Then
                $ID3 = 5
            EndIf
            If StringInStr($Preberi, 's6.gif" id="rf3"') Then
                $ID3 = 6
            EndIf
            If StringInStr($Preberi, 's7.gif" id="rf3"') Then
                $ID3 = 7
            EndIf
            If StringInStr($Preberi, 's8.gif" id="rf3"') Then
                $ID3 = 8
            EndIf
            If StringInStr($Preberi, 's9.gif" id="rf3"') Then
                $ID3 = 9
            EndIf
            If StringInStr($Preberi, 's10.gif" id="rf3"') Then
                $ID3 = 10
            EndIf
            If StringInStr($Preberi, 's11.gif" id="rf3"') Then
                $ID3 = 11
            EndIf
            If StringInStr($Preberi, 's12.gif" id="rf3"') Then
                $ID3 = 12
            EndIf
            If StringInStr($Preberi, 's13.gif" id="rf3"') Then
                $ID3 = 13
            EndIf
            If StringInStr($Preberi, 's14.gif" id="rf3"') Then
                $ID3 = 14
            EndIf
            If StringInStr($Preberi, 's15.gif" id="rf3"') Then
                $ID3 = 15
            EndIf
            If StringInStr($Preberi, 's16.gif" id="rf3"') Then
                $ID3 = 16
            EndIf
            If StringInStr($Preberi, 's17.gif" id="rf3"') Then
                $ID3 = 17
            EndIf
            If StringInStr($Preberi, 's18.gif" id="rf3"') Then
                $ID3 = 18
            EndIf
            If StringInStr($Preberi, 's19.gif" id="rf3"') Then
                $ID3 = 19
            EndIf
            If StringInStr($Preberi, 's20.gif" id="rf3"') Then
                $ID3 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf4"') Then
                $ID4 = 1
            EndIf
            If StringInStr($Preberi, 's2.gif" id="rf4"') Then
                $ID4 = 2
            EndIf
            If StringInStr($Preberi, 's3.gif" id="rf4"') Then
                $ID4 = 3
            EndIf
            If StringInStr($Preberi, 's4.gif" id="rf4"') Then
                $ID4 = 4
            EndIf
            If StringInStr($Preberi, 's5.gif" id="rf4"') Then
                $ID4 = 5
            EndIf
            If StringInStr($Preberi, 's6.gif" id="rf4"') Then
                $ID4 = 6
            EndIf
            If StringInStr($Preberi, 's7.gif" id="rf4"') Then
                $ID4 = 7
            EndIf
            If StringInStr($Preberi, 's8.gif" id="rf4"') Then
                $ID4 = 8
            EndIf
            If StringInStr($Preberi, 's9.gif" id="rf4"') Then
                $ID4 = 9
            EndIf
            If StringInStr($Preberi, 's10.gif" id="rf4"') Then
                $ID4 = 10
            EndIf
            If StringInStr($Preberi, 's11.gif" id="rf4"') Then
                $ID4 = 11
            EndIf
            If StringInStr($Preberi, 's12.gif" id="rf4"') Then
                $ID4 = 12
            EndIf
            If StringInStr($Preberi, 's13.gif" id="rf4"') Then
                $ID4 = 13
            EndIf
            If StringInStr($Preberi, 's14.gif" id="rf4"') Then
                $ID4 = 14
            EndIf
            If StringInStr($Preberi, 's15.gif" id="rf4"') Then
                $ID4 = 15
            EndIf
            If StringInStr($Preberi, 's16.gif" id="rf4"') Then
                $ID4 = 16
            EndIf
            If StringInStr($Preberi, 's17.gif" id="rf4"') Then
                $ID4 = 17
            EndIf
            If StringInStr($Preberi, 's18.gif" id="rf4"') Then
                $ID4 = 18
            EndIf
            If StringInStr($Preberi, 's19.gif" id="rf4"') Then
                $ID4 = 19
            EndIf
            If StringInStr($Preberi, 's20.gif" id="rf4"') Then
                $ID4 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf5"') Then
                $ID5 = 1
            EndIf
            If StringInStr($Preberi, 's2.gif" id="rf5"') Then
                $ID5 = 2
            EndIf
            If StringInStr($Preberi, 's3.gif" id="rf5"') Then
                $ID5 = 3
            EndIf
            If StringInStr($Preberi, 's4.gif" id="rf5"') Then
                $ID5 = 4
            EndIf
            If StringInStr($Preberi, 's5.gif" id="rf5"') Then
                $ID5 = 5
            EndIf
            If StringInStr($Preberi, 's6.gif" id="rf5"') Then
                $ID5 = 6
            EndIf
            If StringInStr($Preberi, 's7.gif" id="rf5"') Then
                $ID5 = 7
            EndIf
            If StringInStr($Preberi, 's8.gif" id="rf5"') Then
                $ID5 = 8
            EndIf
            If StringInStr($Preberi, 's9.gif" id="rf5"') Then
                $ID5 = 9
            EndIf
            If StringInStr($Preberi, 's10.gif" id="rf5"') Then
                $ID5 = 10
            EndIf
            If StringInStr($Preberi, 's11.gif" id="rf5"') Then
                $ID5 = 11
            EndIf
            If StringInStr($Preberi, 's12.gif" id="rf5"') Then
                $ID5 = 12
            EndIf
            If StringInStr($Preberi, 's13.gif" id="rf5"') Then
                $ID5 = 13
            EndIf
            If StringInStr($Preberi, 's14.gif" id="rf5"') Then
                $ID5 = 14
            EndIf
            If StringInStr($Preberi, 's15.gif" id="rf5"') Then
                $ID5 = 15
            EndIf
            If StringInStr($Preberi, 's16.gif" id="rf5"') Then
                $ID5 = 16
            EndIf
            If StringInStr($Preberi, 's17.gif" id="rf5"') Then
                $ID5 = 17
            EndIf
            If StringInStr($Preberi, 's18.gif" id="rf5"') Then
                $ID5 = 18
            EndIf
            If StringInStr($Preberi, 's19.gif" id="rf5"') Then
                $ID5 = 19
            EndIf
            If StringInStr($Preberi, 's20.gif" id="rf5"') Then
                $ID5 = 20
            EndIf
            
            If StringInStr($Preberi, 's1.gif" id="rf6"') Then
                $ID6 = 1
            EndIf
            If StringInStr($Preberi, 's2.gif" id="rf6"') Then
                $ID6 = 2
            EndIf
            If StringInStr($Preberi, 's3.gif" id="rf6"') Then
                $ID6 = 3
            EndIf
            If StringInStr($Preberi, 's4.gif" id="rf6"') Then
                $ID6 = 4
            EndIf
            If StringInStr($Preberi, 's5.gif" id="rf6"') Then
                $ID6 = 5
            EndIf
            If StringInStr($Preberi, 's6.gif" id="rf6"') Then
                $ID6 = 6
            EndIf
            If StringInStr($Preberi, 's7.gif" id="rf6"') Then
                $ID6 = 7
            EndIf
            If StringInStr($Preberi, 's8.gif" id="rf6"') Then
                $ID6 = 8
            EndIf
            If StringInStr($Preberi, 's9.gif" id="rf6"') Then
                $ID6 = 9
            EndIf
            If StringInStr($Preberi, 's10.gif" id="rf6"') Then
                $ID6 = 10
            EndIf
            If StringInStr($Preberi, 's11.gif" id="rf6"') Then
                $ID6 = 11
            EndIf
            If StringInStr($Preberi, 's12.gif" id="rf6"') Then
                $ID6 = 12
            EndIf
            If StringInStr($Preberi, 's13.gif" id="rf6"') Then
                $ID6 = 13
            EndIf
            If StringInStr($Preberi, 's14.gif" id="rf6"') Then
                $ID6 = 14
            EndIf
            If StringInStr($Preberi, 's15.gif" id="rf6"') Then
                $ID6 = 15
            EndIf
            If StringInStr($Preberi, 's16.gif" id="rf6"') Then
                $ID6 = 16
            EndIf
            If StringInStr($Preberi, 's17.gif" id="rf6"') Then
                $ID6 = 17
            EndIf
            If StringInStr($Preberi, 's18.gif" id="rf6"') Then
                $ID6 = 18
            EndIf
            If StringInStr($Preberi, 's19.gif" id="rf6"') Then
                $ID6 = 19
            EndIf
            If StringInStr($Preberi, 's20.gif" id="rf6"') Then
                $ID6 = 20
            EndIf
            


GUICreate("Travian SBOT v1.0 - overview", 600, 400)
GUICtrlCreatePic("files/wood.gif", 10, 10, 18, 12)
GUICtrlCreateLabel($Les&"/"&$LesMax, 30, 10)
GUICtrlCreatePic("files/clay.gif", 115, 10, 18, 12)
GUICtrlCreateLabel($Glina&"/"&$GlinaMax, 135, 10)
GUICtrlCreatePic("files/iron.gif", 220, 10, 18, 12)
GUICtrlCreateLabel($Zelezo&"/"&$ZelezoMax, 241, 10)
GUICtrlCreatePic("files/crop.gif", 328, 10, 18, 12)
GUICtrlCreateLabel($Zito&"/"&$ZitoMax, 349, 10)
GUICtrlCreatePic("files/slika1.bmp", 50, 50, 300, 264, $SS_GRAYFRAME )
GUICtrlCreateButton($ID1, 143, 69, 20, 22)
GUICtrlCreateButton($ID2, 205, 69, 20, 22)
GUICtrlCreateButton($ID3, 266, 84, 20, 22)
GUICtrlCreateButton($ID4, 87, 101, 20, 22)
GUICtrlCreateButton($ID5, 179, 109, 20, 22)
GUICtrlCreateButton($ID6, 245, 128, 20, 22)
GUICtrlCreateButton(8, 303, 124, 20, 22)
GUICtrlCreateButton(7, 73, 154, 20, 22)
GUICtrlCreateButton(9, 124, 146, 20, 22)
GUICtrlCreateButton(10, 254, 179, 20, 22)
GUICtrlCreateButton(11, 309, 183, 20, 22)
GUICtrlCreateButton(12, 82, 207, 20, 22)
GUICtrlCreateButton(13, 134, 201, 20, 22)
GUICtrlCreateButton(14, 200, 220, 20, 22)
GUICtrlCreateButton(15, 280, 235, 20, 22)
GUICtrlCreateButton(16, 130, 254, 20, 22)
GUICtrlCreateButton(17, 182, 266, 20, 22)
GUICtrlCreateButton(18, 231, 270, 20, 22)
    EndSelect
WEnd
Link to comment
Share on other sites

Maybe its a better idea to tell us what you are doing exactly. Some of those things you have aren't making much sense.

If you want a wild card, maybe have a look at StringRegExp. It may be a little harder but should get the job done easier.

So tell us exactly what you're automating, and we'll be able to help ya :)

Cheers,

Brett

Link to comment
Share on other sites

OK, here is my script that I do so far ... There where are If statements are missing endif ... that's because I have ElseIf ... nwm ... just tell me what I must do that this ID's will works ... and today when I run Syntax check ... I got error lol :( (crash)

[autoit]#include <GUIConstantsEx.au3>

#include <EditConstants.au3>

#include <IE.au3>

#Include <Constants.au3>

#include <ComboConstants.au3>

#include <ProgressConstants.au3>

#include <StaticConstants.au3>

$LoginOkno = GUICreate("Travian SBOT v1.0", 500, 300)

GUICtrlCreateLabel("Welcome to Travian Super Bot v1.0.", 10, 10)

GUICtrlCreateLabel("For the begining please enter your username, pw and server information.", 10, 30)

GUICtrlCreateLabel("UserName:", 10, 70)

GUICtrlCreateLabel("PassWord:", 10, 100)

GUICtrlCreateLabel("Server:", 30, 130)

$_Upor = GUICtrlCreateInput("", 80, 67, 120, 20)

$_Geslo = GUICtrlCreateInput("", 80, 97, 120, 20, $ES_PASSWORD)

$_Server = GUICtrlCreateCombo("travian.com", 80, 127, 120, 20, $CBS_DROPDOWNLIST)

GUICtrlSetData(-1, "travian.si", "travian.si") ; add other item snd set a new default

$_Server2 = GUICtrlCreateCombo("s1.", 220, 127, 60, 20, $CBS_DROPDOWNLIST)

GUICtrlSetData(-1, "s2.|s3.|s4.|s5.|s6.|s7.|s8.|s9.|s10.|speed.", "s1") ; add other item snd set a new default

$Gumb = GUICtrlCreateButton("OK", 170, 200, 150)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

$Upor = GUICtrlRead($_Upor)

$Geslo = GUICtrlRead($_Geslo)

$Server = GUICtrlRead($_Server)

$Server2 = GUICtrlRead($_Server2)

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $Gumb And $Upor = ""

MsgBox(0, "Error", "Error. Please enter Your UserName")

Case $msg = $Gumb And $Geslo = ""

MsgBox(0, "Error", "Error. Please enter Your PassWord")

Case $msg = $Gumb

$Preverjam = GUICreate("Login checker", 250, 100)

$Delam = GUICtrlCreateLabel("Initializing, please wait ...", 20, 10)

$Bar = GUICtrlCreateProgress(20, 40, 200, 20)

GUISetState(@SW_SHOW)

$IE1 = _IECreate($Server2 & $Server, 0, 1, 1, 0)

$Load1 = _IELoadWait($IE1, 0, 10000)

If $Load1 = 0 Then

MsgBox(0, "Error", "Cannot open " & $Server & ". Please make sure that you entered correct URL and check if site is online.")

_IEQuit($IE1)

Exit

EndIf

$Form = _IEFormGetObjByName($IE1, "snd")

$oElements = _IETagNameGetCollection ($IE1, "input")

$Uporabnik = _IEFormElementGetObjByName($Form, "ecdc0c6")

$Pw = _IEFormElementGetObjByName($Form, "ece1bf3")

_IEFormElementSetValue($Uporabnik, $Upor)

_IEFormElementSetValue($Pw, $Geslo)

If $Uporabnik = 0 Then

MsgBox(0, "Napaka", "Error code 001. Pri

Edited by DoctorSLO
Link to comment
Share on other sites

Finally I do it, but $ID1, $ID2, $ID3, .... are still not show up .... :( what I should do ? here is source:

[autoit]#include <GUIConstantsEx.au3>

#include <EditConstants.au3>

#include <IE.au3>

#Include <Constants.au3>

#include <ComboConstants.au3>

#include <ProgressConstants.au3>

#include <StaticConstants.au3>

$LoginOkno = GUICreate("Travian SBOT v1.0", 500, 300)

GUICtrlCreateLabel("Welcome to Travian Super Bot v1.0.", 10, 10)

GUICtrlCreateLabel("For the begining please enter your username, pw and server information.", 10, 30)

GUICtrlCreateLabel("UserName:", 10, 70)

GUICtrlCreateLabel("PassWord:", 10, 100)

GUICtrlCreateLabel("Server:", 30, 130)

$_Upor = GUICtrlCreateInput("Doctor2", 80, 67, 120, 20)

$_Geslo = GUICtrlCreateInput("4848", 80, 97, 120, 20, $ES_PASSWORD)

$_Server = GUICtrlCreateCombo("travian.com", 80, 127, 120, 20, $CBS_DROPDOWNLIST)

GUICtrlSetData(-1, "travian.si", "travian.si") ; add other item snd set a new default

$_Server2 = GUICtrlCreateCombo("s3.", 220, 127, 60, 20, $CBS_DROPDOWNLIST)

GUICtrlSetData(-1, "s2.|s3.|s4.|s5.|s6.|s7.|s8.|s9.|s10.|speed.", "s3") ; add other item snd set a new default

$Gumb = GUICtrlCreateButton("OK", 170, 200, 150)

GUISetState(@SW_SHOW)

While 1

$msg = GUIGetMsg()

$Upor = GUICtrlRead($_Upor)

$Geslo = GUICtrlRead($_Geslo)

$Server = GUICtrlRead($_Server)

$Server2 = GUICtrlRead($_Server2)

Select

Case $msg = $GUI_EVENT_CLOSE

Exit

Case $msg = $Gumb And $Upor = ""

MsgBox(0, "Error", "Error. Please enter Your UserName")

Case $msg = $Gumb And $Geslo = ""

MsgBox(0, "Error", "Error. Please enter Your PassWord")

Case $msg = $Gumb

$Preverjam = GUICreate("Login checker", 250, 100)

$Delam = GUICtrlCreateLabel("Initializing, please wait ...", 20, 10)

$Bar = GUICtrlCreateProgress(20, 40, 200, 20)

GUISetState(@SW_SHOW)

$IE1 = _IECreate($Server2 & $Server, 0, 1, 1, 0)

$Load1 = _IELoadWait($IE1, 0, 10000)

If $Load1 = 0 Then

MsgBox(0, "Error", "Cannot open " & $Server & ". Please make sure that you entered correct URL and check if site is online.")

_IEQuit($IE1)

Exit

EndIf

$Form = _IEFormGetObjByName($IE1, "snd")

$oElements = _IETagNameGetCollection ($IE1, "input")

$Uporabnik = _IEFormElementGetObjByName($Form, "ead62fc")

$Pw = _IEFormElementGetObjByName($Form, "ebd7f40")

_IEFormElementSetValue($Uporabnik, $Upor)

_IEFormElementSetValue($Pw, $Geslo)

If $Uporabnik = 0 Then

MsgBox(0, "Napaka", "Error code 001. Pri

Travian_BOT.rar

Edited by DoctorSLO
Link to comment
Share on other sites

I still have this problem ... read first post ... can someone make an example how can I get it?

Edit: ok I finally got it ...

But still I need answer how can I reduce time of this :

For $l = 0 To 100000 Step 1

Or I have to use another function? Please help ;(

Edited by DoctorSLO
Link to comment
Share on other sites

Thanks Brett, I do it from example in help file, because is hard to understand this thing ...

So if anyone have time to explain me what this means xD

While 13
    $_Zito = IniRead("files\surovine.ini", "SUROVINE", "Zito", "100")
    $array = StringRegExp($Preberi, '(?i)<TD id=l1 title=13>' & $_Zito & '/(.*?)(?i)', 1, $nOffset)
    
    If @error = 0 Then
        $nOffset = @extended
    Else
        ExitLoop
    EndIf
    for $i = 0 to UBound($array) - 1
       InIWrite("files\surovine.ini", "KAPACITETA", "Zito", $array[$i])
   Next
Wend

So ... I have a questions from this example .. It must be there $array or it can be other variable? And what this means : (?i) (probably where to start search or what?). And this can match any string: (.*?) or no? This is not in help file ... :)

And then at least, what this line means: for $i = 0 to UBound($array) - 1

Thx

Link to comment
Share on other sites

Ugh nice work DoctorSLO !!! =)

Don't forget its coming 3.5 and 4.0 servers!! it will be bot secure ...

On .ORG just started 3.5 Server (speed3X) Evolution and programs like that not working ...

I'm making bot we can work together =P.

BTW... I'm from Slovenia like u =)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...