Jump to content

Do..Untill


Recommended Posts

Do you want to call the function $i times, or do you want to call it until it returns the same as $i?

I want to call the function $i times,

 

Show func scanner

this is the function:

Func scanner()

    $link = GUICtrlRead($list1)

$oIe  =_IECreate("https://twitter.com/"&$link,0,0,1,1)
_IENavigate($oIe, "https://twitter.com/" &$link)

$oIe = _IEAttach("Twitter")

If @error = $_IEStatus_NoMatch Then
    ConsoleWrite("tab niet gevonden" & @CRLF)
    Exit
EndIf

$oLinks = _IELinkGetCollection($oIe)

If @error = $_IEStatus_Success Then
    $linkCnt = @extended
    ConsoleWrite("Link count = " & $linkCnt & @CRLF)

    For $oLink In $oLinks
        If $oLink.className = 'js-nav' Then
            If $oLink.getAttribute('data-nav') = 'followers' Then
                                            $4er =  _GUICtrlListBox_GetCurSel($List2)
 _GUICtrlListBox_ReplaceString($List2, $4er, ""& $oLink.innerText)
                ConsoleWrite('Followers = ' & $oLink.innerText & @CRLF)


    ;_GUICtrlListBox_AddString ($list2,""& $oLink.innerText)
            ;   $4GG =  _GUICtrlListBox_GetCurSel($List2)
;_GUICtrlListBox_ReplaceString($List2, $4GG, ""& $oLink.innerText)


$text = _GUICtrlListBox_GetCurSel($List2)
_GUICtrlListBox_ReplaceString($List2,$text,""& $oLink.innerText)

            EndIf
        EndIf
    Next
EndIf




$oLinks2 = _IELinkGetCollection($oIe)
    For $oLink2 In $oLinks2
        If $oLink2.className = 'js-nav' Then
            If $oLink2.getAttribute('data-nav') = 'following' Then
                ConsoleWrite('following = ' & $oLink2.innerText & @CRLF)
                                            $4er =  _GUICtrlListBox_GetCurSel($List3)

;_GUICtrlListBox_AddString ($list3,""& $oLink2.innerText)
;                           $4er =  _GUICtrlListBox_GetCurSel($List3)
 ;_GUICtrlListBox_ReplaceString($List3, $4er, ""& $oLink2.innerText)


$text =  _GUICtrlListBox_GetCurSel($List3)
_GUICtrlListBox_ReplaceString($List3,$text,""& $oLink2.innerText)

            EndIf
        EndIf
    Next



            $iIndex += 1
            If $iIndex = _GUICtrlListBox_GetCount($List1) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List1, $iIndex)

            If $iIndex = _GUICtrlListBox_GetCount($List2) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List2, $iIndex)

                        If $iIndex = _GUICtrlListBox_GetCount($List3) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List3, $iIndex)


            If $iIndex = _GUICtrlListBox_GetCount($List4) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List4, $iIndex)




            If $iIndex = _GUICtrlListBox_GetCount($List5) Then $iIndex = 0
            _GUICtrlListBox_SetCurSel($List5, $iIndex)
_IEQuit ($oIe)
EndFunc
Link to comment
Share on other sites

Assuming the numbers are in the lines of the listbox

Local $count = _GUICtrlListBox_GetCount($list1)
Local $item, $total = 0
For $index = 0 to $count-1
   $item = _GUICtrlListBox_GetText($list1, $index)
   $total += Number($item)
Next
Msgbox(0,"", $total)

Edit

You really should read and re-read the helpfile...

Edited by mikell
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...