Leaderboard
Popular Content
Showing content with the highest reputation on 12/03/2014 in all areas
-
PDH Performance Counters Measure Process, CPU, Network, Process, Disk (etc) Usage (note that the above dialog appears differently on Vista+) New ObjectBase interface!! *x64 and Localization Issues have been resolved!* *Download and License agreement are at the bottom of this post! About The Project: Performance Counters gather all kind of performance data about the PC and the Network using the standard PDH.DLL module (standard since Windows 2000). Among the performance data you can collect and monitor are: Processor Stats (including total usage)Process (programs) Stats (including CPU usage)Disk Stats (speed/access)TCP, UDP, IP Connection Counts, Speed/Error StatsNetwork Stats..and so onNote that one example is a WIP. 'TaskManager' mockup UDF, I'm looking at you. You can jump right in, download the two AutoIT files (below) and run one of the following to see what the PDH Performance Counters project can get you: TestPDH_PerformanceCounters - this is where you should start! It allows you to visually experiment with most all of the Counters available on your PC and Network. NOTES: - Currently the 'Refresh' rate is set to 1/2 second - this can be changed by altering the Adlib() function frequency - New Counters that come into existence during monitoring will *not* be added to the list (this would be a function I've yet to add) - Counters that become invalid are simply given a prefix of '[Dead Counter Handle]:' TestPDH_ProcessLoop - this basically repeatedly shows an extended Process-information list for all processes. NOTE: You must hit 'ESC' to exit the loop TestPDH_TaskManager - this gathers and displays most everything you'd see in the Process and Performance sections of Task Manager. NOTES: - The screen does NOT update, and the UDF is a MESS. This is due to a number of reasons - the biggest one being laziness on my behalf. Plus I need to figure out how best to manage ListView changes. - TWO fields need Windows XP+ to display correctly (or a version of psapi.dll that supports 'GetPerformanceInfo'): Commit Charge (Peak) and System Cache TestPDH_ProcessGetRelatives - this shows how the PDH Performance Counters can be used to get 'parent' and 'children' process information. There are more practical means of getting this info of course (a few you'll see in my 'Process Functions' module, but hey - its just yet another example of what can be done.TestPDH_ObjectTests - this is more for reading/understanding the code than anything. It is there to show how the new 'ObjectBase' Interface works to make coding Performance Counters *much* easier.Multipile extra 'TestPDH*' examplesAt its most basic, interacting with Performance Counters is as such: The brand new ObjectBase Interface removes some of the difficulty in interacting with Performance Counters, and works like this: Examples of the new ObjectBase interface: % CPU Usage of a Process % CPU Usage of Multiple Instances of a Process (+monitoring and adjustment based on new/dead Instances) Other Examples: Waiting for Hard Disk activity to Idle for 'x' ms % System CPU Usage (by Processor) Network Usage (bytes sent/received) I've put a LOT of work into this project, and all I ask is that you follow my License Agreement when using the code (very easy, see below). Any feedback is welcome. I apologize for the unpolished GUI interfaces (especially the unfinished one), but I will get to that TaskManager GUI one day, hah. Enough chatter -now go on and experience the awesome power of Performance Counters Download the ZIP Here NOTE: Bundled in the ZIP (and included in the License agreement) are other UDF's I wrote that are necessary to run some of the 'Test' programs:_WinAPI_GetSystemInfo.au3, _WinAPI_GetPerformanceInfo.au3, _WinTimeFunctions.au3, and the unnecessary, but provided for those who are interested in the _WinTimeFunctions 'filetime' usage, program: TestWinTimeFunctions.au3. Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.Enjoy!Ascend4nt UPDATES:1 point
-
s!mpL3 LAN Messenger as the name suggests is a messenger designed and developed to offer chat communication over Local Area Networks while being as simple to use as possible. This project started way back in 2008 with only basic functionality and is regularly updated with new features in order to make it more useful and user friendly. What I wanted was a simple, small, serverless program that would work without installation cause that was the ideal combination for my workplace back then, so I ended up with this! I have attached some images from various versions: Check the rest below! (from various versions) More than 10.000 downloads! s!mpL3 LAN Messenger version 2.9.9.1 - [04/07/2019] - s!mpL3 LAN Messenger.zip 1. Fixed an issue that would occur when blocking another user and they would re-appear in the TreeView. 2. Updated File Transfers to make long file names shorter if they were too long to appear in the tray tip. 3. Removed notifications when checking for updates at application startup if there is no update available. You can view/download the full change log here: ChangeLog.txt Tested and working on both 32bit and 64 bit editions of Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10. Things you need to know before trying it: 1. Start the program, select one or more connections from what's available and click Connect (If a firewall notice comes up, click 'Allow' or 'Add Exception') When someone else on your network does the same, they will appear in your Tree-view and you will appear in theirs, double click their name and chat! 2. s!mpL3 LAN Messenger does not require a server to be running, it's standalone. 3. On the first run an .ini file is created at @LocalAppDataDir\s!mpL3 LAN Messenger which stores the settings so that they are used every time you run the application. If you delete the .ini file it will be created again (with default settings at program startup or with your selected settings if you press Save from the Preferences window). 4. All communication is encrypted using AES so it's quite secure against Network sniffers. 5. You can send files and folders by dragging and dropping them in a conversation window. Folders are compressed before being sent. You can also drop multiple items to be sent. 6. There is a "Hide" button located in the tray right click context menu that will hide all open windows. You can assign a Hotkey combination from Preferences. The default combination is Ctrl+H. 7. s!mpL3 LAN Messenger uses port 60000 by default. You can change the port used by adding "Port=****" (without quotes, stars represent numbers) to the Config file described above. Communication is UDP. 8. There is an Updater feature you can use to always have the latest available version, you only need an internet connection for that to work. You might need to clear your Internet Explorer Temporary Files in order for it to find an updated version. 9. You can Hide + Lock s!mpL3 LAN Messenger so it'll require a password in order to "Appear". To enable this, go to the Security Preferences. 10. Note that versions after 2.9.8.1 are not compatible with previous versions due to the encryption used being changed. I recommend using the latest version, or at least use the same version over the LAN. Important Notice: I will not be releasing the source code, however, I might share some parts of code if requested... If you choose to de-compile this software, don't release the source code.1 point
-
Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^1 point
-
Hi This UDF is for anyone who - Object Orientated Programing ie properties and methods in autoIT - needs standards compliant JSON,, - JSON.parse (read) and JSON.stringify (to text ) - Now JSONPath - wants to use dot syntax in AutoIT like you would in Javascript - dosen't like AutoIt arrays - full javascript arrays and objects in AutoIT! - knows javascript or would like to learn autoIT or vice versa. - call javascript functions like EncodeURI - run any javascript from autoIT ! Tested IE8 - IE11. v7 JSON_OO v7.zip - IE free version. ( hey microsoft ditched IE now too!) .- No IE dependencies- Added arrayAdd and arrayDel- JSONPath! for searching.- Added Keys Function - to list properties of a JSON object.- Secure JSON parse- Native Pure JS implementaion not a port.Credits to Douglas Crockford's for JSON2 code and stefan.goessner for JSONPath code. (see example file). v4 - json_oo_v4.zip. - use v7 (v4 may not work because of windows updates on dec-2014. ). v4 uses IEs JSON , so no ported external librariesv4 also includes a Non - IE version of JSON no include files but no stringify and uses javascript EVal (not secure). use v7.eg valid JSON '{ "hello" : "world" }' invalid "{ 'hello' : 'world' }"v4 does not have JSONPath , arrayAdd, arrayDel or keys (properties) methods - use v7 - enjoy ...the brakes come off Autoit . This is the smallest OO extensions for AutoIT Object Oriented JSON --- using JSON to Build Objects in Native AutoIT -- Using JSON to create objects $oJSON = _OO_JSON_Init ( ) $jsObj = $oJSON.parse('{ "hello": "world" }') $jsObj.hello;-> world $oJSON.stringify( $jsObj );-> {"hello":"world"} $jsObj.stringify();-> {"hello":"world"} ARRAYS - goodbye Auto it arrays hooray The real magic in this script is that it lets you access JSON array items by index number through dot syntax without the need for a for-each loop. eg you can go $obj.arr.item(n) It does this by making javascript objects syntax friendly to Autoit. . Also you can go $obj.arr.item("property").and $obj.arr.property & Also $obj.arr.length (see below) -- Using JSON to create one dimentional array $sJSON=[ "h1", "h2", "h3" ] $oResult.length= 3 $oResult.item(0);-> h1 -- Using JSON to create 2 dimentional array; $sJSON=[[1,2],[3,4],[5,6]] $oResult.length= 3 $oResult.item(0);-> $oResult.item(0).stringify();-> [1,2] $oResult.item(2).item(1);-> 6 $oResult.item(2).length;-> 2 -- Using JSON to create an object array $sJSON= [ { "card":"ace" }, {"card":"king" }] $oResult.length= 2 $oResult.item(0).card;-> ace -- Using JSON to create key values $sJSON= { "name":"Jon" , "surname":"who" } $oResult.item("surname");-> who $oResult.surname ;-> who Many other benefits such as building objects using JSON text just like you would in JavaScript Basic OO - Properties and methods -- Add properties to objects in AutoIT $jsObj.propAdd("myProp", "'x'") $jsObj.myProp ;-> x $jsObj.propAdd("myProp", '{ "hello": "world" }') $jsObj.myProp.hello ;-> world -- User Defined methods - using javascript -CASE SENSITIVE $jsObj.methAdd("myMethod", " Function('y','return y*5') " ) $jsObj.myMethod(5) ;-> 25 Some people have problems on 64 bit autoIT windows with the script control...here is the work around.. '?do=embed' frameborder='0' data-embedContent>> You will most likely have the script control ..but here it is.. http://www.microsoft.com/en-us/download/details.aspx?id=1949 --- using JSON to Build Objects in Native AutoIT -- Using JSON to create objects $oJSON = _OO_JSON_Init ( ) $jsObj = $oJSON.parse('{ "hello": "world" }') -- Accessing Items $jsObj.hello;-> world $jsObj.item("hello");-> world -- Using Any Object to create objects $jsObj.stringify();-> {"hello":"world"} $jsObj = $jsObj.parse('{ "goodbye": "world" }') $jsObj.goodbye;-> world -- Read JSON from a file (PC only) - untested $var = _OO_JSON_Read_File("jsondata.txt") $obj = $oJSON.parse($var) > BASIC OO (Object Oriented) programming in Auto it -- Compound Syntax $oJSON.parse( '{ "hello":"world" }' ).hello;-> world -- assigning propeprties $jsObj.parse ( '{ "goodbye": "world" }') $jsObj.goodbye ;-> world $jsObj.goodbye = "hello" $jsObj.goodbye;-> hello > OO Adding Methods and Properties in Auto it -- Add properties to objects in AutoIT $jsObj.propAdd("myProp", "'x'") $jsObj.myProp ;-> x $jsObj.propAdd("myProp", '{ "hello": "world" }') $jsObj.myProp.hello ;-> world -- User Defined methods - using javascript -CASE SENSITIVE $jsObj.methAdd("myMethod", " Function('y','return y*5') " ) $jsObj.myMethod(5) ;-> 25 > Querying Objects $jsObj = $oJSON.parse('{ "hello": "world" , "Goodbye" : "World" } ') $jsObj.type($jsObj) ->object $jsObj.isArray() ->False -- List object properties or "keys" $jsObj.keys($jsObj).stringify() ->["hello","Goodbye"] -- Querying Objects $jsObj = $jsObj.parse({ "hello" : "world" , "myarray" : [ "item0", 2 , { "jon" : "who"} ] }) > JSON path - always returns an array of matches $jsObj.jsonPath( "$.*").stringify() -> ["world",["item0",2,{"jon":"who"}]] $jsObj.jsonPath( "$..hello").stringify() -> ["world"] $jsObj.jsonPath( "$..myarray").stringify() ->[["item0",2,{"jon":"who"}]] $jsObj.jsonPath( "$..myarray[?(@.jon)]").stringify() ->[{"jon":"who"}] $jsObj.jsonPath( "$..myarray[?(@.jon)]").item(0).stringify() ->{"jon":"who"} > Basic Arrays using JSON -- Querying Arrays $jsObj.myarray.stringify() ->["item0",2,{"jon":"who"}] $jsObj.type($jsObj.myarray) ->object $jsObj.myarray.isArray() ->True $jsObj.myarray.length ->3 $jsObj.type($jsObj.myarray.item(0)) ->string $jsObj.type($jsObj.myarray.item(1)) ->number $jsObj.type($jsObj.myarray.item(2)) ->object > Modifying Arrays using OO -- Empty array; $jsObj = $oJSON.parse('[]') $jsObj.stringify() ->[] $jsObj.isArray( ) ->True -- Add items; $jsObj.arrayAdd( 0, "test0") $jsObj.arrayAdd( 1, "test1") $jsObj2 = $oJSON.parse( '{ "hello" : "world" }') $jsObj.arrayAdd( 2, $jsObj2) $jsObj.stringify() ->["test0","test1",{"hello":"world"}] -- Delete items; $jsObj.arrayDel( 0) $jsObj.stringify() ->["test1",{"hello":"world"}] -- Using JSON to create one dimentional array $sJSON=[ "h1", "h2", "h3" ] $oResult.length= 3 $oResult.item(0);-> h1 -- Using JSON to create 2 dimentional array; $sJSON=[[1,2],[3,4],[5,6]] $oResult.length= 3 $oResult.item(0);-> $oResult.item(0).stringify();-> [1,2] $oResult.item(2).item(1);-> 6 $oResult.item(2).length;-> 2 -- Using JSON to create an object array $sJSON= [ { "card":"ace" }, {"card":"king" }] $oResult.length= 2 $oResult.item(0).card;-> ace -- Using JSON to create key values $sJSON= { "name":"Jon" , "surname":"who" } $oResult.item("surname");-> who $oResult.surname ;-> who > Working with OO Objects -- assigning JSON objects in AutoIT $jsObj = $oJSON.parse( '{ "hello" : "world" }') $jsObj2 = $oJSON.parse( '{}' ) $jsObj2 = $jsObj $jsObj.hello;-> world $jsObj2.hello;-> world -- Assign an JSON object to a property $jsObj = $oJSON.parse( '{ "hello" : "world" }') $jsObj.hello ;-> world $jsObj2.propAdd("myProp") $jsObj2.myProp = $jsObj $jsObj2.myProp ;-> $jsObj2.myProp.stringify() ;-> {"hello":"world"} $jsObj2.myProp.hello ;-> world -- Using Existing JS Objects , Object must exist in the scripting object (not IE) $oJSON2 =$jsObj.objGet('JSON') ; objGet is javascript eval $oResult = $oJSON2.parse('{ "hello":"world" }') $oResult.hello;-> world > Using Javascript functions extending UDF -- Calling javascript standard functions $jsObj.jsFunAdd( "encodeURI") $jsObj.encodeURI( 'te st' );-> te%20st $jsObj.protoAdd("encodeURI", " function (s) { return encodeURI(s); } " $jsObj.encodeURI( 'te st' );-> te%20st -- Calling javascript literal methods $str_obj = $jsObj.toObj("my string") $str_obj.jsMethAdd( "charAt") $str_obj.charAt( 0 );-> m $jsObj.toObj('\"my string').charAt(0) ;-> \ $str_obj.jsFunAdd( "charAt") $str_obj.charAt( 0 );-> m $jsObj.jsMethAdd("toFixed" ) $jsObj.toObj(5.56789).toFixed(2) ;-> 5.57 $jsObj.jsMethAdd("concat" , 3 ) $jsObj.toObj('hello').concat( ' world', ' again ', ' and again ' ) ;-> hello world again and again $jsObj.dot("\""'my string", "charAt(0)" );-> \ > depreciated syntax -- depreciated syntax - previous UDFs $jsObj = _JS_obj_create ( '{ "hello": "world" }') ; invalid "{ 'hello':'world'}" $jsObj.hello ;-> world $jsObj.objToString();-> {"hello":"world"} $jsObj.strToObject ( '{ "goodbye": "world" }') $jsObj.goodbye ;-> world -- Close IE explorer.exe instance - not required anymore _OO_JSON_Quit ( ) -- Objects still usable after _OO_JSON_Quit closes $jsObj.goodbye ;-> world Example script output; see example file ; enjoy1 point
-
Network Interface Info, Statistics, and Traffic
mesale0077 reacted to Ascend4nt for a topic
Network Interface Info, Statistics, and Traffic (incl. IP, TCP, UDP and ICMP) This is an example of getting and displaying Network Interface Information, Statistics and Traffic. Previously this was just a means to getting Network statistics (specifically IP, TCP, UDP, and ICMP), but now it includes Internet Interface information, as well as Interface-specific statistics. Since this UDF can be used in different ways, let me cover Statistics first: Network Statistics Information Stats example output To retrieve Statistics information, you can call one of the four _Network_xxxxStatistics() functions for IP, TCP, UDP, or ICMP Statistics. These functions accept 1 argument which specifies which protocol to use. Basically, zero is IPv4 and non-zero is IPv6. It defaults to IPv4 if no arguments. Here's the functions: Protocol Statistics Functions: _Network_IPStatistics() -> receives IP statistics _Network_TCPStatistics() -> TCP statistics _Network_UDPStatistics() -> UDP statistics _Network_ICMPStatistics() -> ICMP statistics - To get per-interface statistics requires 2 calls. One call is required to collect information on adapters into an array. Once this information is retrieved, multiple calls to _Network_InterfaceEntryInfo() can be made for each indexed network interface. Note that _Network_IPv4AdaptersInfo() is the only adapter/interface information function which doesn't get index information - so don't use it unless you want further interface information. The main UDF functions to use are: Network Adapter & Interface Functions: _Network_IPv4AdaptersInfo() -> Retrieves information on Physical IPv4 adapters _Network_IPv4AdaptersInfoEx() -> Retrieves much more info on Physical IPv4 adapters _Network_IPv4AddressTable() -> Retrieves information on IPv4 Interfaces _Network_IPAllAddressTable() -> Retrieves information on both IPv4 and IPv6 interfaces Network Statistics for a Given Interface: _Network_InterfaceEntryInfo() -> For a given interface index, retrieves statistics - The simplest way to get overall traffic is to use _Network_IPAllAddressTable() (or _Network_IPv4AddressTable() for IPv4 only) to collect an array of info about interfaces. This needs to be done only once. Then, to collect statistics, for each row in the interface array, call _Network_InterfaceEntryInfo() with $aIPAddressTable[$i][0] to get the statistics for that network interface. IMPORTANT: Note that for all statistics, the data received/sent are represented as 32-bit numbers, and subject to wraparound after 4GBs of data has been transferred. Network Interface Information Regarding Network Interface Information, nearly every function except those ending in xxStatistics(), will return various info regarding the network adapters or interfaces. Currently, IPv4 and IPv6 addresses are retrieved for the interface, as well as for Gateway, DHCP, DNS and WINS servers (there's some XP issues here as to which functions to use - see UDFs). The number of IP addresses (since there can be more than one assigned to each interface) is controlled via a parameter $bGetAllIPs. If this value is non-zero, multiple IP addresses are returned in a string separated by "|" (pipe symbol). Also note that the MAC/Physical Address is returned by most functions as well. These are properly formatted into a hex string in the form "01-23-45-67-89-ab". There is one issue with converting IPv6 addresses - on pre-Vista O/S's (Win XP I'm looking at you) WSAStartup must be called by the code. This is all handled internally, but if you have code that relies on WSAStartup/Cleanup, keep it in mind and let me know if I can better accommodate any potential conflicts. Further notes: - The TCP Statistics gives information about the number of segments sent/received, rather than the # of packets. I'm not totally clear on the association, however here's some links: What's the difference between a TCP segment and a TCP packet? Whats the difference between a Packet, Segment and Frame? - I'm not sure how segments, packets, or datagrams map to # of bytes, or what API functions I might use to figure this out. Any help there would be appreciated. Alternatives: While I have opened access to a lot of detailed network and performance information, there are alternatives - check out Netstat (-e for performance stats) or my >Performance Counters UDF's, which has a lot of varied stats (one example of these: >Network Usage). Following is the example, included in the ZIP file. Note there's a cr@pload of info dumped to the console, so you'll probably want to redirect output or copy-and-paste from the output console: ; ======================================================================================================== ; <NetworkStatsExample.au3> ; ; Example of reading and displaying Network Interface Information and Statistics ; (using <NetworkStatistics.au3> UDF) ; Statistics information, including IP, TCP*, UDP, and ICMP and internet interface traffic, ; are displayed in a 'Splash' window - with both IPv4 and IPv6 data separated ; ; Author: Ascend4nt ; ======================================================================================================== #include "_NetworkStatistics.au3" ; -------------------- HOTKEY FUNCTION & VARIABLE -------------------- Global $bHotKeyPressed = False Func _EscPressed() $bHotKeyPressed=True EndFunc ; -------------------- MAIN PROGRAM CODE -------------------- HotKeySet("{Esc}", "_EscPressed") Local $hSplash, $sSplashText ; Network Stats Local $aUDPStats, $aTCPStats, $aIPStats, $aICMPStats Local $aUDPv6Stats, $aTCPv6Stats, $aIPv6Stats, $aICMPv6Stats Local $aIPv4Adapters, $nAdapters Local $aIPv4AddrTable, $aIPAllAddrTable, $nInterfaces, $aNIEntryInfo Local $sSeparator = "-----------------------------------------" ; IP Stats: IPv4 and IPv6 For $i = 0 To 1 $aIPStats = _Network_IPStatistics($i) If @error Then ConsoleWrite("_Network_IPStatistics("&$i&") error: "&@error&", @extended="&@extended&@CRLF) ContinueLoop EndIf If $i Then ConsoleWrite("IP [IPv6] Stats:") Else ConsoleWrite("IP [IPv4] Stats:") EndIf ConsoleWrite( _ " [0] = IP Forwarding Status: [1 = Enabled, 2 = Disabled] : " & $aIPStats[0] & _ ", [1] = Default initial time-to-live (TTL) for datagrams : " & $aIPStats[1] & @CRLF & _ ", [2] = # Received Datagrams : " & $aIPStats[2] & _ ", [3] = # Received Datagrams w/Header errors : " & $aIPStats[3] & _ ", [4] = # Received Datagrams w/Address errors : " & $aIPStats[4] & @CRLF & _ ", [5] = # Forwarded Datagrams : " & $aIPStats[5] & _ ", [6] = # Received Datagrams w/Unknown Protocol : " & $aIPStats[6] & _ ", [7] = # Received Datagrams Discarded : " & $aIPStats[7] & @CRLF & _ ", [8] = # Received Datagrams Delivered : " & $aIPStats[8] & _ ", [9] = # Requested Outgoing Datagrams : " & $aIPStats[9] & _ ", [10] = # Outgoing Datagrams Discarded : " & $aIPStats[10] & @CRLF & _ ", [11] = # Transmitted Datagrams Discarded : " & $aIPStats[11] & _ ", [12] = # Datagrams w/o Routes that were Discarded : " & $aIPStats[12] & _ ", [13] = TimeOut for Reassembling Incoming Fragmented Datagrams : " & $aIPStats[13] & @CRLF & _ ", [14] = # Datagrams Requiring Reassembly : " & $aIPStats[14] & _ ", [15] = # Datagrams Successfully Reassembled : " & $aIPStats[15] & _ ", [16] = # Datagrams that Failed to be Reassembled : " & $aIPStats[16] & @CRLF & _ ", [17] = # Datagrams that were Fragmented Successfully : " & $aIPStats[17] & _ ", [18] = # Datagrams not Fragmented, and Discarded : " & $aIPStats[18] & _ ", [19] = # Fragments created (for Datagrams) : " & $aIPStats[19] & @CRLF & _ ", [20] = # of Interfaces : " & $aIPStats[20] & _ ", [21] = # of IP addresses associated with PC : " & $aIPStats[21] & _ ", [22] = # of Routes in the Routing table : " & $aIPStats[22] & _ @CRLF) ConsoleWrite($sSeparator & @CRLF) Next ; TCP Stats: IPv4 and IPv6 For $i = 0 To 1 $aTCPStats = _Network_TCPStatistics($i) If @error Then ConsoleWrite("_Network_TCPStatistics("&$i&") error: "&@error&", @extended="&@extended&@CRLF) ContinueLoop EndIf If $i Then ConsoleWrite("TCP [IPv6] Stats:") Else ConsoleWrite("TCP [IPv4] Stats:") EndIf ConsoleWrite( _ "[0] Rto Algorithm = " & $aTCPStats[0] & _ ",[1] Rto Min = " & $aTCPStats[1] & _ ",[2] Rto Max = " & $aTCPStats[2] & _ ",[3] #Max Connections = " & $aTCPStats[3] & _ ",[4] #Active Opens = " & $aTCPStats[4] & _ ",[5] #Passive Opens = " & $aTCPStats[5] & @CRLF & _ " [6] #Failed Connection Attempts = " & $aTCPStats[6] & _ ",[7] #Established Connections that were Reset = " & $aTCPStats[7] & _ ",[8] #Established Connections [current] = " & $aTCPStats[8] & @CRLF & _ " [9] #Recvd Segments = " & $aTCPStats[9] & _ ",[10] #Sent Segments = " & $aTCPStats[10] & _ ",[11] #Retransmitted Segments = " & $aTCPStats[11] & @CRLF & _ " [12] #Receive Errors = " & $aTCPStats[12] & _ ",[13] #Sent Segments with Reset Flag = " & $aTCPStats[13] & _ ",[14] #Connections = " & $aTCPStats[14] & _ @CRLF) ConsoleWrite($sSeparator & @CRLF) Next ; UDP Stats: IPv4 and IPv6 For $i = 0 To 1 $aUDPStats = _Network_UDPStatistics($i) If @error Then ConsoleWrite("_Network_UDPStatistics("&$i&") error: "&@error&", @extended="&@extended&@CRLF) ContinueLoop EndIf If $i Then ConsoleWrite("UDP [IPv6] Stats:") Else ConsoleWrite("UDP [IPv4] Stats:") EndIf ConsoleWrite( _ " [0] #Recvd Datagrams = " & $aUDPStats[0] & _ ",[1] #Discarded Datagrams [invalid port] = " & $aUDPStats[1] & _ ",[2] #Erroneous Datagrams = " & $aUDPStats[2] & @CRLF & _ " [3] #Sent Datagrams = " & $aUDPStats[3] & _ ",[4] #UDP Listener Entries = " & $aUDPStats[4] & _ @CRLF) ConsoleWrite($sSeparator & @CRLF) Next ; ICMP Stats: IPv4 and IPv6 For $i = 0 To 1 $aICMPStats = _Network_ICMPStatistics($i) If @error Then ConsoleWrite("_Network_ICMPStatistics("&$i&") error: "&@error&", @extended="&@extended&@CRLF) ContinueLoop EndIf ConsoleWrite("ICMP [IPv"&4+($i*2)&"] Stats:" & _ " [0] = # Incoming ICMP Messages : " & $aICMPStats[0] & _ ", [1] = # Incoming ICMP Errors : " & $aICMPStats[1] & _ ", [2] = # Outgoing ICMP Messages : " & $aICMPStats[2] & _ ", [3] = # Outgoing ICMP Errors : " & $aICMPStats[3] & _ @CRLF) ConsoleWrite($sSeparator & @CRLF) Next ; IPv4 Adapters Info (very basic info) _Network_IPv4AdaptersInfo() ConsoleWrite($sSeparator & @CRLF) ; IPv4 Adapters Info (comprehensive info) $aIPv4Adapters = _Network_IPv4AdaptersInfoEx() $nAdapters = @extended ConsoleWrite("# of Adapters: "&$nAdapters&@CRLF) For $i = 0 To $nAdapters - 1 ConsoleWrite("Adapter #"&$i+1&":" & _ " [0] Index #"& $aIPv4Adapters[$i][0] & _ ", [1] Type = " & $aIPv4Adapters[$i][1] & _ ", [2] DHCP Enabled Flag = " & $aIPv4Adapters[$i][2] & _ ", [3] WINS Enabled Flag = " & $aIPv4Adapters[$i][3] & _ ", [4] Physical [MAC] Address: " & $aIPv4Adapters[$i][4] & _ ", [5] (0) = " & $aIPv4Adapters[$i][5] & @CRLF & _ ", [6] Description: "& $aIPv4Adapters[$i][6] & _ ", [7] [Empty '']: " & $aIPv4Adapters[$i][7] & _ ", [8] Adapter/Service Name [GUID] = " & $aIPv4Adapters[$i][8] & _ ", [9] [Empty] = " & $aIPv4Adapters[$i][9] & _ ", [10] [Empty] = " & $aIPv4Adapters[$i][10] & @CRLF & _ ", [11] IPv4 Address(es): "& $aIPv4Adapters[$i][11] & _ ", [12] IP Address Mask(s): "& $aIPv4Adapters[$i][12] & @CRLF & _ ", [13] Gateway IPv4 Address(es): "& $aIPv4Adapters[$i][13] & _ ", [14] Gateway Address Mask(s) : "& $aIPv4Adapters[$i][14] & @CRLF & _ ", [15] DHCP IPv4 Address(es) = " & $aIPv4Adapters[$i][15] & _ ", [16] DHCP Address Mask(s) = " & $aIPv4Adapters[$i][16] & _ ", [17] DHCP LeaseObtained Time = " & $aIPv4Adapters[$i][17] & _ ", [18] DHCP LeaseExpires Time = " & $aIPv4Adapters[$i][18] & @CRLF & _ ", [19] Primary WINS Server IP = " & $aIPv4Adapters[$i][19] & _ ", [20] Primary WINS Server Address Mask = " & $aIPv4Adapters[$i][20] & _ ", [21] Secondary WINS Server IP(s) = " & $aIPv4Adapters[$i][21] & _ ", [22] Secondary WINS Server Address Mask(s) = " & $aIPv4Adapters[$i][22] & @CRLF) ConsoleWrite($sSeparator & @CRLF) Next ; IPv4 Interface Info alt #2 $aIPv4AddrTable = _Network_IPv4AddressTable() $nInterfaces = @extended ConsoleWrite(@CRLF) For $i = 0 To $nInterfaces - 1 ConsoleWrite("Adapter #"&$i+1&": [0] Interface Index # = " & $aIPv4AddrTable[$i][0] & _ ", [1] IPv4 Address = " & $aIPv4AddrTable[$i][1] & _ ", [2] Subnet Mask = " & $aIPv4AddrTable[$i][2] & _ ", [3] Broadcast Address = " & $aIPv4AddrTable[$i][3] & @CRLF & _ " [4] Max Reassembly Size = " & $aIPv4AddrTable[$i][4] & _ ", [5] Address Type/State = " & $aIPv4AddrTable[$i][5] & @CRLF) Next ConsoleWrite($sSeparator & @CRLF) ; IPv4 and IPv6 Interface Info (includes everything except Address Masks) ; params: 0 (IPv4 AND IPv6), 0 (don't get all IP's), 0 (don't include down-status interfaces) $aIPAllAddrTable = _Network_IPAllAddressTable(0, 0, 0) $nInterfaces = @extended ConsoleWrite($sSeparator & @CRLF) For $i = 0 To $nInterfaces - 1 ConsoleWrite("Interface #"&$i+1&": [0] Index #"& $aIPAllAddrTable[$i][0] & _ ", [1] Type = " & $aIPAllAddrTable[$i][1] & _ ", [2] Operational Status = " & $aIPAllAddrTable[$i][2] & _ ", [3] Flags = 0x" & Hex($aIPAllAddrTable[$i][3], 8) & _ ", [4] Physical [MAC] Address: " & $aIPAllAddrTable[$i][4] & _ ", [5] MTU = " & $aIPAllAddrTable[$i][5] & @CRLF & _ ", [6] Description: "& $aIPAllAddrTable[$i][6] & _ ", [7] Friendly Name: " & $aIPAllAddrTable[$i][7] & _ ", [8] Adapter/Service Name [GUID] = " & $aIPAllAddrTable[$i][8] & @CRLF & _ ", [9] Max Receive Speed [Vista+] = " & $aIPAllAddrTable[$i][9] & _ ", [10] Max Transmit Speed [Vista+] = " & $aIPAllAddrTable[$i][10] & @CRLF & _ ", [11] IPv4 Address(es): "& $aIPAllAddrTable[$i][11] & _ ", [12] IPv6 Address(es): "& $aIPAllAddrTable[$i][12] & @CRLF & _ ", [13] DNS IPv4 Address(es): "& $aIPAllAddrTable[$i][13] & _ ", [14] DNS IPv6 Address(es): "& $aIPAllAddrTable[$i][14] & @CRLF & _ ", [15] Gateway IPv4 Address(es) [Vista+]: "& $aIPAllAddrTable[$i][15] & _ ", [16] Gateway IPv6 Address(es) [Vista+]: "& $aIPAllAddrTable[$i][16] & @CRLF & _ ", [17] DHCP IPv4 Address(es) [Vista+]: "& $aIPAllAddrTable[$i][17] & _ ", [18] DHCP IPv6 Address(es) [Vista+]: "& $aIPAllAddrTable[$i][18] & @CRLF & _ ", [19] WINS IPv4 Address(es) [Vista+]: "& $aIPAllAddrTable[$i][19] & _ ", [20] WINS IPv6 Address(es) [Vista+]: "& $aIPAllAddrTable[$i][20] & @CRLF & _ ", [21] Connection Type [Vista+] = " & $aIPAllAddrTable[$i][21] & _ ", [22] Tunnel Type [Vista+] = " & $aIPAllAddrTable[$i][22] & @CRLF) ; Interface Statistics & Info for Given index $aNIEntryInfo = _Network_InterfaceEntryInfo($aIPAllAddrTable[$i][0]) ;~ ConsoleWrite("_Network_InterfaceEntryInfo return, @error = " & @error & ", @extended = " & @extended & @CRLF) ConsoleWrite("Interface #"&$i+1&" Entry Info: [0] Interface Index = " & $aNIEntryInfo[0] & _ ", [1] Interface Type = " & $aNIEntryInfo[1] & _ ", [2] Operational Status = " & $aNIEntryInfo[2] & _ ", [3] Admin Status = " & $aNIEntryInfo[3] & _ ", [4] Physical Address = " & $aNIEntryInfo[4] & _ ", [5] MTU [Max Trans. Unit] in bytes = " & $aNIEntryInfo[5] & @CRLF & _ ", [6] Description = " & $aNIEntryInfo[6] & _ ", [7] Interface Name = " & $aNIEntryInfo[7] & @CRLF & _ ", [8] Last change [1/100th second] = " & $aNIEntryInfo[8] & _ ", [9] Interface Speed [bps] = " & $aNIEntryInfo[9] & @CRLF & _ ", [10] # Recvd Data [in Octets] = " & $aNIEntryInfo[10] & _ ", [11] # Recvd Unicast Packets = " & $aNIEntryInfo[11] & _ ", [12] # Recvd Non-Unicast Packets = " & $aNIEntryInfo[12] & _ ", [13] # Recvd Packets Discarded [no error] = " & $aNIEntryInfo[13] & _ ", [14] # Recvd Packets Discarded [error] = " & $aNIEntryInfo[14] & _ ", [15] # Recvd Packets Discarded [unk. protocol] = " & $aNIEntryInfo[15] & @CRLF & _ ", [16] # Sent Data [in Octets] = " & $aNIEntryInfo[16] & _ ", [17] # Sent Unicast Packets = " & $aNIEntryInfo[17] & _ ", [18] # Sent Non-Unicast Packets = " & $aNIEntryInfo[18] & _ ", [19] # Sent Packets Discarded [no error] = " & $aNIEntryInfo[19] & _ ", [20] # Sent Packets Discarded [error] = " & $aNIEntryInfo[20] & @CRLF & _ ", [21] Transmit Queue Length [n/a] = " & $aNIEntryInfo[21] & @CRLF) ConsoleWrite($sSeparator & @CRLF) Next $hSplash=SplashTextOn("Network Usage Information", "", 520, 24 + (19 * 15) + ($nInterfaces * (5.5 * 15)), Default, Default, 16+4, "Lucida Console", 11) ; Start loop Do $aIPStats = _Network_IPStatistics() $aTCPStats = _Network_TCPStatistics() $aUDPStats = _Network_UDPStatistics() $aICMPStats = _Network_ICMPStatistics() $aIPv6Stats = _Network_IPStatistics(1) $aTCPv6Stats = _Network_TCPStatistics(1) $aUDPv6Stats = _Network_UDPStatistics(1) $aICMPv6Stats = _Network_ICMPStatistics(1) $sSplashText = StringFormat("%35s", "== TCP Stats ==") & @CRLF $sSplashText &= StringFormat("IPv4: [Segments] Recvd = %10u | Sent = %10u", $aTCPStats[9], $aTCPStats[10]) & @CRLF $sSplashText &= StringFormat("IPv6: [Segments] Recvd = %10u | Sent = %10u", $aTCPv6Stats[9], $aTCPv6Stats[10]) & @CRLF $sSplashText &= StringFormat("<Total Connections> IPv4: %10u | IPv6: %10u", $aTCPStats[14], $aTCPv6Stats[14]) & @CRLF $sSplashText &= @CRLF & StringFormat("%35s", "== UDP Stats ==") & @CRLF $sSplashText &= StringFormat("IPv4: [Datagrams] Recvd = %10u | Sent = %10u", $aUDPStats[0], $aUDPStats[3]) & @CRLF $sSplashText &= StringFormat("IPv6: [Datagrams] Recvd = %10u | Sent = %10u", $aUDPv6Stats[0], $aUDPv6Stats[3]) & @CRLF $sSplashText &= StringFormat("<Total Listeners> IPv4: %10u | IPv6: %10u", $aUDPStats[4], $aUDPv6Stats[4]) & @CRLF $sSplashText &= @CRLF & StringFormat("%35s", "== IP Stats ==") & @CRLF $sSplashText &= StringFormat("IPv4: [Datagrams] Recvd = %10u | Sent = %10u", $aIPStats[2], $aIPStats[9]) & @CRLF $sSplashText &= StringFormat("IPv6: [Datagrams] Recvd = %10u | Sent = %10u", $aIPv6Stats[2], $aIPv6Stats[9]) & @CRLF $sSplashText &= @CRLF & StringFormat("%35s", "== ICMP Stats ==") & @CRLF $sSplashText &= StringFormat("IPv4: [Messages] Recvd = %10u | Sent = %10u", $aICMPStats[0], $aICMPStats[2]) & @CRLF $sSplashText &= StringFormat("IPv6: [Messages] Recvd = %10u | Sent = %10u", $aICMPv6Stats[0], $aICMPv6Stats[2]) & @CRLF For $i = 0 To $nInterfaces - 1 ;~ $aNIEntryInfo = _Network_InterfaceEntryInfo($aIPv4AddrTable[$i][0]) ;~ $sSplashText &= @CRLF & StringFormat("%35s", "== IP " & $aIPv4AddrTable[$i][1] & " ==" ) & @CRLF $aNIEntryInfo = _Network_InterfaceEntryInfo($aIPAllAddrTable[$i][0]) If @error Then ConsoleWrite("_Network_InterfaceEntryInfo return, @error = " & @error & ", @extended = " & @extended & @CRLF) ExitLoop EndIf If $aIPAllAddrTable[$i][11] <> "" Then $sSplashText &= @CRLF & StringFormat("%40s", "== IPv4 " & $aIPAllAddrTable[$i][11] & " ==" ) & @CRLF Else $sSplashText &= @CRLF & StringFormat("%52s", "== IPv6 " & $aIPAllAddrTable[$i][12] & " ==" ) & @CRLF EndIf $sSplashText &= StringFormat("%45.56s", $aNIEntryInfo[6]) & @CRLF ; Octet *should* be the same as Bytes.. $sSplashText &= StringFormat("Data (Octets/Bytes): Recvd = %10u | Sent = %10u", $aNIEntryInfo[10], $aNIEntryInfo[16]) & @CRLF $sSplashText &= StringFormat("Unicast Packets: Recvd = %10u | Sent = %10u", $aNIEntryInfo[11], $aNIEntryInfo[17]) & @CRLF $sSplashText &= StringFormat("Non-Unicast Packets: Recvd = %10u | Sent = %10u", $aNIEntryInfo[12], $aNIEntryInfo[18]) & @CRLF Next $sSplashText &= @CRLF & StringFormat("%35s", "[ESC] Exits") & @CRLF ControlSetText($hSplash, "", "[CLASS:Static; INSTANCE:1]", $sSplashText) Sleep(500) Until $bHotKeyPressed NetworkStatistics.zip ~prev version. downloads: >100 Updates: 2013-07-11: Changed: _Network_IPv4AdaptersInfoEx() now returns all IP's (if requested) and Address Masks Fixed: WSALastError call possible crash with non-array variable Changed: _Network_IPAllAddressTable() now allows 'down' status interfaces to be returned Added: Some comments on development, info on getting additional stats in the UDF 2013-07-06: Added: Much more Adapter Information Changed: Example is now separate from the UDF Fixed some minor issues here and there Changed: Global Handle to IPHLPAPI.DLL is now contained in the UDF and used to speed up function calls Misc. Other fixes I didn't keep track of! 2013-07-02: Hotfix: Ipv6 indexing error Fixed: indexing, updated and enhanced output Changed: Various functions return arrays even if failure - this is to make XP pre-SP1 and also collection of IPv6 less troublesome. @error should still be checked on return though! Added: Adapter and Interface information and statistics collection 2013-06-20: Now covers all the 'p's - IP and ICMP now added1 point -
GUI Fun!
mesale0077 reacted to Ascend4nt for a topic
GUI Fun! Not enough posts here are about just plain fun stuff to do with AutoIt, at least not lately. So I figure, why not dig up one of my old UDFs, clean it up a bit, and throw it very emphatically at you lot of misfits! One way of mucking about with AutoIt and Windows that can be entertaining is creating shaped GUIs. Sure, GUIs with regions are nothing new here or in general on the Windows platform. But have you ever just wanted to stare at colorful shapes flying across your screen, for no apparent reason? Well, my friend, you've come to the right place. The first UDF I've put up pretty simple. Boxes, circles, triangles, diamonds, and stars are what I bring you, in technicolor wonder. I will probably add a few more examples when I find the time.. However, its my hope that more people add to this thread - and maybe provide links to other topics or posts where some nifty GUI fun is to be had! GUI related Threads & UDFs of Interest >GUI design concepts (started by Guinness) >Perforator - Perforated GUIs (and really anything GUI or GDI+-related by UEZ) >PNG as GUI >Multiple PNG images as GUI elements >FreeText - Text shape GUIs >Visible Controls on a Transparent Window >Layered Window without Image >AnyGUI - Extend the GUI of any Window >_UskinLibrary - Skinning w/DLL >XSkin - More GUI Skinning >GUIExtender, >GUIFrame, >Toast and other nice UDFs by Melba23 >GIF Animation >GDI+ Animated Waiting / Loading Screens My Examples I should point out other GUI manipulation UDF's I've uploaded in the past, as they too can provide some amusement. >GUIBox - Rubber-band GUIs >Full-screen Crosshairs >BarSweep (very simple example) >BoxSelection (another simple example) Okay, on to the new stuff! _GUIShapes is a UDF with functions to create GUI's shapes like Circles, Boxes, Triangles, Stars, and Diamonds. These GUI's have no interactive elements or controls and are click-through-able, meaning that a click on the GUI will pass through to whatever window is underneath. _LineTraverser is a UDF with functions to create a well, line traverser. Given a start and end point, it will allow you to step through a given line without needing to do any extra work on your behalf. This uses Bresenham's line algorithm to calculate the individual steps. I know this one isn't related to GUI, but its what I used for my second 'GUI fun' example below. Pacman Line-Traversing GUI (>static or >animated). That's right, I managed to animate a GUI! Check it! (now included in the ZIP) Examples that follow will be bundled with the ZIP. Have fun! Updates: GUIShapesExample - whacky shapes flying all over the screen!!! #include "_GUIShapes.au3" ;~ #include <WinAPI.au3> ; already included in <_GUIShapes.au3> ; ======================================================================================================== ; <GUIShapesExample.au3> ; ; Example use of <_GUIShapes.au3> UDF ; ; This example creates a bunch of random GUI shapes with random attributes, and moves ; everything around - randomly. ; ; Author: Ascend4nt ; ======================================================================================================== ; ---------------------- MAIN CODE ------------------------------- Local $iShapeGUIs = 20, $aShapeGUIs[$iShapeGUIs], $iTimer, $iRand, $aRet Local $iRandX, $iRandY, $iRandColor, $iRandLength Local $iTriangles = 0, $iCircles = 0, $iStars = 0, $iDiamonds = 0, $iBoxes = 0 For $i = 0 To $iShapeGUIs - 1 ; Everything random! $iRandX = Random(0, @DesktopWidth - 20, 1) $iRandY = Random(0, @DesktopHeight - 20, 1) $iRandLength = Random(12, 300, 1) $iRandColor = Random(0x111111, 0xFFFFFF, 1) ; Choose a GUI shape at random, with semi-random attributes Switch Random(0, 5, 1) Case 0 $aShapeGUIs[$i] = _TriangleGUICreate($iRandX, $iRandY, $iRandLength, BitAND($iTriangles, 1) * Random(1, 10, 1), Default, Mod($i, 4), $iRandColor) $iTriangles += 1 Case 1 $aShapeGUIs[$i] = _CircleGUICreate($iRandX, $iRandY, $iRandLength, BitAND($iCircles, 1) * Random(1, 10, 1), Default, $iRandColor) $iCircles += 1 Case 2 $aShapeGUIs[$i] = _StarGUICreate($iRandX, $iRandY, $iRandLength, BitAND($iStars, 1) * Random(1, 10, 1), $iRandColor) $iStars += 1 Case 3 $aShapeGUIs[$i] = _DiamondGUICreate($iRandX, $iRandY, $iRandLength, Default, BitAND($iDiamonds, 1) * Random(1, 10, 1), $iRandColor) $iDiamonds += 1 Case Else ; 4 $aShapeGUIs[$i] = _BoxGUICreate($iRandX, $iRandY, $iRandLength, BitAND($iBoxes, 1) * Random(1, 10, 1), Default, $iRandColor) $iBoxes += 1 EndSwitch ; Show the randomly created GUI GUISetState(@SW_SHOWNOACTIVATE, $aShapeGUIs[$i]) ; And set a random transparency too WinSetTrans($aShapeGUIs[$i], '', Random(50, 255, 1)) Next ConsoleWrite("GUI Totals: Triangles:" & $iTriangles & ", Circles:" & $iCircles & ", Stars:" & $iStars & ", Diamonds:" & $iDiamonds & ", Boxes:" & $iBoxes & @CRLF) ; Timer for moving shapes $iTimer = TimerInit() While 1 ; Exit on 'ESC' keypress (BitAND() test for down-state) If BitAND(_WinAPI_GetAsyncKeyState(0x1B), 0x8000) Then ExitLoop Sleep(10) ; Move a random GUI every 30+ms If TimerDiff($iTimer) >= 30 Then $iRand = Random(0, $iShapeGUIs - 1, 1) ; Set GUI above other windows WinSetOnTop($aShapeGUIs[$iRand], "", 1) ; Move to a random position WinMove($aShapeGUIs[$iRand], "", Random(0, @DesktopWidth - 20, 1), Random(0, @DesktopHeight - 20, 1), Default, Default, 2) ; Reset timer $iTimer = TimerInit() EndIf WEnd _ LineTraverserExample - Where's the ball? Huh, where is it, Fido?! Ooh, there it is! Fetch the ball! Gooood circle.. #include "_GUIShapes.au3" #include "_LineTraverser.au3" ;~ #include <WinAPI.au3> ; ======================================================================================================== ; <LineTraverserExample.au3> ; ; Simple Example of using the <_LineTraverser.au3> and <_GuiShapes.au3> UDF's ; ; A little red-ball will display, and a hollow ball will move towards it. ; A line will be drawn to show how the path from the hollow ball to the red-ball target should work, ; and then the hollow ball moves to it in $iStep increments. ; ; ; Author: Ascend4nt ; ======================================================================================================== Global Const $iStep = 2 Local $hHollowCircle, $hDestCircle, $iExt Local $iXTarget, $iYTarget, $aLineTraverser ; Create the 2 circle GUIs $hHollowCircle = _CircleGUICreate(Random(0, @DesktopWidth - 20, 1), Random(0, @DesktopHeight - 20, 1), 81, 10, Default, Random(0x111111, 0xFFFFFF, 1)) $hDestCircle = _CircleGUICreate(1, 1, 17, 0, 17, 0xFF0000) ; Set initial target point $iXTarget = Random(0, @DesktopWidth - 20, 1) $iYTarget = Random(0, @DesktopHeight - 20, 1) ; Source/Target are same to start off with $aLineTraverser = _LineTraverserCreate($iXTarget, $iYTarget, $iXTarget, $iYTarget) ; Move windows to start positions WinMove($hHollowCircle, '', $aLineTraverser[0], $aLineTraverser[1]) ; + Center of hollow circle, - half of target circle WinMove($hDestCircle, '', $iXTarget + 40 - 8, $iYTarget + 40 - 8) ; Transparency on 'seeker' circle WinSetTrans($hHollowCircle, '', 150) ; Show both GUIs, and put on top of all windows WinSetState($hDestCircle, '', @SW_SHOWNOACTIVATE) WinSetState($hHollowCircle, '', @SW_SHOWNOACTIVATE) WinSetOnTop($hHollowCircle, '', 1) WinSetOnTop($hDestCircle, '', 1) While 1 ; Exit on 'ESC' keypress (in down state) If BitAND(_WinAPI_GetAsyncKeyState(0x1B), 0x8000) Then ExitLoop ; < 10 ms sleep with an API call DllCall("kernel32.dll",'none','Sleep','dword',3) If Not _LineTraverserStep($aLineTraverser, $iStep) Then $iExt = @extended ; Was there movement? Then moooove If $iExt Then WinMove($hHollowCircle, '', $aLineTraverser[0], $aLineTraverser[1]) EndIf $aPos = WinGetPos($hHollowCircle) ; Debug check. Should never be hit, so long as Window is moved to each step (including any last steps - see @extended) If $iXTarget <> $aPos[0] Or $iYTarget <> $aPos[1] Then ConsoleWrite("Mismatch: TargetX:" & $iXTarget & ", TraverserX:" & $aLineTraverser[0] & ", Current X:" & $aPos[0] & _ ", TargetY:" & $iYTarget & ", TraverserY:" & $aLineTraverser[1] & ", Current Y:" & $aPos[1] & ", @extended:" & $iExt & @CRLF) EndIf ; A little extra sleep to make it clear we've reached our destination. DllCall("kernel32.dll",'none','Sleep','dword',6) ; Now we'll set a new destination (with a visible line) Dim $iXTarget = Random(0, @DesktopWidth - 20, 1), $iYTarget = Random(0, @DesktopHeight - 20, 1) ; Create a new Line-Traverser (no need to explicitly destroy the last one, it was just an array of numbers) $aLineTraverser = _LineTraverserCreate($aLineTraverser[0], $aLineTraverser[1], $iXTarget, $iYTarget) ; + Center of hollow circle, - center of target circle WinMove($hDestCircle, '', $iXTarget + 40 - 8, $iYTarget + 40 - 8) ;~ Draw the line on-screen to give a visual indicator of the path that the hollow circle should take ;~ (note that the line will be overwritten by ANY screen activity, but that's fine for the example) ; Get DC to screen $hDC = _WinAPI_GetDC(0) ; Create pen and select it into DC $hPen = _WinAPI_CreatePen(0, 3, 0xFFFFFF) $hPenOld = _WinAPI_SelectObject($hDC, $hPen) ; Note we add 40 (for the center of the hollow circle GUI) _WinAPI_DrawLine($hDC, $aPos[0] + 40 - 1, $aPos[1] + 40 - 1, $iXTarget + 40 - 1, $iYTarget + 40 - 1) ; Select the old pen back _WinAPI_SelectObject($hDC, $hPenOld) ; Clean up pen and then release DC _WinAPI_DeleteObject($hPen) _WinAPI_ReleaseDC(0, $hDC) ; What fun drawing with GDI is =| Else WinMove($hHollowCircle, '', $aLineTraverser[0], $aLineTraverser[1]) EndIf WEnd GUIShapesFun.zip ~prev downloads: 601 point -
find a text with position x,y
benyamin200 reacted to computergroove for a topic
If you know the height of the text you can use the OCR.au3 here -> '?do=embed' frameborder='0' data-embedContent>>1 point -
@Exit and @computergrove, play nice. @Radiance, Yashield gave you what you needed in post #5, you need a seed basically. <snip>, cute, I wrote out basically what SRandom said in the help file before I thought that it was probably explained there!.... Just see the helpfile lol1 point
-
I am aware of this. Since the numbers I use are usually too big and I get this result pretty often it's hard to believe that it's still random. Sorry. I forgot to add that I'm only having this issue when running more than one script on random. Check this out: This is just an example I did a minute ago. I've got a server software launching other AutoIt scripts, using asynchronous communication between them. They get identified by a longer number I'm rolling at random when the "child"script starts. When two of them happen to get launched directly after anouther they get the same ID and I get really weird results. Edit: This is really awesome to look at.1 point
-
i ended up writing it CLI so we can drop it and call it via psexec, and it is hella-faster than hashing remote files from your local machine. #include <WinAPIShPath.au3> #include <Array.au3> #include <File.au3> #include <Crypt.au3> #include <Security.au3> Global $aFound[0] Local $aCmdLine = _WinAPI_CommandLineToArgv($CmdLineRaw) _FilePlusMD5($aCmdLine[1] , $aCmdLine[2]) exit Func _FilePlusMD5($strComputer, $MD5target) tooltip("Building the File List" , 0 , 0) $Path="\c$\" $aFiles = _FileListToArrayRec("\\" & $strComputer & $Path , "*.*x;*.zip;*.exe;*.bin;*.rar" , 1, 1, 0, 2) for $j = 1 to ubound($aFiles) - 1 tooltip("" , 0 , 0) tooltip("Working on file " & $j & " of " & ubound($aFiles) - 1 & " -- There are currently " & ubound($aFound) & " matches for " & $aCmdLine[2] , 0 , 0) If $MD5target <> "" Then If stringleft($MD5target , 2) <> "0x" Then $MD5target = "0x" & $MD5target $fHash = _Crypt_HashFile($aFiles[$j] , $CALG_MD5) If $fHash = $MD5target Then _ArrayAdd($aFound , $aFiles[$j] & @LF & @LF & "-------MD5 MATCH ------" & @LF & "MD5: " & $fHash & @LF & "Target: " & $MD5target) Endif EndIf next $fLOG = fileopen("\\LOGS\MatchedHashes.log" , 1) _FileWriteFromArray($fLOG , $aFound) fileclose($fLOG) EndFunc However, the OP is not solved. If anyone has a way to use the target crypto dll to hash files on that target machine, I would still like to speed test the solution. Or if that's retarded and completely unrelated to the speed increase I saw with WMP, an explanation of why.1 point
-
azooz, water is quite right. Please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing Bypassing of security measures - before you post again. Thread locked. But welcome to the AutoIt forum - and see you soon with a legitimate question I hope. M231 point
-
Sodari, The Mother file has 2 trailing @CRLF - these are interpreted as lines which do not contain the delimiter and so the function fails as all lines do not have an equal number of parts. You can test this using the $FRTA_INTARRAYS and looking at the arrays contained within the returned array: #include <File.au3> #include <Array.au3> Local $aLines $sFile = @ScriptDir & "\Mother.txt" _FileReadToArray($sFile, $aLines, $FRTA_INTARRAYS, ":") _ArrayDisplay($aLines, "", Default, 8) ; Returned array of arrays _ArrayDisplay($aLines[0], "", Default, 8) ; Content of array within first element of returned array $sFile = @ScriptDir & "\PrintaPC.txt" _FileReadToArray($sFile, $aLines, Default, ":") _ArrayDisplay($aLines, "", Default, 8) ; Returned array as all lines have the delimiter So you either have to remove the surplus @CRLF from the file or use the internal arrays. Please ask if you have any further questions. M231 point
-
Welcome to AutoIt and the forum! cracking passwords is against our forum rules ("Bypassing of security measures"). A link to the rules can be found at the bottom right corner of each page. So you will not find any help on this subject here.1 point
-
Disabling Mouse Animations
4b0082 reacted to computergroove for a topic
I just posted this -> '?do=embed' frameborder='0' data-embedContent>> Should point you in the right direction1 point -
Stop Error pop up's
kingjacob90 reacted to SmOke_N for a topic
If IsArray($mouse_msg) Then ;$exit If $mouse_msg[4]=$exit and $exit_color_var=0 Then $exit_color_var=1 GUICtrlSetColor($exit,$pg1_all_button_color2) ElseIf $exit_color_var=1 and $mouse_msg[4]<>$exit Then $exit_color_var=0 GUICtrlSetColor($exit,$pg1_all_button_color) EndIf ;$sign_in If $mouse_msg[4]=$sign_in and $sign_in_color_var=0 Then $sign_in_color_var=1 GUICtrlSetColor($sign_in,$pg1_all_button_color2) ElseIf $sign_in_color_var=1 and $mouse_msg[4]<>$sign_in Then $sign_in_color_var=0 GUICtrlSetColor($sign_in,$pg1_all_button_color) EndIf ;$sign_up If $mouse_msg[4]=$sign_up and $sign_up_color_var=0 Then $sign_up_color_var=1 GUICtrlSetColor($sign_up,$pg1_all_button_color2) ElseIf $sign_up_color_var=1 and $mouse_msg[4]<>$sign_up Then $sign_up_color_var=0 GUICtrlSetColor($sign_up,$pg1_all_button_color) EndIf EndIf1 point -
Two Command in Same Time
232showtime reacted to Melba23 for a topic
ahmeddzcom, You can only have one splash screen at any one time - so you cannot display both together. > Why do you need 2 splash screens? Are you trying to notify 2 separate things? If so then perhaps my Notify UDF might be useful - look in my sig for the link. M231 point -
Trying to learn web page integration
Sodori reacted to alienclone for a topic
if you open the IE.au3 file in the SciTE script editor you can see a lot of the "inner workings" for the IE commands that you are using. it shows a lot of "dots" and how they are used. the path to the include folder with the au3 files should be something like "C:\Program Files (x86)\AutoIt3\Include\" also check out the profile of the AWESOME person who created that IE udf and check out his posts and go through the links in his signature to learn more about IE DOM. http://www.autoitscript.com/forum/user/5125-dalehohm/1 point -
If you're using a s!mpL3 LAN Messenger desktop shortcut and it seems to lose it's icon, follow the steps below to fix it: Run s!mpL3 LAN Messenger Click "Edit" -> "Preferences" Choose the "Maintenance" tab Tick the "Remove registry keys" checkbox Click "Remove" Restart the app and follow the initial setup1 point
-
s!mpL3 LAN Messenger version 2.9.8.6 - [04/11/2014] 1. Added the ability to send folders. Folders are zipped before being sent. 2. Fixed a bug with "Hide in tray" not showing the password input and directly making windows appear when the "Password lock" option was enabled. 3. Fixed a bug with Auto-Refresh not working after startup unless changed from Preferences. 4. Fixed a bug where you could attempt to send files to someone that was offline. 5. Changed "Start with Windows" so it only works for the Current User, system wide is not needed. 6. Changed the location of s!mpL3 LAN Messenger files to be in the Local AppData folder. 7. Fixed the use of "|". Please make sure you update all your clients to the latest version as this may cause issues when chatting with someone who is using an older version. 8. Optimized internal communication mechanism.1 point
-
WaterEffect
meoit reacted to TheAutomator for a file
wakillon, --------------------------- Water Effect on a BMP with WaterCtrl.dll Example: AutoIt3_x64.exe - Invalid install copy. --------------------------- Temp WaterCtrl.dll is not suitable for Windows or it contains an error. Try to install using the original installation media program or contact your system administrator or software vendor for support. --------------------------- OK --------------------------- I use windows 7 home premium 64 bit. Can you help me get this to work? Thanks, TheAutomator.1 point -
A3X Script Extract With newer versions of AutoIT (v3.3.10.0+), the compiled script is no longer appended to files as an overlay, and instead is embedded as a binary resource. This leads my previous AutoIt-script detection UDF lacking. However, since that UDF (>PE File Overlay Extraction) was targeted towards overlays in general, its still a worthwhile tool to have. This UDF on the other hand is pretty specific - it lets you detect and optionally extract A3X scripts from a compiled executable. The method is rather straightforward - it looks for a resource type of RT_RCDATA with a resource name of "SCRIPT", and then extracts the binary, testing for the A3X signature along the way. The main UDF has two functions: _FileContainsScriptResource() _FileContainsA3XScript() The first of these functions is there only for checking if a resource with "SCRIPT" exists. Its main purpose is to report on possible embedded scripts. I made this a separate function primarily because of issues with compressed executables. Tools like UPX and MPRESS can compress the resources as well as the rest of the executable, so any detection of the A3X signature will fail in those circumstances. (Note that UPX and MPRESS don't compress overlay data, which is why the older Overlay-Extraction A3X-detection worked regardless) The second function will both check for and optionally return the A3X script resource as binary. It also does a signature check for verification. Anyway, here's an example of its usage. The main UDF is attached below. #include <_FileContainsA3XScript.au3> ; ======================================================================================================== ; <A3XScriptExtract.au3> ; ; Example of detecting AutoIt Scripts embedded as binary resources (in AutoIt v3.3.10.0+ exe's), and ; extracting them to .A3X files. ; ; This script can be invoked in interactive or command-line mode. ; Passing an executable as a parameter will extract an A3X resource, writing it out to ; an A3X file with the same base name as the executable. ; ; Uses <_FileContainsA3XScript.au3> functions ; ; Author: Ascend4nt ; ======================================================================================================== ; ---------------------- MAIN CODE ------------------------------- Local $sFile, $sLastDir, $sLastFile, $binA3X, $iErr, $nA3XSize ; Command-line parameter received? Simply do a direct A3X extraction If $CmdLine[0] Then $sFile = $CmdLine[1] If Not FileExists($sFile) Then Exit 1 $binA3X = _FileContainsA3XScript($sFile, True) If @error Then Exit @error $nA3XSize = @extended Local $nExt = StringInStr($sFile, '.', 0, -1) If $nExt Then $sFile = StringLeft($sFile, $nExt - 1) EndIf $sFile &= '.a3x' Exit Not FileWrite($sFile, $binA3X) EndIf ; No command-line parameters, query the user in interactive mode $sLastDir = @ScriptDir While 1 $sFile=FileOpenDialog("Select PE File To Look for Embedded A3X scripts In",$sLastDir,"PE Files (*.exe;*.dll;*.scr)|All Files (*.*)",3,$sLastFile) If @error Or $sFile="" Then Exit $sLastFile = StringMid($sFile, StringInStr($sFile, '\', 1, -1) + 1) $sLastDir = StringLeft($sFile, StringInStr($sFile, '\', 1, -1) - 1) ; Resource 'Script' check $bScriptResourceFound = _FileContainsScriptResource($sFile) ConsoleWrite("_FileContainsScriptResource() return: " & $bScriptResourceFound & ", @error = " & @error & ", @extended = " & @extended & @CRLF) ; Actual A3X script resource check. True to return the A3X script as binary $binA3X = _FileContainsA3XScript($sFile, True) $iErr = @error $nA3XSize = @extended ; No A3X script found? If $iErr Or $nA3XSize = 0 Then ConsoleWrite("Failed Return from _FileContainsA3XScript(), @error = " & $iErr & ", @extended = " & $nA3XSize & @CRLF) MsgBox(64, "No AutoIt A3X script resource Found", "AutoIt A3X script resource not Found!" & @CRLF & _ ($bScriptResourceFound ? "However, *A* script resource was found" : "No 'Script' resource found either") & @CRLF & _ "for '" & $sLastFile & "'") ContinueLoop EndIf ConsoleWrite("_FileContainsA3XScript() return type: " & VarGetType($binA3X) & ", value = " & (IsBinary($binA3X) ? "[A3X_Binary]" : $binA3X) & @CRLF) ConsoleWrite(@TAB & "@error = " & $iErr & ", @extended = " & $nA3XSize & @CRLF) Local $hFileOut = -1, $sOutFile, $iMsgBox, $bSuccess = 0 $iMsgBox = MsgBox(35, "A3X script resource found in " & $sLastFile, "A3X script resource found. File size: " & FileGetSize($sLastFile) & _ ", A3X script size: " & $nA3XSize & @CRLF & @CRLF & _ "Would you like to Extract and save A3X file?") If $iMsgBox = 6 Then ;~ If $nA3XSize > 134217728 Then ;~ MsgBox(48, "A3X script is too huge", "A3X script size is > 128MB, skipping..") ;~ ContinueLoop ;~ EndIf $sOutFile = FileSaveDialog("A3X script - SAVE: Choose a file to write A3X script data to (from " & $sLastFile&")", _ $sLastDir, "AutoIt Compiled Sript (*.a3x)|All (*.*)", 2 + 16) If @error Then ContinueLoop ; Simple check for extension - if none, add .a3x If StringInStr($sOutFile, '.') = 0 Then $sOutFile &= ".a3x" ; Else $hFileOut = FileOpen($sOutFile, 16 + 2) If $hFileOut <> - 1 Then $bSuccess = FileWrite($hFileOut, $binA3X) FileClose($hFileOut) EndIf Else ContinueLoop EndIf If $bSuccess Then ShellExecute(StringLeft($sOutFile,StringInStr($sOutFile,'\',1,-1)-1)) Else MsgBox(64, "Error Opening or writing to file", "Error opening, reading, or saving A3X file") EndIf WEnd Exit _FileContainsA3XScript.au3 *edit: Modified example: Now alternatively accepts a command-line parameter for automated script extraction1 point
-
_ShellExecuteWithReducedPrivileges An odd thing about Vista+ O/S's is that, once you run a process in elevated privileges mode, you can't run other processes in lower-privileged modes. Why, you ask, would that be important? Sometimes you want - or need - to limit the privileges of a process: A very common scenario for me is drag-and-drop. Windows' Explorer does NOT allow this to occur between lower privileged processes (like Explorer itself!) and other processes. This is very frustrating for users in programs that take advantage of that. There's also some problems using certain SendMessage commands from other unelevated processes.Setting the state or properties of windows that have an elevated privilege may not work either from other unelevated processes.An install or setup program that needs to launch the installed program will more often than not want to run that program on a lower privilege level (for some of the reasons mentioned above)So, after some looking around I found two ways of running processes under a lower privilege mode. One is using CreateProcessWithTokenW (see ), and the other is using COM objects - specifically Windows Explorer's SHELL object to ShellExecute a command/program. This can be used just like AutoIt's built-in ShellExecute() function, but of course the program that runs will be at a reduced IL (integrity level). The code is based on Brandon @ BrandonLive's article here: 'Getting the shell to run an application for you - Part 2:How | BrandonLive' The usage is straightforward for this one: use it like ShellExecute. The $bWait parameter is only there in case ShellExecuteWait() will be called for either non-elevated processes or pre-Vista O/S's. Example: _ShellExecuteWithReducedPrivileges(@ComSpec,' /k title Non-Elevated prompt (via Shell.ShellExecute)') Anyway, hope this helps someone out! Ascend4nt's AutoIT Code License agreement: While I provide this source code freely, if you do use the code in your projects, all I ask is that: If you provide source, keep the header as I have put it, OR, if you expand it, then at least acknowledge me as the original author, and any other authors I creditIf the program is released, acknowledge me in your credits (it doesn't have to state which functions came from me, though again if the source is provided - see #1)The source on it's own (as opposed to part of a project) can not be posted unless a link to the page(s) where the code were retrieved from is provided and a message stating that the latest updates will be available on the page(s) linked to.Pieces of the code can however be discussed on the threads where Ascend4nt has posted the code without worrying about further linking.Download the ZIP from my Site1 point
-
XSkin.au3 Demonstration Page Basics: 1. A Skinned GUI Only 2. A Skinned GUI and Button 3. A Skinned GUI, Button and XSkinMsgBox 4. A Skinned GUI, Button and XSkinInputBox 5. A Skinned GUI, Button and XSkinTrayBox 6. A Skinned GUI, Slider and XSkinProgress 7. A Skinned GUI and XSkinIcon 8. A Skinned GUI, XSkinIcon and XSkinIconButton 9. A Skinned GUI, XSkinButton and XSkinButton *** HOW TO USE GUIGetMsg() *** Intermediate: 1. A Skinned GUI, Icon and MouseOver ( color ) 2. A Skinned GUI and XSkinToolBar.au3 - Plug-in Advanced: 1. All Inclusive Demo 2. A Skinned GUI and XSkinShell.au3 - Plug-in 3. All Inclusive Demo with 2 GUI's Development: 1. Understanding the Skin.dat 2. Design and Layout of Images 3. Finalizing the Skin Folder Custom Skin Designs A Very Helpful Color Chart Designer - Big Daddy Defacto - HeavenlyBodies - Lizondo - Leadore - DarkRed - Universal - Skilled - Light-Green - Sleek Prodbox - Blackhole - Carbon - Rezak - SteelStyle - AzuriX **NEW** Designer - Michel Claveau mci O1 & mci 02 & mci 03 - mci 04 Designer - Valuater BlackJack - Valor NEW** Designer - AzKay Noir - MsgPlus! Designer - JoshDB Dock Skin Designer - Joscpe Mid Gray - XSkin Help File Designer - JamesB Royale (Blue) Just started.... more to come 8)1 point