Jump to content

weaponx

MVPs
  • Posts

    5,295
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by weaponx

  1. Can you provide an example of a feed like this?
  2. Very cool. I am confused by the code a bit but I have some suggestions to take it to the next level. -Directional movement based on mouse position -Speed modifier -Size jitter -Nebula background image -Eliminate stars along X and Y axis, they seem to reduce the "effect" -TIE Fighters -Rocks that when split when fired at, and then those fragments split when fired at, etc...
  3. http://www.autoitscript.com/forum/index.php?showtopic=58836
  4. I hope so. Pretty much every answer exists in this topic concerning XML, the same general questions keep getting asked over and over.
  5. This format is correct, it's just not indented properly.
  6. This is why you can just put some error checking in your script. If the object can't be created, alert the user to download the Windows Script runtime. http://www.microsoft.com/downloads/details...;displaylang=en
  7. I'm not sure if you're saying it's wrong but it works for me. Red 0xff0000 -> Cyan 0x00ffff Green 0x00ff00 -> Magenta 0xff00ff Blue 0x0000ff -> Yellow 0xffff00
  8. ConsoleWrite(_InvertColor(0x000000)) Func _InvertColor($iColor) Return 0xFFFFFF - $icolor EndFunc ;==>_InvertColor
  9. #545172 http://www.autoitscript.com/forum/index.ph...mp;#entry534828 I have posted all of these at some point. $original = "20080613104425.484375-240" ;Convert WMI date to YYYY/MM/DD HH:MM:SS $new = StringRegExpReplace($original, "\A(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(?:.*)","$1/$2/$3 $4:$5:$6") debug($new) ;Convert WMI date to MM/DD/YYYY HH:MM:SS $new = StringRegExpReplace($original, "\A(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(?:.*)","$2/$3/$1 $4:$5:$6") debug($new) ;Convert YYYYMMDD.RRR to MM/DD/YYYY Rev. RRR $original = "20080811.016" $new = StringRegExpReplace($original, "\A(\d{4})(\d{2})(\d{2})\.(\d{3})","$2/$3/$1 Rev. $4") debug($new) ;Convert YYYY/MM/DD to MM/DD/YYYY $original = "1980/04/30" $new = StringRegExpReplace($original, "\A(\d*)/(\d*)/(\d*)","$2/$3/$1") MsgBox(0,"","Before: " & $original & @CRLF & "After: " & $new) debug($new) ;Convert MM/DD/YYYY to YYYY/MM/DD $original = "04/30/1980" $new = StringRegExpReplace($original, "\A(\d*)/(\d*)/(\d*)","$3/$1/$2") MsgBox(0,"","Before: " & $original & @CRLF & "After: " & $new) debug($new) ;Convert YYYYMMDDHHMMSS to YYYY-MM-DD HH:MM:SS $original = "20090415153030" $new = StringRegExpReplace($original, "\A(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(?:.*)","$1-$2-$3 $4:$5:$6") debug($new) ;Phone number format $objRegEx = ObjCreate("VBScript.RegExp") $objRegEx.Global = 1 $objRegEx.Pattern = "(\d{3})-(\d{3})-(\d{4})" $strSearchString = "555-123-4567" $strNewString = $objRegEx.Replace($strSearchString, "($1) $2-$3") debug($strNewString) ;Phone number format $test = StringRegExpReplace($strSearchString, "(\d{3})-(\d{3})-(\d{4})", "($1) $2-$3") debug($test) Func debug($var) If IsArray($var) Then For $X = 0 to Ubound($var)-1 ConsoleWrite("[" & $X & "]: " & $var[$X] & @CRLF) Next Else ConsoleWrite($var) EndIf ConsoleWrite(@CRLF) EndFunc
  10. A little late but... $d = StringFormat("%i%02i%02i",@YEAR,@MON,@MDAY) MsgBox(0,"",$d)
  11. AutoIt isn't object oriented per-se, what you are seeing are COM objects created by ObjGet() or ObjCreate(). You won't get much support for these objects here and you are better off using Google.
  12. Return It's used in the majority of the examples in the help file. Read it.
  13. I think there may be a problem in the call to _GUICtrlButton_SetImage when you specify the icon id to extract. In that function there is a call to _WinAPI_ExtractIconEx which always returns an error on an *.ico file.
  14. This code displays a 48x48 icon for me. #include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <WindowsConstants.au3> GUICreate("Buttons", 300, 300) GUISetState() $btn = GUICtrlCreateButton("Button1", 10, 10, 64, 64, $BS_ICON) _GUICtrlButton_SetImage($btn, @DesktopDir & "\106.ico") While 1 $Msg = GUIGetMsg() If $Msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd
  15. Did you look in the "user defined functions" in the help file? #Include <GuiButton.au3> _GUICtrlButton_SetImage($hWnd, $sImageFile[, $nIconId = -1[, $fLarge = False]])
  16. Look up Opt() with MouseCoordMode
  17. This question has been asked SO MANY TIMES. Look in the FAQ at the top of this forum or do a search.
  18. #include <INet.au3> _INetGetSource ( $s_URL )
  19. This one is a pain in the ass, the onsubmit property always returns empty: #include <IE.au3> #include <array.au3> $oIE = _IEAttach("Download") ;http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=28e2fdb2-1aa5-4c84-8255-b3142ca2fe85 $oForm = _IEFormGetObjByName ($oIE, "quickCheck") ConsoleWrite(ObjName($oForm) & @CRLF) ConsoleWrite($oForm.onsubmit & @CRLF) ;EMPTY ConsoleWrite($oForm.getAttributeNode("onsubmit").value & @CRLF) ;CORRECT
  20. Use an array. $a[4] = [66, 90, 114, 138] MsgBox(0,"",$a[Random(0,3,1)])
  21. $str = "key=value" MsgBox(0,"",StringLeft($str,StringInStr($str,"=")-1) & @CRLF & StringTrimLeft($str,StringInStr($str,"=")))
  22. You can't use the same increment variable for the inner and outer loop. Use $i for the outer and $v for the inner or something like that.
  23. The links are anchor elements with a child div containing the text value, they don't have the typical text attribute. #include <IE.au3> $oIE = _IEAttach ("Microsoft Update") ;attaching windows update after Express button is pressed $oIFRAME = _IEFrameGetObjByName ($oIE, "eContent") $oLinks = _IELinkGetCollection ($oIFRAME) $iNumLinks = @extended $num = 0 ;MsgBox(0, "Link Info", $iNumLinks & " links found") For $oLink In $oLinks $num = $num + 1 If StringInStr($oLink.id, "aTitle") Then ;ConsoleWrite($num & " " & $oLink.href & ", Id: " & $oLink.id & @CRLF) ;$div = $oLink.innerHTML $div = $oLink.firstChild ConsoleWrite($div.innerText & @CRLF) EndIf Next
  24. First thing, _SendMessage is no longer in Misc.au3, it's in SendMessage.au3. Second, AutoIt doesn't like this call: $result3 = DllCall("user32.dll","int","GetWindowThreadProcessId","hwnd",$winampHWND,"int_ptr", $PID) $PID = $result3[2] You can just cheat and use this: $PID = ProcessExists("winamp.exe")
×
×
  • Create New...