Leaderboard
Popular Content
Showing content with the highest reputation on 08/20/2014 in all areas
-
AutoIt v.3.3.13.17 Beta
Richard Robertson and one other reacted to Jon for a topic
I need to make a feature request to invision - we need to get some way to allow people to start threads.2 points -
As AutoIt is limited with a 15 digits precision, ACos(-1) stay sufficient !2 points
-
I started this JSON library back in late 2007, because I needed a way to pass structured data between Javascript HTAs and AutoIt3 scripts. I've recently worked to get it in good enough shape to share with the AutoIt community, and while it still needs a bit more polish, the core functionality should be solid. Three files are included in the attached archive: JSON.au3 – the UDF Library itself. It includes a (very large) comment section at the top, which should provide sufficient documentation on how the various data types are encoded and decoded, as well as the various Javascript-based decoding extensions allowed (single-quoted strings, comments, etc.).JSON_Translate.au3 provides example functions for the powerful "translator" functionality. Translator functions can be used for both encoding and decoding. When encoding, it allows you to recursively convert your data from its normal format into the required data structures used by the JSON UDF library. When decoding, it allows you to convert the data in the opposite direction – from the JSON UDF library's data structures to the data structures your program normally uses. To use this functionality, you'll need to write your own translator functions, but this allows you to meet the custom needs of your own programs without having to hack JSON.au3. The examples provided in this file can probably be improved, but show one way of translating AutoIt-specific data types (such as binary and hwnd) back and forth.testJSON.au3 provides some quick examples of regular and translator-enhanced usage, which also help verify that encoding and decoding are working properly. These tests may not be comprehensive.The area needing the most work is error-handling. JSON data structures can be deeply nested, and it's tricky to make sure errors "bubble up" properly in AutoIt. (Plus, I need a flowchart to keep track of all my setError() numbers!) Thanks to Douglas Crockford of JSON.org, whose 2005 Javascript code for JSON encoding and decoding provided an excellent starting point for this library. Edit: updated to 0.9.1 on 2009-10-19 substantially updated opening commentsencoding: implemented logic to return "warning" @error flags for unsupported variable types & JSON objects with non-unique key stringsother minor fixes & tweaksJSON.7z1 point
-
This is a very very basic example of how to make your program require a serial number. Your serial number can be most anything you like within reason, it will be encrypted. The crypted serial for this basic example will be inside your program. if you want to use this examples serial it is "my serial" It works like this. 1. Your program looks at a registry key value. 2. if the value does not exist or is wrong, the user will be asked for a serial. 3. if serial is correct, the regkey and value will be written to the registry and user will not be asked again because the next time they run it, the key and value will be there. 4. if serial is wrong, the program simply exits with a message. This is a simple example and not intended to protect your program from attack/hack or anything else. You should always be aware that the registry is used by your operating system, and is not to be played with. Example using registry method Here is an even more basic example using a folder existence method.1 point
-
File Name: AutoIt v.3.3.13.18 Beta File Submitter: Jon File Submitted: 20 Aug 2014 File Category: Beta 3.3.13.18 (20th August, 2014) (Beta) AutoIt: - Fixed #2639: Unable to Copy/Paste from Embedded IE object. - Fixed #2839: GUISetAccelerators() with an invalid array can cause a hard crash. UDFs: - Changed: _ArrayInsert() now uses constants to change addition behaviour and datatype forcing. Click here to download this file1 point
-
Pretty much. I liked the way you could have integer and strings keys and also liked the idea of it staying in order of insertion when iterated. For background, the way I implemented it internally was by creating a generic AObject class that allows something to have properties and methods and then derived the Map class from this. Then the COM parser code is used to process it and can have a simple check in it of "is it a COM object or a generic AObject" then uses polymorphism to just "check for method", "call method" etc. Makes it easy to add object types in the future or add the lua-like table that trancexx was looking at. This is where the .Add() and .Keys() methods came in along with the .properties. But we had some discussions amongst ourselves and a lot of languages look really ugly when they try and mix procedural syntax and object-like syntax. I rewrote some function code to allow built-in functions to pass by reference so that functions like MapAdd() can now exist properly. So that's the main decision to be made. Pure object methods and properties, or remove the methods and properties and just use the Map...() functions and array-like access like $map["key"]. That's why both are still there at the mo - just can't decide. Even though it's implemented as an object internally, we don't have to expose that with .Methods if we don't like it. I implemented it as a value-type as well (like Array) but there were some discussions about having it behave like a reference type instead so that you could reference maps inside maps rather than just copies of maps. But I thought that it makes sense that arrays and maps should behave the same in that respect and it would be more useful to create a way in the language of creating a reference. I've not been able to get it to work though - the parser design just isn't up to it. At the mo I'm planning to do a stable release soon because there's been some big bugs fixed that I want out there, but that will almost certainly have maps disabled and then roll them into the next beta.1 point
-
AutoIt v3.3.13.16 Beta
coffeeturtle reacted to Jon for a topic
The COM initialisation changed from using OleInitialize() to CoInitialize(). The docs on the OleInitialize version have these remarks hidden away: I guess that explains it. I changed it back to OleInitialize and the script seems to work.1 point -
Get data from Edit box to appear the same in Listbox
the1stpoodle reacted to Zedna for a topic
Here is fixed code #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Test", 345, 252, 302, 218) $Button1 = GUICtrlCreateButton(">>", 156, 48, 31, 25) $ListBox1 = GUICtrlCreateList("", 200, 8, 137, 195, 0, 0) $Button2 = GUICtrlCreateButton("&Exit", 184, 225, 75, 25) $exit = ControlClick("Test", "", $Button2, "left") ;~ HotKeySet("!e", $exit) $Edit1 = GUICtrlCreateEdit("", 8, 8, 137, 201, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)) GUICtrlSetData(-1, "Edit1" & @CRLF & "Edit2" & @CRLF & "Edit3") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $Button1 $Read = GUICtrlRead($Edit1) $Read = StringReplace($Read, @CRLF, '|') GUICtrlSetData($ListBox1, $Read) MsgBox(0, "", $Read) Case $Button2 Exit EndSwitch WEnd Added: $Read = StringReplace($Read, @CRLF, '|')1 point -
or... $W = 1046 $H = 562 $newwidth = 640 ConsoleWrite("Width = " & $W & @CRLF) ConsoleWrite("Height = " & $H & @CRLF) _NewSize($W, $H) ConsoleWrite("New Width = " & $newwidth & @CRLF) ConsoleWrite("New Height = " & $H & @CRLF) Func _NewSize(ByRef $X, ByRef $Y) $H = Int($H / $W * $newwidth) EndFunc ..though almost the same as Melba's1 point
-
Get data from Edit box to appear the same in Listbox
the1stpoodle reacted to BrewManNH for a topic
You can't use @CRLF as the separator character for a Listbox, you must use "|" as the separator, unless you use Opt("GUIDataSeparatorChar", @CRLF) in your script to change it.1 point -
CodeCrypter - Encrypt your Script
mesale0077 reacted to jack71 for a topic
No offense but why would you want to encrypt a UDF that has been publicly made by another forum member? It would make sense to encrypt YOUR script and not the publicly made portion. Plus if someone wants to attempt to decompile your code, it will give props to the original author . Just my .02.1 point -
ImageSearch doesn't work at all.
13lack13lade reacted to AutID for a topic
What is your problem? What is not working? What is the error? Where are my keys? Where is my phone? There are a lot of unanswered question in the universe. But on the other hand, there are a lot of stupid questions. So it better stays this way. Welcome to the forum even if I don't believe that you are a newcomer! A small tip is to use IE UDF since you are automating a website. Or better, WinHttp UDF. Do yourself a favor, search.1 point -
vvdh, My coding skills have moved on a bit since then - you need to look for the $TVN_ITEMEXPANDEDW or $TVN_ITEMEXPANDEDA message like this (the example is taken from my ChooseFileFolder UDF): Func _CFF_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam ; Create NMTREEVIEW structure Local $tStruct = DllStructCreate("struct;hwnd hWndFrom;uint_ptr IDFrom;INT Code;endstruct;" & _ "uint Action;struct;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & _ "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;endstruct;" & _ "struct;uint NewMask;handle NewhItem;uint NewState;uint NewStateMask;" & _ "ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;lparam NewParam;endstruct;" & _ "struct;long PointX;long PointY;endstruct", $lParam) Local $hWndFrom = DllStructGetData($tStruct, "hWndFrom") ; The control sending the message - the treeview itself Local $hItem = DllStructGetData($tStruct, "NewhItem") ; The item within the treeview being expanded Local $iCode = DllStructGetData($tStruct, "Code") ; The code used If $hWndFrom = $hCFF_TreeView Then Switch $iCode Case 0xFFFFFFFD ; $NM_DBLCLK ; Fire the dummy control GUICtrlSendToDummy($cCFF_DblClk_Dummy) ; Set flag $fCFF_ActiveTV = True Case $TVN_ITEMEXPANDEDW, $TVN_ITEMEXPANDEDA ; Something is being expanded/contracted <<<<<<<<<<<<<<< ; Check that expansion is not ongoing If GUICtrlRead($cCFF_Expand_Dummy) = 0 Then ; Fire the dummy control GUICtrlSendToDummy($cCFF_Expand_Dummy, $hItem) EndIf ; Set flag $fCFF_ActiveTV = True EndSwitch EndIf EndFunc ;==>_CFF_WM_NOTIFY_Handler Please ask if you have any questions. M231 point