Jump to content

Multiple loops conditions


Recommended Posts

Hello there!

First here is my code:

Func _OpenLink()
Local $OkChk
Local $iOk = 0
Local $array = FileReadToArray($Source)


Global Const $sUserName = "", $sPassword = "" ; set correct
$aListView = _GuiCtrlListView_CreateArray($hListView, Default)
$hSession =  _WinHttpOpen("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240", $WINHTTP_ACCESS_TYPE_NAMED_PROXY, Guictrlread($h_sProxy) & ":" & GuiCtrlRead($h_iPort))
$sHost = '127.0.0.1'
$sReq = _WinHttpConnect($hSession, $sHost, $INTERNET_DEFAULT_HTTPS_PORT)


For $i = 0 To UBound($array) - 1
    if $i > 0 Then
$sResponse = _WinHttpSimpleSSLRequest($sReq, 'GET', 'check=' & $array[$i] & @CRLF)

$ExpDate = _StringBetween($sResponse,'"exp":"', '"}')
$Type = _StringBetween($sResponse,'"type":"', '"')
            If StringInStr($sResponse, 'true') Then
                $iOk += 1
                $GetIt = GUICtrlCreateListViewItem($array[$i] & "| Yes" & "|" & $ExpDate[0] & "|" & $Type[0], $hListView)
                FileWrite($Dest, $array[$i] & " | " & $ExpDate[0] & " | " & $Type[0] & @CRLF)
                SoundPlay("s3.wav")
                EndIf
            If StringInStr($sResponse, 'used') Then
                GUICtrlCreateListViewItem($array[$i] & "| Used" & "|" & $ExpDate[0] & "|" & $Type[0], $hListView)
                EndIf
            If StringInStr($sResponse, 'not available') Then
                GUICtrlCreateListViewItem($array[$i] & "| Non available" & "|" & $ExpDate[0] & "|" & $Type[0], $hListView)
            EndIf
            If StringInStr($sResponse, 'unknown') Then
                GUICtrlCreateListViewItem($array[$i] & "| Unknown", $hListView)
            EndIf
EndIf

                GuiCtrlSetData($hLabel, $iOk & " ok on " & _GUICtrlListView_GetItemCount($hListView) & " on " & _FileCountLines($Source) & " - ETA: " & (((_FileCountLines($Source))-(_GUICtrlListView_GetItemCount($hListView)))*45)/60 & " minutes" )

Sleep(45000)
Next

EndFunc

What I want to do is switch between 3 proxies every 30 arrays, first proxy for first 30 arrays, second for the next 30, and 3rd for the next (Proxy 1: 0 to 30; proxy 2: 31-60; proxy 3: 61-90, then  loop that).

I tried with if $i > 30 then change the hSession variable to read $h_sProxy2 and $h_iPort2 (these are inputs for proxy 2), and if $i > 60 read $h_sProxy3, and so on, then if $i > 90, set $i to 0, but no luck, there must be somewhere where its overriden.

If someone could help, hope its not confusing.

 

Edited by xanathos
Link to comment
Share on other sites

  • Moderators

@xanathos Care to explain just what reason you would have to continuously switch between proxies?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

@xanathos so, the IT guy at your school is creating a blacklist, and you're looking to switch the proxies to get around that, is that the gist of it?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

1 minute ago, JLogan3o13 said:

@xanathos so, the IT guy at your school is creating a blacklist, and you're looking to switch the proxies to get around that, is that the gist of it?

Not really, its not the main purpose of the script, but to make it run in optimal way, it does require to switch between proxies, yes.

Link to comment
Share on other sites

  • Moderators

Main purpose of the script or not, it sounds as though you are bypassing security measure put into place by your IT team, which is against our forum rules. The topic is locked until you can convince me this is not the case.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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