Sign in to follow this  
Followers 0
xZZTx

File R/W Help?

5 posts in this topic

#1 ·  Posted (edited)

Hi i have been playing with the File Read and Wright along with Ping() so i made a Multi Ping type deal

only flaw is that in the txt doc it can only have the ips to ping and on the last line have END

but most ips that i can get are like this

##.##.##.##:Port Number then just a bunch of nonesence over here

so i was wondering of anyone could give me a way to remove everything past the :

here is the script btw

Global $N,$Time,$Address,$N2,$Saved_Address,$Num,$Ping
#include <GUIConstants.au3>
#include <ProgressConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Multi Ping", 248, 125, (@DesktopWidth-248)/2, (@DesktopHeight-125)/2)
$Progress1 = GUICtrlCreateProgress(8, 80, 233, 25)
$Label1 = GUICtrlCreateLabel("Looking Up Address's Speed", 48, 24, 141, 17)
$T_N = GUICtrlCreateLabel($N, 72, 53, 22, 17)
$Label3 = GUICtrlCreateLabel("Out Of", 96, 53, 35, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

$Time = 1000
While 1
    $N2 += 1
    $N1 = FileReadLine("proxy list.txt",$N2)
    If $N1 = "END" Then
        $End = $N2
        ExitLoop
    EndIf
WEnd
$T_End = GUICtrlCreateLabel($End, 136, 53, 22, 17)
While 1
    $nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
GUICtrlSetData($T_N,$N)
GUICtrlSetData($Progress1,(($N/$End)*100))
$Address = FileReadLine("proxy list.txt",$N)
If $Address = "END" Then
    $M = MsgBox(4,"Copy?","Address Number "&$Num&" Address "&$Saved_Address&" With A Ping Of "&$Time&@CRLF&@CRLF&"   Do You Want To Copy To ClipBoard?")
    If $M = 6 Then ClipPut($Saved_Address)
    If $M = 7 Then Exit 2
    Exit
EndIf
$Ping = Ping($Address,500)
If $Ping = 0 Then
Else
If $Time > $Ping Then
    $Saved_Address = $Address
    $Time = $Ping
    $Num = $N
EndIf
EndIf
$N += 1
WEnd
Edited by xZZTx

Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..

Share this post


Link to post
Share on other sites



Could You Give Me an Example?


Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..

Share this post


Link to post
Share on other sites

Well I don't know what the expression for RegExp would be off hand but for StringSplit() you could do something like this

CODE
For $i = 0 To FileCountLines($file)

$test = StringSplit(FileReadLine($file,$i)," :")

MsgBox(0,"info", "Your ip/port is " & $test[1])

Next

Please note this is just an example and may not work but it should point you in the right direction.

Share this post


Link to post
Share on other sites

o thx that's what i needed


Sorry For Any Spelling / Grammar Errors I May Make.... I Failed English Wayyyy To Many Times..

Share this post


Link to post
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
Sign in to follow this  
Followers 0