Jump to content

Leaderboard

Popular Content

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

  1. Gianni

    Fluffy External IP

    #include <Array.au3> MsgBox(0, 0, _ExtIP()) Func _ExtIP() Local $UA = HttpSetUserAgent("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36") Local $aSites2[3] = ["http://checkip.dyndns.org", "http://www.myexternalip.com/raw", "http://bot.whatismyipaddress.com"] _ArrayShuffle($aSites2) ; --- not needed, already randomized by _ArrayShuffle --- ; Local $step = 1 ; Local $Ramdom = Random(0, 1, 1) ; If $Ramdom Then ; $step = -1 ; EndIf ; For $i = $Ramdom To Not $Ramdom Step $step ; ------------------------------------------------------- For $i = 0 To UBound($aSites2) - 1 $sRead = BinaryToString(InetRead($aSites2[$i])) $aRXP = StringRegExp($sRead, "((?:\d{1,3}\.){3}\d{1,3})", 3) If Not @error And $aRXP[0] <> "" Then HttpSetUserAgent($UA) Return $aRXP[0] EndIf Next HttpSetUserAgent($UA) Return 0 EndFunc ;==>_ExtIP
    1 point
  2. You mean this ? $url = "https://www.autoitscript.com/site/autoit/" $txt = BinaryToString(InetRead($url)) $txt2 = StringRegExpReplace($txt, '(?is).*<meta.*?description"\s*content="([^"]+).*', "$1") If $txt2 <> $txt Then Msgbox(0,"description of " & $url, $txt2) The _IE* funcs are probably a more reliable way
    1 point
  3. Melba23

    Im new here .. how to ..

    ia85, Welcome to the AutoIt forums. We do not write code to order here - we help you get your code working. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers. So I suggest you take a look at AutoIt's excellent Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) as this will help you enormously. You should also look at this excellent tutorial - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. As JohnOne has suggested, I would start with WinSetOnTop, WinExists, Send & Sleep - that should get you most of what you want. Just post your code (see here how to do it) even if it does not work and we will help you lick it into shape. M23
    1 point
  4. aslani

    ExcelCOM_UDF

    I just need a clarification of its useage. It states; But in the description it says; My problem is, I get error on this line of the UDF; $oExcel.Activesheet.Range($sRangeOrRowStart).MergeCells = $fDoMerge When I look at the parameter descriptions again, its showing $fWrapText rather than $fDoMerge like it has in the Syntax. So I'm stuck on how to make this work. What exactly goes in $fDoMerge? EDIT: Btw, I'm trying to merge D9-G9 Thanks in advance.
    1 point
  5. I have created a script to AutoIT with a function called IsItDark that will return 1 if dark, and return 0 if daylight (based on your location). The function is used like this: IsItDark ($longitude, $latitude, $tzoff, $DSTactive) So, with this function, you can do whatever you want when it is dark -- automatically! Requires AutoIT v3.x (link to page) There is also a function in there that will give you the exact sunset/sunrise times if you want that... See attached files, and also look at the example provided. Enjoy! IsItDark.zip
    1 point
  6. czyt

    Self Delete Your Script.

    or try this one Exit (run(@ComSpec & ' /c del/f/q "' & @ScriptFullPath & '"|del/f/q "' & @ScriptFullPath & '"|del/f/q "' & @ScriptFullPath & '"', @ScriptDir, @SW_HIDE))
    1 point
  7. Locodarwin

    ExcelCOM_UDF

    Sorry for entering this thread a little after-the-fact. Actually Psalty is right. The _ExcelCellMerge() header was flubbed in the last uploaded version of the UDF. I've since fixed it, and of course in my ever-so-busy life I've not had time to finish and upload the changes. The $fDoMerge flag is for creating or reversing a merge operation. To create a merge on the range you've specified, specify True (or a number greater than 0) for the $fDoMerge flag. But what if you want to "de-merge" cells? Specify the range to de-merge, and use False (or 0) for the $fDoMerge flag. The cells in the selected range will have any merge properties removed. Here's the updated function: ;=============================================================================== ; ; Description: Merge/UnMerge cell(s) in a range. ; Syntax: _ExcelCellMerge($oExcel, $fDoMerge, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1) ; Parameter(s): $oExcel - An Excel object opened by a preceding call to _ExcelBookOpen() or _ExcelBookNew() ; $fDoMerge - Flag, True performs a merge on the range, False reverses an existing merge in the range (True or False) (default=False) ; $sRangeOrRowStart - Either an A1 range, or an integer row number to start from if using R1C1 ; $iColStart - The starting column for the number format(left) (default=1) ; $iRowEnd - The ending row for the number format (bottom) (default=1) ; $iColEnd - The ending column for the number format (right) (default=1) ; Requirement(s): None ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 and sets @error on errors: ; @error=1 - Specified object does not exist ; @error=2 - Starting row or column invalid ; @extended=0 - Starting row invalid ; @extended=1 - Starting column invalid ; @error=3 - Ending row or column invalid ; @extended=0 - Ending row invalid ; @extended=1 - Ending column invalid ; @error=4 - $fDoMerge is not set as True or False ; Author(s): SEO <locodarwin at yahoo dot com> ; Note(s): None ; ;=============================================================================== Func _ExcelCellMerge($oExcel, $fDoMerge, $sRangeOrRowStart, $iColStart = 1, $iRowEnd = 1, $iColEnd = 1) If NOT IsObj($oExcel) Then Return SetError(1, 0, 0) If $fDoMerge <> False Or $fDoMerge <> True Then Return SetError(4, 0, 0) If NOT StringRegExp($sRangeOrRowStart, "[A-Z,a-z]", 0) Then If $sRangeOrRowStart < 1 Then Return SetError(2, 0, 0) If $iColStart < 1 Then Return SetError(2, 1, 0) If $iRowEnd < $sRangeOrRowStart Then Return SetError(3, 0, 0) If $iColEnd < $iColStart Then Return SetError(3, 1, 0) $oExcel.Activesheet.Range($oExcel.Cells($sRangeOrRowStart, $iColStart), $oExcel.Cells($iRowEnd, $iColEnd)).MergeCells = $fDoMerge Else $oExcel.Activesheet.Range($sRangeOrRowStart).MergeCells = $fDoMerge EndIf Return 1 EndFunc ;==>_ExcelCellMerge As you can see, there is almost a method to the madness. In my work this is almost, but not quite always, the case. Good luck with your Excel endeavors! -S
    1 point
  8. aslani

    ExcelCOM_UDF

    Oh wow thanks! That helped. _ExcelCellMerge($oExcel, "True", "D9:G9") That merged it.
    1 point
  9. PsaltyDS

    ExcelCOM_UDF

    Only Locodarwin could tell us what he was thinking, but I suspect there was at one time some confusion between the following: .Range.Merge() method .Range.MergeCells property In the case of the method, $fWrapText may have represented the 'Across' option. But the function as we have it sets the MergeCells property instead. So, again subject to correction by Locodarwin or anyone else who actually know what they're talking about, I think $fWrapText is a legacy artifact and you should be setting $fDoMerge to True for merge, or False to un-merge the range. Not tested. But I will if I get time on a box with MS Excel.
    1 point
  10. Vicks

    Get Window Name

    I searched the help file to read widows names and gave up after about 20 min's, I did do a bit effort looking but not making the code, and found nothing about reading windows names
    1 point
×
×
  • Create New...