MazeMiami Posted December 8, 2008 Posted December 8, 2008 I been browsing the forums continuously looking for the best method to parse a string of datai want to paste this peace to data from my web site into two different inputs Example:123456:9090 ip: 123456port: 9090 you can find the site here http://adllure.com/test.htmlI would highly appreciate if someone can show me an example of this thank you in advance
nikink Posted December 8, 2008 Posted December 8, 2008 StringSplit would seem to be the easiest option.
MazeMiami Posted December 8, 2008 Author Posted December 8, 2008 (edited) StringSplit would seem to be the easiest option. yea but i just dont get it lol #Include <String.au3> IP = _StringSplit ("123456:9090", ":" ) msg(,"test", $IP ) nothing ;( Edited December 8, 2008 by MazeMiami
Josbe Posted December 8, 2008 Posted December 8, 2008 yea but i just dont get it lol #Include <String.au3> IP = _StringSplit ("123456:9090", ":" ) msg(,"test", $IP ) nothing ;(Read the manual about the StringSplit() and arrays. $sIP= "123456:9090" $aIP = StringSplit ($sIP, ":" ) MsgBox(0,$aIP[1], $aIP[2] ) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
billthecreator Posted December 8, 2008 Posted December 8, 2008 (edited) #include <INet.au3> #include <String.au3> #include <array.au3> $File =_INetGetSource("http://adllure.com/test.html") $Array = _StringBetween($File, "<body>", "</body>") $IP = StringSlpit($Array,":") GuiCtrlSetData($Input1, $IP[1]) GuiCtrlSetData($Input2, $IP[2]) Edited December 8, 2008 by billthecreator [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap
MazeMiami Posted December 9, 2008 Author Posted December 9, 2008 (edited) Yep that worked perfect and helped me do a lot of diffrent thing with my code Thanks a TON!! now i would like to codee a script that can add an ip to a .txt and then check for duplicate if duplicate then exit, right now my code can just look up the current ip and if same exit $oIE = _IECreate ("http://doamin/getip.php") $Dup =_IEBodyReadText($oIE) if $Dup = $IP Then Exit any idea what best practices would be for this Edited December 9, 2008 by MazeMiami
billthecreator Posted December 9, 2008 Posted December 9, 2008 im guessing you want this: #include <INet.au3> #include <String.au3> #include <array.au3> $IpFile = "IPfile.ini" $GetIp = IniRead($IpFile, "IP", "Value", "") $File =_INetGetSource("http://adllure.com/test.html") $Array = _StringBetween($File, "<body>", "</body>") $IP = StringSlpit($Array,":") If $IP[1] = $GetIp Then Exit IniWrite($IpFile, "IP", "Value", $IP[1]) [font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap
MazeMiami Posted December 10, 2008 Author Posted December 10, 2008 im guessing you want this: #include <INet.au3> #include <String.au3> #include <array.au3> $IpFile = "IPfile.ini" $GetIp = IniRead($IpFile, "IP", "Value", "") $File =_INetGetSource("http://adllure.com/test.html") $Array = _StringBetween($File, "<body>", "</body>") $IP = StringSlpit($Array,":") If $IP[1] = $GetIp Then Exit IniWrite($IpFile, "IP", "Value", $IP[1]) Just played with this but it doesn't seem to be writing the proxy to the .ini file
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