Leaderboard
Popular Content
Showing content with the highest reputation on 05/05/2016 in all areas
-
This is a program that I made to help my self learn better regular expressions. There are a lot of other programs/website with the similar functions. The main advantage of this program is that you don't have to click a button after every changes. The program detected changes and react on it. Function: Match Match of arrays Match and replace Load source data from website Load source data from a website with GET/POST Load text data from file Clear fields Export and Import settings (you can finish the expression a other time, just export/import it) Cheat sheet DPI aware Generate AutoIt code example code The source code is not difficult and I think most user will understand it. In the zip file there is a export files (reg back example), you can drag and drop this files on the gui to import it. EDIT: Updated to version V1.2.0 Changes are: Expand and collapse of the cheat sheet (Thanks to Melba23 for the Guiextender UDF) Usefull regular expressions websites links included in the program Text data update time EDIT: Updated to version V1.3.0 Changes are: Automatic generate AutoIt code Icons on the tab Few minor bug fixes EDIT: Updated to version V1.4.0 Changes are: Link to AutoIt regex helpfile If the regular expression has a error than the text becomes red Option Offset with Match and array of Matches Option Count with Match and replace Some small minor bug fixed EDIT: Updated to version V1.4.1 Changes are: Small bug in "create AutoIt" code fixed EDIT: Updated to version V1.4.2 Changes are: Small bug in "create AutoIt" code fixed Bug with website data fixed EDIT: Updated to version V1.4.3 Changes are: DPI aware Click function on cheat sheet to insert function in the regex input field (Sourcode, example and compiled exe file) Regex toolkit.zip1 point
-
Sers, while working on another project I was in need of desktop notifications. I wanted an own implementation and from time to time the code grew and I thought about sharing it with the world. I know that there is a similar UDF out there but when my project got bigger an UDF was the best choice for me. As you can see the UDF's differ in usage and style of notifications. So, what do we have? The UDF offers the usage of permanent desktop notifications for your own script in a very easy way. Notifications are starting in the bottom right corner of your main screen and will be shown on top until there is no more space. Further notifications will be shown if previous ones are closed. The notifications have a nice minimalistic design in two colors. By default they match the look of the dark taskbar in Windows 10, but colors and other things can be set differently if wished (see example scripts). The UDF works for GUIOnEventMode activated and deactivated and detects it automatically. Show me! Each notification has its GUI, a title, the message, a seperating line, date label, time label and a closing button (and if activated, a border around the notification). The color of the title, message, seperating line, date, time and closing button (+ border if activated) have all the text color. Right now notifications have a fixed size. I thought about variable sizes but did not add it because I didn't need it so far. Some people may notice the shorter seperating line when border is activated, thats just because of better looks Notifications will be colored as the following: Windows 10: they match the design of the taskbar Windows 8/8.1: On most designs: they match the border color of active windows, else they are black with transparency (see screenshot) Windows 7 and earlier: black with transparency (sry aero) How do I use notifications in my script? include UDF call _Notifications_Startup() (after you determined if you want to use GUIOnEventMode or not) If GUIOneventMode deactivated: call _Notifications_CheckGUIMsg($__GUIMsg) in your main loop create a notification using _Notifications_Create($__title, $__message) Between step 2 and 3 you can set various options: _Notifications_SetAnimationTime _Notifications_SetBorder _Notifications_SetButtonText _Notifications_SetBkColor _Notifications_SetColor _Notifications_SetDateFormat _Notifications_SetSound _Notifications_SetTextAlign _Notifications_SetTimeFormat _Notifications_SetTransparency You can also set own functions to be called when notifications are clicked (see advanced example). And now? You can find more information in the UDF. There also are two example scripts to show the usage for GUIOnEventMode activated and deactivated. Another advanced example shows the usage of the Set-Functions. Thats it? Yup, have fun. Changelog Notifications.au3 ( v1.2) Notifications GUIMsg Example.au3 Notifications OnEvent Example.au3 Notifications Advanced Example.au31 point
-
Hi guys! I took @GaryFrost's Scripting Dictionary UDF and made just a few modifications. It now accepts multiple Scripting Dictionary objects around your script (many at once) and also allows you to choose any name for your variable. Also, it now uses OOP-like approach as proposed by @guinness. The modifications were too simple (and I would post it on the original thread, but it's dated 2007) so all credit goes to @GaryFrost. Example: #include 'scriptingdic.au3' #include <Array.au3> ; Needed only for _ArrayDisplay, and not required by the lib ; Init the object $oObj = _InitDictionary() ; Adding a single value _AddItem($oObj, 0, "Test") ; And showing it msgbox(0, '', _Item($oObj, 0)) ; Adding an array Dim $aArr[] = [0, -80, -49, -44, 80, 100, 8, 7, 6, 5, 4, 3, 2, 1] _AddItem($oObj, 1, $aArr) ; And showing it _ArrayDisplay(_Item($oObj, 1)) ; We can also use this approach: $oObj3 = _InitDictionary() $oObj.Add("test", "foo") MsgBox(0, '', $oObj.Item("test")) Download: scriptingdic.au31 point
-
Graph and charts in autoit
mLipok reacted to InunoTaishou for a topic
Does this work? #include <GUIConstants.au3> #include <String.au3> Global $hMain = GUICreate("Graph", 500, 300) Global $lblY = GUICtrlCreateLabel("", 75, 20, 2, 240) Global $lblX = GUICtrlCreateLabel("", 75, 260, 375, 2) Global $lblTitle = GUICtrlCreateLabel("Some random graph", 225, 10, 0, 20) Global $lblGood = GUICtrlCreateLabel("Good Side", 85, 265) Global $lblBarGood = GUICtrlCreateLabel("", 110, 242, 20, 260 - 242) Global $lblBad = GUICtrlCreateLabel("Bade Side", 225, 265) Global $lblBarBad = GUICtrlCreateLabel("", 250, 53, 20, 260 - 53) Global $iStart = 0 For $i = 260 to 10 Step -20 Local $sMark = $iStart $iStart += 10 ConsoleWrite(_StringRepeat(" ", 3 - StringLen($sMark)) & $sMark & @CRLF) GUICtrlCreateLabel(_StringRepeat(" ", 3 - StringLen($sMark)) & $sMark, 45, $i - 5, 25) GUICtrlSetFont(-1, 9, 400, 0, "Consolas") GUICtrlCreateLabel("", 70, $i, 5, 2) GUICtrlSetBkColor(-1, 0x000000) Next GUICtrlSetFont($lblTitle, 10, 400, 0, "Arial") GUICtrlSetBkColor($lblBarGood, 0x00FF00) GUICtrlSetBkColor($lblBarBad, 0xFF0000) GUICtrlSetBkColor($lblY, 0x000000) GUICtrlSetBkColor($lblX, 0x000000) GUISetState(@SW_SHOW, $hMain) While (True) Switch (GUIGetMsg()) Case $GUI_EVENT_CLOSe Exit 0 EndSwitch WEnd1 point -
This should do it: Local $data_size = GetStreamSize($sStream_Data) MsgBox(0, "", BinaryLen($data_size) & " bytes")1 point
-
I think you have what you need inside your own code: Local $iMemSize = _MemGlobalSize($hMemory) So you could use $GetStreamSize = _MemGlobalSize($bData) I'm not sure but I think it probably work. Another way is to analyze RGB data of the image, I don't know if _GDIPlus can do that. Interesting information here: http://www.scantips.com/basics1d.html Regards Alien.1 point
-
I won't upload a new version right now, so everyone interested pls add it for yourself for now: 1. Enter this line in line 281: GUICtrlSetCursor(-1, 0) 2. Replace lines 250 and 251 with this: If $__callFunction <> "" Then $__notificationList[$__notificationCount][4] = GUICtrlCreateLabel("", 0, 0, $__notificationWidth, $__closingButtonTop - 1) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetCursor(-1, 0) EndIf1 point
-
Here my results Test # 1 : Rows = 512 : Columns = 32768 : Penalty = 0 100.607 Sec : _ArraySort($aArray2D, 0, 0, 0, 0) 23.498 Sec : _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) Ratio = 4.3 Test # 2 : Rows = 1024 : Columns = 16384 : Penalty = 0 114.401 Sec : _ArraySort($aArray2D, 0, 0, 0, 0) 23.45 Sec : _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) Ratio = 4.9 Test # 4 : Rows = 4096 : Columns = 4096 : Penalty = 0 137.269 Sec : _ArraySort($aArray2D, 0, 0, 0, 0) 23.47 Sec : _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) Ratio = 5.8 Test # 8 : Rows = 8388608 : Columns = 2 : Penalty = 0 1072.845 Sec : _ArraySort($aArray2D, 0, 0, 0, 0) 883.013 Sec : _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) Ratio = 1.2 Just a silly question I don't understand the lines which are for COM interference, and also why to introduce so long sleep Thanks for the help1 point
-
There are several ways to get to the element - try a different one. Also check if you have frames - often IEgetobjbyname doesnt work because the element is contained in a frame.1 point
-
edit
Xandy reacted to JLogan3o13 for a topic
@magicmigel you seem to have missed the forum rules on your way in. I suggest you read them now, particularly the bit about Decompilation of AutoIt scripts or details of decompiler software, and you'll see why this thread was locked. On a secondary note, the file you uploaded just screamed malware when I examined it. If you are going to be unwise enough to mess around with such things that is your choice; please exercise a little common sense before uploading them to the forum.1 point -
Help with Hash
Tumulus reacted to InunoTaishou for a topic
You would use EncryptData to do what you want. What you're going to need is a crypt key that is used to encrypt and decrypt the information. #include <Crypt.au3> _Crypt_Startup() Global $sCryptKey = "EncryptThisData" Global $sUsername = _Crypt_EncryptData("FakeUsername2016", $sCryptKey, $CALG_AES_256) Global $sPassword = _Crypt_EncryptData("!FakePassword2016", $sCryptKey, $CALG_AES_256) MsgBox("", "Encrypted Data", "Username: " & $sUsername & @CRLF & "Password: " & $sPassword) $sUsername = BinaryToString(_Crypt_DecryptData($sUsername, $sCryptKey, $CALG_AES_256)) $sPassword = BinaryToString(_Crypt_DecryptData($sPassword, $sCryptKey, $CALG_AES_256)) MsgBox("", "Decrypt Data", "Username: " & $sUsername & @CRLF & "Password: " & $sPassword) _Crypt_Shutdown() You could still store the information in encrypted variables and decrypt them when you need to check it. Your information will still be stored in variables but they'll at least be somewhat protected. Another alternative is use a database to store all of your information (all of your account information). There is a way to use sqlite to encrypt all of your information and just have the script (user) access the database when it needs it. Prompting the user for the password to access the encrypted database. Wrong password should return an error. What this would mean is to access the database the user needs to give the proper password which is not saved inside of your program. I haven't used it before, I've only seen a couple of topics.1 point -
Use Elevated CMD
Tumulus reacted to JLogan3o13 for a topic
@Tumulus if you are doing this on a "number of computers", why are you not using Active Directory to automate it?1 point -
Run as a g4 bit compiled script on Operating System: Windows 10 Pro 64-bit CPU: Intel Core i7 3930K @ 3.20GHz 39 °C Sandy Bridge-E 32nm Technology RAM: 16.0GB DDR3 @ 686MHz (9-9-9-27) 2016-05-04 21:49:20 : Test # 1 : Rows = 512 : Columns = 32768 : Penalty = 8 2016-05-04 21:50:43 : 82874.451353783 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 21:51:05 : 17891.0788136815 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 21:51:45 : Test # 2 : Rows = 1024 : Columns = 16384 : Penalty = 8 2016-05-04 21:53:15 : 89442.9059982006 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 21:53:41 : 18227.9454162255 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 21:54:27 : Test # 3 : Rows = 2048 : Columns = 8192 : Penalty = 8 2016-05-04 21:56:05 : 98350.9272928814 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 21:56:35 : 17475.8334700289 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 21:57:24 : Test # 4 : Rows = 4096 : Columns = 4096 : Penalty = 8 2016-05-04 21:59:09 : 105236.219224862 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 21:59:42 : 17301.3922441432 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 22:00:35 : Test # 5 : Rows = 8192 : Columns = 2048 : Penalty = 8 2016-05-04 22:02:26 : 110781.084877993 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 22:03:04 : 17766.9943631727 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 22:04:02 : Test # 6 : Rows = 16384 : Columns = 1024 : Penalty = 8 2016-05-04 22:06:03 : 120854.19835518 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 22:06:45 : 18254.6572794107 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 22:07:49 : Test # 7 : Rows = 32768 : Columns = 512 : Penalty = 8 2016-05-04 22:09:58 : 128907.441270622 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 22:10:45 : 19264.1309021409 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1) 2016-05-04 22:12:10 : Test # 8 : Rows = 8388608 : Columns = 2 : Penalty = 8 2016-05-04 22:25:11 : 781343.570276423 _ArraySort($aArray2D, 0, 0, 0, 0) 2016-05-04 22:36:42 : 658688.551623695 _ArraySort_NEW2($aArray2D, 0, 0, 0, 1)1 point
-
An example of 3D bar graph using just native AutoIt functions. Example shown uses random numbers. #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Array.au3> Global $arNames[12] Global $arValues[12] Example1() Func Example1() Local $gui = GUICreate("Example 1: 3D Bar Graph", 550, 550) GUISetBkColor(0xffffff) $arNames=StringSplit("January|February|March|April|May|June|July|August|September|October|November|December","|",2) For $i=0 To 11 $arValues[$i]=Random(0,200,1) Next _CreateBarChart("3D Bar Chart","Example 1",-1,-1,500,500) GUISetState() While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($gui) Example2() EndSwitch WEnd EndFunc Func Example2() Local $gui = GUICreate("Example 2: 3D Bar Graph", 450, 350) GUISetBkColor(0xffffff) For $i=0 To 11 $arNames[$i]=$i+1 Next For $i=0 To 11 $arValues[$i]=Random(0,200,1) Next _CreateBarChart("3D Bar Chart","Example 2",20,20,400,300) GUISetState() While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($gui) Example3() ;Exit EndSwitch WEnd EndFunc Func Example3() Local $gui = GUICreate("Example 3: 3D Bar Graph", 850, 400) GUISetBkColor(0xffffff) For $i=0 To 11 $arNames[$i]=$i+1 Next For $i=0 To 11 $arValues[$i]=Random(0,200,1) Next _CreateBarChart("3D Bar Chart","Example 3 - without legend",-1,-1,400,300) $arNames=StringSplit("January|February|March|April|May|June|July|August|September|October|November|December","|",2) _CreateBarChart("3D Bar Chart","Example 3 - with legend",430,-1,400,350) GUISetState() While 1 Sleep(10) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIDelete($gui) ;Example3() Exit EndSwitch WEnd EndFunc ; #FUNCTION# ==================================================================================================== ; Name...........: _CreateBarChart ; Description....: Create 3D bar graph with native AutoIt functions ; Syntax.........: _CreateBarChart($sTitle1="",$sTitle2="",$iX=20,$iY=20,$iW=400,$iH=400) ; Parameters.....: $sTitle1 - Title of the graph, [Optional] ; $sTitle2 - Subtitle of the graph, [Optional] ; $iX - left margin, [Optional] ; $iY - top margin, [Optional] ; $iW - width of the graph, [Optional] ; $iH - height of the graph, [Optional] ; ; Return values..: none ; ; Author.........: Mihai Iancu (taietel at yahoo dot com) ; Remarks........: $array = ["name",value] ; - one with numbers/names (try to uncoment/coment them) ; - one with values ; =============================================================================================================== Func _CreateBarChart($sTitle1="",$sTitle2="",$iX=20,$iY=20,$iW=400,$iH=400) Local $max=_ArrayMax($arValues,1);compare numerically ;Local $values = UBound($arValues) Local $arColours[UBound($arNames)] Local $color For $i=0 To UBound($arValues)-1 $color = (Random(100, 255, 1) * 0x10000) + (Random(100, 255, 1) * 0x100) + Random(100, 255, 1) $arColours[$i]=$color Next ;set default values for the frame If $iX=-1 Then $iX=20 If $iY=-1 Then $iY=20 If $iW=-1 Then $iW=400 If $iH=-1 Then $iH=400 ;create frame for the chart $grp = GUICtrlCreateGroup("", $iX, $iY, $iW, $iH) ;title GUICtrlCreateLabel($sTitle1,$iX+15, $iY+10,$iW-30,-1,$SS_CENTER) GUICtrlSetColor(-1,0x002244) GUICtrlSetFont(-1, 9, 800, 0, "Arial") GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) GUICtrlCreateLabel($sTitle2,$iX+15, $iY+25,$iW-30,-1,$SS_CENTER) GUICtrlSetColor(-1,0x002244) GUICtrlSetFont(-1, 8, 800, 0, "Arial") GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) Local $Canvas If IsString($arNames[1]) Then $Canvas = _CreateBarCanvas($iX+15, $iY+15, $iW-110, $iH-60) GUICtrlCreateGroup("Legend", $Canvas[0]+$Canvas[2]+10, $Canvas[1]-5, ($iW-$Canvas[2])/2-10, $Canvas[3]+$Canvas[4]+5) For $i=0 To UBound($arNames)-1 GUICtrlCreateLabel($arNames[$i],$Canvas[0]+$Canvas[2]+20, $Canvas[1]+10+(($Canvas[3]+$Canvas[4]-15)/UBound($arNames))*$i,($iW-$Canvas[2])/2-30,13,$SS_CENTER) GUICtrlSetColor(-1,$arColours[$i]-0x444444) GUICtrlSetFont(-1, 8, 800, 0, "Arial") GUICtrlSetBkColor(-1,$arColours[$i]) Next GUICtrlCreateGroup("", -99, -99, 1, 1) Else $Canvas = _CreateBarCanvas($iX+15, $iY+15, $iW-50, $iH-60) For $i=0 To UBound($arNames)-1 GUICtrlCreateLabel($arNames[$i],$iX+52+(($Canvas[2]/UBound($arNames)))*$i+5, $iY+$iH-30) GUICtrlSetColor(-1,0x990000) GUICtrlSetFont(-1, 8, 800, 0, "Arial") GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) Next EndIf ;draw the bars GUICtrlCreateGraphic($Canvas[0]-0.5*$Canvas[4], $Canvas[1]+0.5*$Canvas[4], $Canvas[2], $Canvas[3],0) For $i=0 To UBound($arValues)-1 For $j=$Canvas[4]/2.5 To 0 Step -0.5 GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $arColours[$i]-0x333333, $arColours[$i]) GUICtrlSetGraphic(-1, $GUI_GR_RECT, 5+($Canvas[2]/UBound($arValues))*$i+$j, -2+$Canvas[3]-$j, 0.5*($Canvas[2]/UBound($arValues)), -($Canvas[3]/_RoundUp($max))*$arValues[$i]) Next Next GUICtrlSetGraphic(-1,$GUI_GR_REFRESH) For $i=0 To UBound($arValues)-1 ;values from the top of the bars GUICtrlCreateLabel($arValues[$i],$Canvas[0]+($Canvas[2]/UBound($arValues))*$i, $iH-$Canvas[1]+$Canvas[4]-10-(($Canvas[3]/_RoundUp($max))*$arValues[$i])) GUICtrlSetColor(-1,0x002244) GUICtrlSetFont(-1, 7, 800, 0, "Arial") GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) Next ;Y Axis For $i=0 To $Canvas[3] Step $Canvas[3]/5 GUICtrlCreateLabel(($i/$Canvas[3])*_RoundUp($max),$Canvas[0]-65,$Canvas[1]+$Canvas[3]+$Canvas[4]-$i,30,-1,$SS_RIGHT) GUICtrlSetColor(-1,0x990000) GUICtrlSetFont(-1, 8, 800, 0, "Arial") GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) Next GUICtrlCreateGroup("", -99, -99, 1, 1) EndFunc #Region INTERNAL USE ONLY Func _RoundUp($m) Local $rv = Round(Ceiling($m/10)*10,-1) ;ConsoleWrite($rv&@CRLF) Return $rv EndFunc Func _CreateBarCanvas($iX=0, $iY=0, $iW=400, $iH=400, $iDepthCanvas=30, $BgColor=0xEEEEEE) Local $iXCanvas=$iX+$iDepthCanvas Local $iYCanvas=$iY+10+2*$iDepthCanvas Local $iWCanvas=$iW-2*$iDepthCanvas Local $iHCanvas=$iH-2*$iDepthCanvas Local $BgColor2 = $BgColor - 0x333333 ;create bg for the bars For $i=0 To $iDepthCanvas; Step 0.5 GUICtrlCreateGraphic($iXCanvas+$i, $iYCanvas-$i, $iWCanvas, $iHCanvas, 0) GUICtrlSetBkColor(-1, $BgColor) GUICtrlSetColor(-1, $BgColor2) Next GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $iHCanvas) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $BgColor) GUICtrlSetGraphic(-1, $GUI_GR_LINE, -$iDepthCanvas-1, $iHCanvas+$iDepthCanvas+1) ;horizontal grid For $i=0 To $iHCanvas Step $iHCanvas/5 GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $BgColor2) GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWCanvas, $i) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i) GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $BgColor) GUICtrlSetGraphic(-1, $GUI_GR_LINE, -$iDepthCanvas, $i+$iDepthCanvas) Next Local $Canvas = StringSplit($iXCanvas+$iDepthCanvas &"|"& $iYCanvas-$iDepthCanvas&"|"&$iWCanvas&"|"&$iHCanvas&"|"&$iDepthCanvas,"|",2) ;ConsoleWrite($iXCanvas+$iDepthCanvas &"|"& $iYCanvas-$iDepthCanvas&"|"&$iWCanvas&"|"&$iHCanvas&@CRLF) Return $Canvas EndFunc #EndRegion INTERNAL USE ONLY Maybe someone find it useful. [EDIT] another nice example from boomingranny,1 point