Arclite86 Posted March 31, 2014 Posted March 31, 2014 this is what i have: Local $i = _GUICtrlListBox_GetCount($list1) GUICtrlSetData($Edit15,$i) Do Call ("scanner") Until $i $i counts the number of names in $list1 than I want to repeat the "scanner" function until $i (counted names in $list1) but it doesnt work, can sombody help me.
Geir1983 Posted March 31, 2014 Posted March 31, 2014 Do you want to call the function $i times, or do you want to call it until it returns the same as $i?
JohnOne Posted March 31, 2014 Posted March 31, 2014 Show func scanner AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Arclite86 Posted March 31, 2014 Author Posted March 31, 2014 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: expandcollapse popupFunc 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
Geir1983 Posted March 31, 2014 Posted March 31, 2014 Local $i = _GUICtrlListBox_GetCount($list1) GUICtrlSetData($Edit15,$i) For $idx=1 To $i Call ("scanner") Next
JohnOne Posted March 31, 2014 Posted March 31, 2014 For $idx=1 To $i scanner() Next No need for Call. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Arclite86 Posted March 31, 2014 Author Posted March 31, 2014 Local $i = _GUICtrlListBox_GetCount($list1) GUICtrlSetData($Edit15,$i) For $idx=1 To $i Call ("scanner") Next Thanks
Arclite86 Posted March 31, 2014 Author Posted March 31, 2014 For $idx=1 To $i scanner() Next No need for Call. Thank you too
Arclite86 Posted March 31, 2014 Author Posted March 31, 2014 does somebody know how to read a few line from a text file and than sum them up something like line1 + line2 + line3 etc.. =..
Arclite86 Posted March 31, 2014 Author Posted March 31, 2014 no sorry that not what i meant in the list a have a few lines with numbers, like: line1=787 line2=388 line3= 482 but how sum them up?
Arclite86 Posted March 31, 2014 Author Posted March 31, 2014 The '+' should work but how can i write it as a good function do I have to use: line1+line2+line3 etc, i have about 40 lines and the list grows daily I know i have to do something with Local $i = _GUICtrlListBox_GetCount($list1) GUICtrlSetData($Edit15,$i) to read the lines in total of a list, but thats all,..
mikell Posted March 31, 2014 Posted March 31, 2014 (edited) 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 March 31, 2014 by mikell
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