Jump to content

buzz44

Active Members
  • Posts

    1,349
  • Joined

  • Last visited

Everything posted by buzz44

  1. So you fixed it? I think the AutoIt "IDE" is alot like most C++ IDE's, which can give you misleading errors, specially if you miss a semi-colon .
  2. That is the easiest way, and that SHOULD work. Is $DeadEnd a constant?
  3. And your SURE your not declaring $BlockH anywhere else?
  4. If your going to change them later why make them constants @@? Do you need to "protect" the original 16 and 11 values? If your not going to change the variables (meaning your calculations are correct), and not have them constant, just don't use them. Edit: Can you declare 2 variables on the same line in AutoIt? (I forget ). Perhaps... Global Const $BlockH = 11 Global Const $BlockW = 16
  5. , what line number does it indicate the error is on SimpleMindedFool?
  6. $BlkH / $BlkW arn't constants but, and hes not changing the values of $BlockH or $BlockW.
  7. Func _WaveVolGet() Local $WaveVol = -1, $p, $ret Const $MMSYSERR_NOERROR = 0 $p = DllStructCreate ("dword") If @error Then Return -1 EndIf $ret = DllCall("winmm.dll", "long", "waveOutGetVolume", "long", -1, "long", DllStructGetPtr ($p)) If ($ret[0] == $MMSYSERR_NOERROR) Then $WaveVol = Round(Dec(StringRight(Hex(DllStructGetData ($p, 1), 8), 4)) / 0xFFFF * 100) EndIf DllStructDelete ($p) Return $WaveVol EndFunc ;==>_WaveVolGetTry this, thanks to gafrost . I THINK it should return 0 if the sound is muted but I can't test it, sorry. Edit: Try here for a slightly updated version of the function > http://www.autoitscript.com/forum/index.ph...p;hl=sound+mute
  8. If you just want the illusion of the mouse not moving you could click the Start button then return the mouse to its original position, the user would only see a flicker. Alternatively, if you need to click the start button, try the Windows key .
  9. Do you mean addition and subtraction of time? If so you might want to look at some UDF's I created a while back > _TimeAdd/_TimeSub.
  10. You want to put it in a function and call it whenever you need it. While 1 _DoStuff() WEnd Func _DoStuff() MouseClick("left", 89, 221) Sleep(500) MouseClick("left", 130, 367) Sleep(1500) Send("{PGDN}") Sleep(500) MouseClick("left", 119, 563) Sleep(1000) Send("Skerb's Message") Sleep(1000) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) Send("{TAB}") Sleep(200) EndFunc ? *WARNING* The above script will call the fcuntion over and over again sending keystrokes and clicking. I couldn't be bothered adding a Hotkey and just wanted to show you how to do it ^6^.
  11. Can you post an example or some pseudocode?
  12. ; Generated by AutoIt Scriptomatic $strComputer = InputBox("Printer Shares", "Enter IP or Server Name") If Not @error Then $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $Output = "" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet ("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT * FROM Win32_PrinterShare", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj ($colItems) then For $objItem In $colItems $Output = StringTrimRight (StringMid ($objItem.Dependent, StringInStr ($objItem.Dependent, '="') +2), 1) If MsgBox (1, "WMI Output", $Output) = 2 Then ExitLoop $Output = "" Next Else MsgBox (0, "WMI Output", "No WMI Objects Found for class: " & "Win32_PrinterShare") EndIf EndIfThe above was transcribed by Gary. I can't test it because I don't have Admin rights on this computer .
  13. I knew my SQL experience would come in handy sometime lol ! I'll look into it when I get home JS .
  14. Just copy/paste the code I provided @@.
  15. If you can, kill explorer at the start of the script, and run it again using... Run ("explorer.exe") ;and ProcessClose ("explorer.exe")Or only do that IF a file is in use.
  16. What error message?
  17. http://www.autoitscript.com/forum/index.ph...c=8442&st=0 http://www.autoitscript.com/forum/index.ph...=20251&st=0 http://www.autoitscript.com/forum/index.ph...7807&hl=OCR http://www.autoitscript.com/forum/index.ph...=15349&st=0 http://www.autoitscript.com/forum/index.ph...8404&hl=OCR http://www.autoitscript.com/forum/index.ph...1231&hl=OCR
  18. DriveMapDel("X:") DriveMapAdd("X:", "\\server\share") Run("C:\Make.exe " & @UserName & ' "X:"') DriveMapDel("X:") DriveMapAdd(":", "\\server\share\" & @UserName)
  19. You can't accomplish what you want to do with COM?
  20. Type "Obj/COM Reference" in the helpfile?
  21. $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") $colPrinters = $objWMIService.ExecQuery("Select * from Win32_Printer") ; Query all printers installed. For $objItem In $colPrinters $PrinterName = StringSplit($objItem.Name, "\") ; Split the server(s)/printer(s) name up. If NOT @Error Then ; Check if there is a "\" in the string. $iLastElement = UBound($PrinterName) - 1 ; Retrieve the printer name. If $PrinterName[$iLastElement] <> "HP Color LaserJet 5550 PS" Then ; Check if the printer is already installed. Run("rundll32 printui.dll,PrintUIEntry /if /b ""HP Color LaserJet 5550 PS " & _ "/f \\server\Shared\files\printers\HP5550\PS\hpc5550d.inf /r " & _ "IP_192.xx.xxx.xxx"" /m ""HP Color LaserJet 5550 PS"" ", @SystemDir) Exit ; Install the printer then exit so that the printer isn't installed again. EndIf EndIf NextoÝ÷ Ù´ëÊØZ´Z½é÷öÖÞzvëhµë-Úk¢«,µ»­²ëÊáßîN¼­+¢¶¬íz»Þ®È¨«­¢+ØÀÌØí½©]5%MÉÙ¥ô=©Ð ÅÕ½ÐíÝ¥¹µµÑÌèÀäÈìÀäÈìÅÕ½ÐìµÀì ½µÁÕÑÉ9µµÀìÅÕ½ÐìÀäÈíɽ½ÐÀäÈí¥µØÈÅÕ½Ðì¤(ÀÌØí½±AÉ¥¹ÑÉÌôÀÌØí½©]5%MÉÙ¥¹áEÕÉä ÅÕ½ÐíM±Ð9µI=4]¥¸ÌÉ}AÉ¥¹ÑÈ]!I9µôÌäí!@ ½±½È1ÍÉ)ÐÔÔÔÀALÌäìÅÕ½Ðì¤ìEÕÉäÑ¡Ìäí!@ ½±½È1ÍÉ)ÐÔÔÔÀALÌäìÁÉ¥¹Ñȸ()%9½ÐÀÌØí½±AÉ¥¹ÑÉ̹ ½Õ¹ÐQ¡¸ì%Ñ¡ÁÉ¥¹Ñȥ͸ÌäíÐ¥¹Íѱ±Ñ¡¸¥¹Íѱ°¥Ð¸(IÕ¸ ÅÕ½ÐíÉÕ¹±°ÌÈÁÉ¥¹ÑÕ¤¹±°±AÉ¥¹ÑU%¹ÑÉä½¥½ÅÕ½ÐìÅÕ½Ðí!@ ½±½È1ÍÉ)ÐÔÔÔÀALÅÕ½ÐìµÀì|($ÅÕ½Ðì½ÀäÈìÀäÈíÍÉÙÈÀäÈíM¡ÉÀäÈí¥±ÌÀäÈíÁÉ¥¹ÑÉÌÀäÈí!@ÔÔÔÀÀäÈíALÀäÈí¡ÁÔÔÔÁ¹¥¹½ÈÅÕ½ÐìµÀì|(ÅÕ½Ðí%A|Ääȹáà¹ááà¹ááàÅÕ½ÐìÅÕ½Ðì½´ÅÕ½ÐìÅÕ½Ðí!@ ½±½È1ÍÉ)ÐÔÔÔÀALÅÕ½ÐìÅÕ½ÐìÅÕ½Ðì°MåÍѵ¥È¤)¹% I'm also looking into the AddPrinterConnection WMI so you don't have to use Run(), but it won't work for Windows 2000/NT and Windows 98/95 and I'm having slight trouble coding/understanding it ^^.
  22. What is your current script? To get in it 12 hour format simply do the Hour - 12 (ie. 16 - 12 = 4). As for the Day/Month/Year, use StringSplit() and re-order them or change the regional settings on your computer. Seek the helpfile's "Date Management" catergory in Contents for further enlightenment .
  23. $URL = "http://www.autoitscript.com/forum/index.php?" RunWait(@ComSpec & " /c start " & $URL)
  24. Try this? $test1 = "00:50" $test2 = "00:40" MsgBox(0,"Time", "$test1 = " & $test1 & @CRLF & "$test2 = " & $test2) MsgBox(0,"Result Add", _TimeAdd($test1,$test2)) ;Will return 01:30 MsgBox(0,"Result Sub", _TimeSub($test1,$test2)) ;Will return 00:10 Func _TimeAdd($iVal1,$iVal2) $aVal1 = StringSplit($iVal1,":") If @error Then SetError(1) ; Time in incorrect format Return 0 EndIf $aVal2 = StringSplit($iVal2,":") If @error Then SetError(1) ; Time in incorrect format Return 0 EndIf If ($aVal1[0] > 4) Or ($aVal2[0] > 4) Then SetError(1) ; Time in incorrect format Return "" ElseIf $aVal1[0] = 2 Then $iHourA = 0 $iMinA = $aVal1[1] $iSecA = $aVal1[2] ElseIf $aVal1[0] = 3 Then $iHourA = $aVal1[1] $iMinA = $aVal1[2] $iSecA = $aVal1[3] EndIf If $aVal2[0] = 2 Then $iHourB = 0 $iMinB = $aVal2[1] $iSecB = $aVal2[2] ElseIf $aVal2[0] = 3 Then $iHourB = $aVal2[1] $iMinB = $aVal2[2] $iSecB = $aVal2[3] EndIf If ($iSecA + $iSecB) < 60 Then $iSecC = ($iSecA + $iSecB) ElseIf ($iSecA + $iSecB) > 59 Then $iSecC = ($iSecA + $iSecB) - 60 $iMinA = $iMinA + 1 EndIf If ($iMinA + $iMinB) < 60 Then $iMinC = ($iMinA + $iMinB) ElseIf ($iMinA + $iMinB) > 59 Then $iMinC = ($iMinA + $iMinB) - 60 $iHourA = $iHourA + 1 EndIf $iHourC = $iHourA + $iHourB If StringLen($iSecC) = 1 Then $iSecC = "0" & $iSecC If StringLen($iMinC) = 1 Then $iMinC = "0" & $iMinC If $iHourC = 0 Then Return ($iMinC & ":" & $iSecC) ElseIf $iHourC <> 0 Then Return ($iHourC & ":" & $iMinC & ":" & $iSecC) EndIf EndFunc Func _TimeSub($iVal1,$iVal2) $aVal1 = StringSplit($iVal1,":") If @error Then SetError(1) ; Time in incorrect format Return 0 EndIf $aVal2 = StringSplit($iVal2,":") If @error Then SetError(1) ; Time in incorrect format Return 0 EndIf If ($aVal1[0] > 4) Or ($aVal2[0] > 4) Then SetError(1) ; Time in incorrect format Return "" ElseIf $aVal1[0] = 2 Then $iHourA = 0 $iMinA = $aVal1[1] $iSecA = $aVal1[2] ElseIf $aVal1[0] = 3 Then $iHourA = $aVal1[1] $iMinA = $aVal1[2] $iSecA = $aVal1[3] EndIf If $aVal2[0] = 2 Then $iHourB = 0 $iMinB = $aVal2[1] $iSecB = $aVal2[2] ElseIf $aVal2[0] = 3 Then $iHourB = $aVal2[1] $iMinB = $aVal2[2] $iSecB = $aVal2[3] EndIf If ($iSecA - $iSecB) > 0 Then $iSecC = ($iSecA - $iSecB) ElseIf ($iSecA - $iSecB) = 0 Then $iSecC = "00" ElseIf ($iSecA - $iSecB) < 1 Then $iSecC = 60 + ($iSecA - $iSecB) $iMinA = $iMinA - 1 EndIf If ($iMinA - $iMinB) > 0 Then $iMinC = ($iMinA - $iMinB) ElseIf ($iMinA - $iMinB) = 0 Then $iMinC = "00" ElseIf ($iMinA - $iMinB) < 1 Then $iMinC = 60 + ($iMinA - $iMinB) $iHourA = $iHourA - 1 EndIf $iHourC = $iHourA - $iHourB If StringLen($iSecC) = 1 Then $iSecC = "0" & $iSecC If StringLen($iMinC) = 1 Then $iMinC = "0" & $iMinC If $iHourC = 0 Then Return ($iMinC & ":" & $iSecC) ElseIf $iHourC <> 0 Then Return ($iHourC & ":" & $iMinC & ":" & $iSecC) EndIf EndFunc
  25. Maybe these might help you that I created awhile back > http://www.autoitscript.com/forum/index.php?showtopic=12124
×
×
  • Create New...