
buzz44
Active Members-
Posts
1,349 -
Joined
-
Last visited
Everything posted by buzz44
-
use of const variables
buzz44 replied to SimpleMindedFool's topic in AutoIt General Help and Support
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 . -
use of const variables
buzz44 replied to SimpleMindedFool's topic in AutoIt General Help and Support
That is the easiest way, and that SHOULD work. Is $DeadEnd a constant? -
use of const variables
buzz44 replied to SimpleMindedFool's topic in AutoIt General Help and Support
And your SURE your not declaring $BlockH anywhere else? -
use of const variables
buzz44 replied to SimpleMindedFool's topic in AutoIt General Help and Support
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 -
use of const variables
buzz44 replied to SimpleMindedFool's topic in AutoIt General Help and Support
, what line number does it indicate the error is on SimpleMindedFool? -
use of const variables
buzz44 replied to SimpleMindedFool's topic in AutoIt General Help and Support
$BlkH / $BlkW arn't constants but, and hes not changing the values of $BlockH or $BlockW. -
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
-
Mouse Click w/o moving mouse
buzz44 replied to chad.stout's topic in AutoIt General Help and Support
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 . -
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.
-
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^.
-
Can you post an example or some pseudocode?
-
Adding a printer via login script
buzz44 replied to giggity's topic in AutoIt General Help and Support
; 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 . -
Adding a printer via login script
buzz44 replied to giggity's topic in AutoIt General Help and Support
I knew my SQL experience would come in handy sometime lol ! I'll look into it when I get home JS . -
Variable return to a path directory
buzz44 replied to regis's topic in AutoIt General Help and Support
Just copy/paste the code I provided @@. -
Clean Temp Directories on PCs silent
buzz44 replied to Bernd Braun's topic in AutoIt General Help and Support
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. -
Variable return to a path directory
buzz44 replied to regis's topic in AutoIt General Help and Support
What error message? -
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
-
Variable return to a path directory
buzz44 replied to regis's topic in AutoIt General Help and Support
DriveMapDel("X:") DriveMapAdd("X:", "\\server\share") Run("C:\Make.exe " & @UserName & ' "X:"') DriveMapDel("X:") DriveMapAdd(":", "\\server\share\" & @UserName) -
what is the alternative to OLE/DDE in autoIt?
buzz44 replied to neotrio's topic in AutoIt General Help and Support
You can't accomplish what you want to do with COM? -
what is the alternative to OLE/DDE in autoIt?
buzz44 replied to neotrio's topic in AutoIt General Help and Support
Type "Obj/COM Reference" in the helpfile? -
Adding a printer via login script
buzz44 replied to giggity's topic in AutoIt General Help and Support
$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 ^^. -
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 .
-
$URL = "http://www.autoitscript.com/forum/index.php?" RunWait(@ComSpec & " /c start " & $URL)
-
how to convert to time format
buzz44 replied to WipeoutFTW's topic in AutoIt General Help and Support
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 -
how to convert to time format
buzz44 replied to WipeoutFTW's topic in AutoIt General Help and Support
Maybe these might help you that I created awhile back > http://www.autoitscript.com/forum/index.php?showtopic=12124