Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/28/2014 in all areas

  1. Usually you get IP info by connecting to some site that echoes your IP address. The bad thing about that method is almost proverbial need of site administrators to make changes to sites or their policies requiring from you to frequently update your code. Another issue could be caching thingy of the Inet approach. I did some reading about alternative ways to get public IP, and initially tried with SMTP. This Works great but it's kind of slow and on top of that some ISPs tend to block users on port 25 to prevent spam. Then further reading lead me to STUN protocol documentation. STUN servers are made to resolve and echo users' IP addresses, and are often used by VoIP services. The protocol is extremly simple and everything happens very quickly. Client connects (it's UDP so you Know what Imean), sends request, server replies, client parses the response and IP is there. RFC5389 describes STUN in details, so knock yourself out, if you are that crazy. I have found some implementations written in c++ and c sharp, but OMG, some people are just to stubborn and love to write incomprehensible idiotic hundreds of thousands kilobytes of code for something as simple as STUN. That went nowhere for me and gave me only the pain, so I just fall back to RFC and wrote my own client based on documentation. Function is called STUN_GetMyIP() and you can find example of usage in this little script. It's UDP this and UDP that: STUN.au3 If something wouldn't work, do say.
    1 point
  2. Hello I made a set of pop3 functions, based on the pop3 RFC and the wonderfull abilities of the 3.1.1.110 au3 beta version. You will find in the zip file a sample script, and of course the library. The functions are : _pop3Connect (server, login, passwd [, port]) _Pop3Dele(msg_number) _Pop3List([msg_number]) _Pop3Noop() _Pop3Quit() _Pop3Retr(msg_number) _Pop3Rset() _Pop3Stat() _Pop3Top(msg_number, lines) _Pop3Uidl([msg_number]) I'm sure you bot coders will love it Have fun ! Apzo. [Edit] 2008, Oct 29. Thanks to Alexandre Beloin, the _pop3Disconnect() has been updated. The zip file has been updated too. [/Edit] _pop3.zip
    1 point
  3. mikell

    FileRead question

    $txt = FileRead("1.txt") $txt = StringRegExpReplace($txt, '(.*\R){19}', "") Msgbox(0,"", $txt)
    1 point
  4. Herb191

    FileRead question

    One way... $sFilePath = @ScriptDir & "\test.txt" $iLineCount = 19 $hFileOpen = FileOpen($sFilePath) $sFileRead = "" While 1 $iLineCount = $iLineCount + 1 $sLine = FileReadLine($hFileOpen, $iLineCount) If @error Then ExitLoop $sFileRead &= $sLine & @CRLF WEnd FileClose($hFileOpen) MsgBox(0, "", $sFileRead)
    1 point
  5. What is"$RETURN = $STACK[$UBOUND - 1]" in your POP function?
    1 point
  6. Oh yes I did, but the answer made me dazed and silenced
    1 point
  7. Nobody seems to have frown on this: Local $number = 250 ... Case $number <= 300 > 200 While this is valid syntax, the outcome differs from what the author intends. This will evaluate as: ($number <= 300) > 200 that is True > 200 giving False
    1 point
  8. $oIE.document.parentwindow.execscript("javascript:" & $js) funny script
    1 point
  9. Here is the IE way #include <IE.au3> $oIE = _IECreate("https://www.autoitscript.com/site/autoit/", 0, 0, 0) Do $html = _IEDocReadHTML($oIE) Until StringInStr($html, "description") $oIE.Stop() $oTags = _IETagNameGetCollection($oIE, "meta") For $oTag in $oTags If $oTag.name = "description" Then Msgbox(0,"", $oTag.content ) Next $oIE.Quit() Else can you give us an example of link causing trouble ?
    1 point
  10. I think that this function might help you? _IETagNameGetCollection
    1 point
  11. Here another variant: $iNumber = 500 For $i = 100 To 700 Step 100 If ($iNumber / $i) <= 1 Then Call("Func" & $i / 100) ExitLoop EndIf Next Func Func1() MsgBox(0, "Function1", "< 100") EndFunc Func Func2() MsgBox(0, "Function2", "> 100 to <= 200") EndFunc Func Func3() MsgBox(0, "Function3", "> 200 to <= 300") EndFunc Func Func4() MsgBox(0, "Function4", "> 300 to <= 400") EndFunc Func Func5() MsgBox(0, "Function5", "> 400 to <= 500") EndFunc Func Func6() MsgBox(0, "Function5", "> 500 to <= 600") EndFunc Func Func7() MsgBox(0, "Function6", ">= 600") EndFunc Br, UEZ
    1 point
  12. Jon

    AutoIt v3.3.13.19 Beta

    There's no reason it couldn't just pass the value and throw away any modifications. Which is what the com code does with byref in some cases iirc.
    1 point
×
×
  • Create New...