Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/10/2018 in all areas

  1. Taskms4

    Launch.IT - App Launcher

    Description: Launch.IT is a simple & moddable/hackable Windows App-Launcher (like MacOS' Spotlight) Features: A lot of customizations (background-pics, colors, position, etc...) can be made via the ".ini" file You can add aliases in the ".ini" file to launch apps/files and browse url/folders Make use of its 5 functionalities: App launcher (and files/url/path browser), Windows search (find results from your files and folder), Windows Run, DOS commands execution (command prompt), and Google Search It has some embeeded commands like '::help' to display Launch.IT help window Use hotkeys like {Shift}+{Esc} to switch between minimized and default/maximized GUI or {Esc} to exit program. Screenshots: Download: Launch.IT.zip Launch.IT in brief: Originally, the aim of this tool was to implement an alternative to Apple's Spotlight (provided along with MacOS) in my Professional Win7 PC for more convenience (and by laziness XD). Now, I'm using this tool (which I have completely customized to add further functionalities like Calculator, Remote-Desktop, SSH, etc...) every day at work on a Win10 PC. And believe it or not, this makes me saving an incredible amount of time. Like me, do not hesitate to rework the code to add functionalities and modify Launch.IT behaviour. I hope you'll like it
    1 point
  2. Note: my first UDF. This allows sending (BSD) messages to a syslog server using UDP. It has been tested with SnmpSoft Syslog Watcher, Synology DSM 4.2 and DSM 6.0, Kiwi Syslog Server. Uses the BSD syslog protocol (https://tools.ietf.org/html/rfc3164), except for Facility and Severity levels, which incorporates the extended (newer) values as well. To the best of my knowledge, this is how most basic syslog senders do it today anyway. Target IP, Facility, Severity level, Tag, Hostname, Port can be specified. Also includes a ping feature to give an error if server doesn't respond. Feedback appreciated. #include-once Global $__SyslogSendPing ; this allows global access to the ping result (in ms) Global $__SyslogSendPacket ; this allows global access to the entire syslog packet: PRI, HEADER and MSG. ; #FUNCTION# ==================================================================================================================== ; Name ..........: SyslogSend v1.0.3 ; Modified ......: 2018.10.09 ; Changelog......: v1.0.2 fixed $MDAY formatting, leading zero would not be correctly replaced by a space ; v1.0.3 added debug console output when packet is sent. Set global variable $_D=True to show debug output. ; Description ...: Sends syslog messages to a syslog server using UDP ; Syntax ........: SyslogSend($_Message, $_Target, $_Port, $_Facility, $_Severity, $_Tag, $_HostName) ; Parameters ....: $_Message - Text message to send. https://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6.4 ; $_Target - [optional] Target IP or host (IPv4 address or hostname). Default is "127.0.0.1". ; $_Facility - [optional] Facility value (integer 0..23). Default is 1. https://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6.2.1 ; $_Severity - [optional] Severity level (integer 0..7). Default is 7. https://tools.ietf.org/html/draft-ietf-syslog-protocol-23#section-6.2.1 ; $_Tag - [optional] Name of program or process (a-zA-Z0-9). https://tools.ietf.org/html/rfc3164#section-4.1.3 ; $_HostName - [optional] Originator hostname. Default is @ComputerName. https://tools.ietf.org/html/rfc3164#section-4.1.2 ; $_Port - [optional] UDP port number (integer 0..65535). Default is 514. ; $_Ping - [optional] Ping the host before sending, with value as timeout. Function will exit and return an ; error message if host did not respond. Default is 0 (no ping). ; Return values .: 0 = Success ; Non-zero = error text message ; Author ........: Irios ; Remarks .......: Uses UDP only, and sticks to the BSD syslog protocol (https://tools.ietf.org/html/rfc3164), except for Facility ; and Severity levels, which incorporates the extended (newer) values as well. To the best of my knowledge, this ; is how most basic syslog senders do it today anyway. The syslog protocol does not provide acknowledgement of message ; delivery, the ping feature is for convenience only. Most syslog servers will use the first word in the MSG field as ; TAG if you do not specify a tag yourself. This is by design, and not a bug. ; Example .......: SyslogSend("A test message", "192.168.0.1", 514, 3, 5, "SyslogSend", "fooServer", 1000) ; This would send the text string "<29> Oct 1 00:36:23 fooServer SyslogSend: A test message" to host 192.168.0.1:514 (including a ping, 1000ms timeout). ; ; =============================================================================================================================== Func SyslogSend($_Message, $_Target = "127.0.0.1", $_Facility = 1, $_Severity = 7, $_Tag = "", $_HostName = @ComputerName, $_Port = 514, $_Ping = 0) Local $_UDPStartup = False If (StringStripWS($_Message, 8) = "") Then Return "Error. Nothing to send (no message content)." If ($_Target = "") Or (Int($_Port) < 0) Or (Int($_Port) > 65535) Or (Int($_Facility) < 0) Or (Int($_Facility) > 23) Or (Int($_Severity) < 0) Or (Int($_Severity) > 7) Then Return "Argument(s) error." ; quick check to make sure most of the parameters have valid values ; Strip accidental spaces from target IP, HOSTNAME, and TAG. Adding a colon and space to the TAG field (https://tools.ietf.org/html/rfc3164#section-4.1.3) $_Target = StringStripWS($_Target, 8) $_HostName = StringStripWS($_HostName, 8) If ($_Tag <> "") Then $_Tag = StringStripWS($_Tag, 8) & ": " ; Ping the target host, and return an error if not responding If (Int($_Ping) <> 0) Then $__SyslogSendPing = Ping($_Target, $_Ping) Switch @error Case 1 $__SyslogSendPing = "" Return "Ping error. Host is offline." Case 2 $__SyslogSendPing = "" Return "Ping error. Host is unreachable." Case 3 $__SyslogSendPing = "" Return "Ping error. Bad destination." Case 4 $__SyslogSendPing = "" Return "Ping error. Other error." EndSwitch EndIf ; Format the TIMESTAMP field. Month number converted to Mmm format (https://tools.ietf.org/html/rfc3164#section-4.1.2). Replace leading zero in day with a space. Switch @MON Case 1 $MON = "Jan" Case 2 $MON = "Feb" Case 3 $MON = "Mar" Case 4 $MON = "Apr" Case 5 $MON = "May" Case 6 $MON = "Jun" Case 7 $MON = "Jul" Case 8 $MON = "Aug" Case 9 $MON = "Sep" Case 10 $MON = "Oct" Case 11 $MON = "Nov" Case 12 $MON = "Dec" EndSwitch $MDAY = " " & @MDAY ; we add a leading space for easier processing/formatting... $MDAY = StringReplace($MDAY, " 0", " ", 1) ; ...here we make sure the MDAY variable always has the same length (incl. a trailing space). Value such as "03" is illegal, and must be formatted as " 3". Local $_TimeStampNow = $MON & $MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC ; the complete TIMESTAMP field (https://tools.ietf.org/html/rfc3339) Local $_Prival = Int(($_Facility * 8) + $_Severity) ; generating the <PRIVAL> for the PRI field. Multiply the Facility number by 8 and add the numerical value of the Severity (https://tools.ietf.org/html/rfc5424#section-6.2.1) $__SyslogSendPacket = "<" & $_Prival & "> " & $_TimeStampNow & " " & $_HostName & " " & $_Tag & $_Message ; the complete syslog packet (https://tools.ietf.org/html/rfc3164#section-4.1.3) If (Eval("_D")=True) Then ConsoleWrite('DEBUG SyslogSend(): "'& $__SyslogSendPacket & '"' & @CRLF) ; debug output, uses $_D as trigger UDPStartup() ; starting the UDP service If @error Then Return "Could not start UDP service. Error " & @error Else $_UDPStartup = True EndIf Local $_Socket = UDPOpen($_Target, $_Port) ; the socket for the UDP connection If @error Then If $_UDPStartup Then UDPShutdown() Return "Could not connect. Error " & @error EndIf UDPSend($_Socket, $__SyslogSendPacket) ; sending the packet If @error Then If $_UDPStartup Then UDPShutdown() Return "Could not send the data. Error " & @error EndIf UDPCloseSocket($_Socket) ; closing the socket If @error Then If $_UDPStartup Then UDPShutdown() Return "Could not close socket. Error " & @error EndIf If $_UDPStartup Then UDPShutdown() ; Close the UDP service. EndFunc ;==>SyslogSend Changelog: v1.0.1 added #include-once v1.0.2 fixed $MDAY formatting, leading zero would not be correctly replaced by a space v1.0.3 added $_D option for debug output, see source comment for usage SyslogSend_udf.au3
    1 point
  3. 1 point
  4. Why not just run your function like this rather than trying to pull your string from @extended? Func blanktoplus($aa) $myString = StringReplace(GuiCtrlRead($aa), " ", "+") Return $myString EndFunc
    1 point
  5. should be command.shortcut.6.$(au3)=Ctrl+Shift+F6 instead command.shortcut.6.$(au3)=Ctrl+Shif+F6 there is lack of letter "t" in word "Shift"
    1 point
  6. I just start to check your examples, a little..... and in first place I change the names to have better ordering in sorting by name. I change only file names, but hope this will help others, and I hope you will find this as a good contribution Examples.zip
    1 point
  7. spudw2k

    Button and Checkboxes

    You could use an array. Here's one example: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Global $aCheckbox[2] #Region ### START Koda GUI section ### Form= Global $frmMainForm = GUICreate("A Form", 161, 112, -1, -1) GUISetOnEvent($GUI_EVENT_CLOSE, "ExitApplication") $aCheckbox[0] = GUICtrlCreateCheckbox("First Checkbox", 16, 15, 113, 17) GUICtrlSetFont(-1, 10, 400, 0, "Arial") $aCheckbox[1] = GUICtrlCreateCheckbox("Second Checkbox", 16, 39, 129, 17) GUICtrlSetFont(-1, 10, 400, 0, "Arial") Global $btnButton1 = GUICtrlCreateButton("Button", 43, 71, 75, 25) GUICtrlSetFont(-1, 10, 800, 0, "Arial") GUICtrlSetOnEvent(-1, "ButtonPress") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func ExitApplication() Exit EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc Func ButtonPress() For $iCheckbox = 0 to UBound($aCheckbox)-1 If _IsChecked($aCheckbox[$iCheckbox]) Then ConsoleWrite("$aCheckbox[" & $iCheckbox & "] is selected." & @CRLF) Else ConsoleWrite("$aCheckbox[" & $iCheckbox & "] is NOT selected." & @CRLF) EndIf Next EndFunc If you wanted to get fancy, you could keep track of the checked boxes as they are checked and not have to enumerate through all of them later.
    1 point
  8. Try This $ctl_hwnd = ControlGetHandle('Bill Of Resource - (View only)','','AfxOleControl423') If IsHWnd($ctl_hwnd) Then ...
    1 point
  9. @thegreatjedi I understand the issue, and can appreciate the difficulty with the challenge at hand. I could not find a particularly elegant way to determine if a console application is awaiting input. I still don't understand how you can expect to know what to respond with if you don't know what the input prompt is asking for. If that is true, how do you expect to know how to respond in an automated fashion? You can't/shouldn't expect to input Y for any halting prompt...right? You want to be sure you respond with valid and appropriate input. I really think capturing the output and know what 'keyword/text' to look for to know what prompt is being presented and thus how to respond is not a terrible way to go. I can appreciate you might not have all the output/prompt text, but I would think you should be able to get it. You should be able to track where in your list of task you are, know what process is running and have--say an array of--text to look for with a matching input response.
    1 point
  10. @Fractured Another little suggestion: WM_GETTEXT. Post the script then ( if you want ), so we can see how we can help you
    1 point
×
×
  • Create New...