
Mr.Furious
Active Members-
Posts
28 -
Joined
-
Last visited
Profile Information
-
WWW
http://www.zomar.ca
Mr.Furious's Achievements

Seeker (1/7)
0
Reputation
-
I was successful at getting a program to run and I am able to send commands from my SmartThings hub. It's very customizable, I am super excited. I changed the IP from the default IP so that I can communicate with the server from other devices. In doing so I got an error regarding permission to register the URL. I figured out that running as administrator resolved that issue. However, the Windows 10 UAC shows up every time the server is launched. A bit irritating and I would like it to have it start at Windows login. I was able to get around this UAC behavior by using Task Scheduler. I am wondering if there is a better way or something I am not doing?
-
Excellent this is very helpful and appreciated. I briefly browsed the example script last night and read through all the forum comments but it was almost 3am. Thank you
-
This is excellent, Thank you. How would I go about getting this to run a program on the PC after receiving a get command/link?
-
Mr.Furious reacted to a file: HttpApi UDF - HTTP Server API
-
Fabulous! Thanks a million for your help Martin.
-
I have created a script to count the amount of weeks, days, hours, minutes, seconds to a given date. As I am not very savy with Autoit I have managed to get it working but the loop causes a lot of flickering. I also want to have the GUI window always on top (i.e. BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST) but that causes eccessive flickering. This makes me think that I have scripted it wrong from the start. Would someone please look at what I have done and give me a suggestion on how to improve it. The settings.ini just has two lines: XMAS 2011/12/25 17:00:00 #NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=smiley.ico #AutoIt3Wrapper_outfile=Count2Date.exe #AutoIt3Wrapper_UseX64=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Date.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> Global Const $TRAY_DEFAULT = 512 Opt("TrayAutoPause", 0) Opt("TrayMenuMode", 3) Opt("TrayIconHide", 0);show(0) or hide(1) tray icon TraySetClick(16) ; Only secondary mouse button will show the tray menu. $foo2 = TrayCreateItem("Exit") $foo = TrayCreateItem("Restore Window") TrayItemSetState(-1, $TRAY_DEFAULT) $file = FileOpen("settings.ini", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ;$FileContents = FileRead($file) $line1 = FileReadLine($file,1) $line2 = FileReadLine($file,2) $Name = ($line1) $Name2 = ("Count2Date") $FutureDate = ($line2) ; Calculate the number of ...... to given date $iDateCalc0 = _DateDiff( 'w',_NowCalc(), $FutureDate) $iDateCalc1 = _DateDiff( 'D',_NowCalc(), $FutureDate) $iDateCalc2 = _DateDiff( 'h',_NowCalc(), $FutureDate) $iDateCalc3 = _DateDiff( 'n',_NowCalc(), $FutureDate) $iDateCalc4 = _DateDiff( 's',_NowCalc(), $FutureDate) Countgui() Func Countgui() Local $widthCell, $msg, $iOldOpt GUICreate($Name2, 125, 175, @DesktopWidth - 200, @DesktopHeight - 250);, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST); will create a dialog box $iOldOpt = Opt("GUICoordMode", 2) $widthCell = 125 $MsgLabel = GUICtrlCreateLabel($Name,10,15, $widthCell) GUICtrlSetFont($MsgLabel, 12, 400, 1) $MsgLabel = GUICtrlCreateLabel("COUNTDOWN",-1,0) GUICtrlSetFont($MsgLabel, 12, 400, 5) $label0 = GUICtrlCreateLabel("Weeks: " & $iDateCalc0, -1, 5) $label1 = GUICtrlCreateLabel("Days: " & $iDateCalc1, -1, 0) $label2 = GUICtrlCreateLabel("Hours: " & $iDateCalc2, -1, 0) $label3 = GUICtrlCreateLabel("Minutes: " & $iDateCalc3, -1, 0) $label4 = GUICtrlCreateLabel("Seconds: " & $iDateCalc4, -1, 0) GUISetState() ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 ;Sleep(1000) $trayMsg = TrayGetMsg() ;If $trayMsg = $foo Then ; GuiSetState(@SW_SHOW);show GUI ; GUISetState(@SW_RESTORE);bring GUI from minimized state ;EndIf ;If $trayMsg = $foo2 Then ; GUIDelete() ; ExitLoop ;EndIf Select Case $traymsg = $foo GuiSetState(@SW_SHOW);show GUI GUISetState(@SW_RESTORE);bring GUI from minimized state Case $traymsg = $foo2 GUIDelete() ExitLoop EndSelect $msg = GUIGetMsg() $iDateCalc0 = _DateDiff( 'w',_NowCalc(), $FutureDate) $iDateCalc1 = _DateDiff( 'D',_NowCalc(), $FutureDate) $iDateCalc2 = _DateDiff( 'h',_NowCalc(), $FutureDate) $iDateCalc3 = _DateDiff( 'n',_NowCalc(), $FutureDate) $iDateCalc4 = _DateDiff( 's',_NowCalc(), $FutureDate) ControlSetText($Name2, "", $label0, "Weeks: " & $iDateCalc0) ControlSetText($Name2, "", $label1, "Days: " & $iDateCalc1) ControlSetText($Name2, "", $label2, "Hours: " & $iDateCalc2) ControlSetText($Name2, "", $label3, "Minutes: " & $iDateCalc3) ControlSetText($Name2, "", $label4, "Seconds: " & $iDateCalc4) Select ; close button clicked Case $msg = $GUI_EVENT_CLOSE GUIDelete() ExitLoop ; minimize to system tray Case $msg = $GUI_EVENT_MINIMIZE GuiSetState(@SW_HIDE);hide GUI Opt("TrayIconHide", 0);show tray icon TraySetToolTip("Double click to restore window...");Tray icon tool tip EndSelect WEnd EndFunc ;==>Countgui
-
It seems to be working fine just needed that one damn apostrophe' in the right spot! eeeeek Sorry thought the script was gonna complicate things. Format OpenAll.exe "program.exe" "myfiles\" "*.jpg" Here is the script: $search = FileFindFirstFile($CmdLine[2] & $CmdLine[3]) ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files matched " & $CmdLine[3] & " in the " & $CmdLine[2] & " folder.") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $attrib = FileGetAttrib($file) ; Skip directories If StringInStr($attrib, "D") Then ContinueLoop RunWait ($CmdLine[1] & ' "' & $CmdLine[2] & $file & '"') WEnd ; Close the search handle FileClose($search)
-
Did that work for you? OPPS forgot to compile before testing!! Thanks a bunch
-
Your right using notepad the problem goes away. However if I can just get ShelExec.exe into a varialbe without screwing up the part of the line that works it will work. RunWait ('ShelExec.exe "' & $CmdLine[2] & $file & '"')
-
Thanks for the tips, I think you misuderstood, I am trying to get this to work: RunWait ('$CmdLine[1] "' & $CmdLine[2] & $file & '"') The variables would = for example "ShelExec.exe" "my folder\" "my file.jpg" arggghh I think white spaces will be chasing me in my dreams tonight.
-
THIS WORKS: RunWait ('ShelExec.exe "' & $CmdLine[2] & $file & '"') but I still need to get the initial variable for the external program to work in there. Funny how everything loved life until a folder or file had a space in it.
-
Doesn't work as expected opens the folder instead of the file. My brain doesn't seem to be focusing correctly. I can't seem to understand the concept.
-
great that works, so getting a little more serious what is the conversion for this? RunWait ($CmdLine[1] & " " & $CmdLine[2] & $file) Format: $CmdLine[1] $CmdLine[2] $file "ShelExec" "my folder\" "my file.jpg"
-
Is there a way to get this code to still work if the filename has a space in it? $search = FileFindFirstFile("*.imc") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files matched *.imc") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $attrib = FileGetAttrib($file) ; Skip directories If StringInStr($attrib, "D") Then ContinueLoop RunWait ("ShelExec "& $file) WEnd ; Close the search handle FileClose($search)
-
How do I use this?
-
hidden application timer - feasible with autoit?
Mr.Furious replied to batfastad's topic in AutoIt General Help and Support
If you do that please share sounds like a great idea. Good for watching employees that are playing games too.