Jump to content

Leaderboard

Popular Content

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

  1. Updated first post. Draw world to pre-rendered layers. (For providing quick blit operations with separate layers) Map with auto-color detection. Delete tiles using lasers. /\ Some new hotkeys: Plus and minus (not on numpad): to change target layer. CTRL+M: to open map. Plus and minus (numpad): to change map scale. ESC: to exit map. Delete: destroy a tile on select layer. Aug 19 2018 11:20 EST: Added hot fix: If $tile > Ubound($aTile) - 1 Then $tile = 0 This fixes a crash that appeared inserting the default tile when 0 tiles were loaded.
    2 points
  2. I've been testing the subclassing technique in recent months and have used ComboBox examples for tests. Here is one of the examples. More examples will be added over the coming weeks. All examples are small and simple. However, all of them are based on the subclassing technique. It's the interesting aspect of the examples. Some are implemented with complete UDFs. Others are made as code examples only. First post becomes a list of examples as well as the first example. ComboBox Examples Color Combo (just below) Checkbox Combo Checkbox Combo slightly modified ListView Combo Other Control Examples Tabs and subtabs on demand My first script in the Examples forum. Well. You have to start somewhere. Windows Explorer address bar Colors and fonts in TreeViews Implementing Virtual TreeViews Hot-Track Enabled Toolbar Menu Simulating a modeless Choose Color Dialog Color Combo The first example is about color selection. It's an owner drawn ComboBox created with the $CBS_OWNERDRAWVARIABLE style so that colors can be displayed directly in the ComboBox by responding to $WM_DRAWITEM messages. There are already many of these examples, but none are implemented through the subclassing technique. The big advantage of subclassing is that a user of the UDF still can use his own $WM_DRAWITEM message handler through GUIRegisterMsg. The same Windows message can be used in both techniques without any conflicts. This is an example with a single ComboBox: #include <GUIConstantsEx.au3> #include "..\Includes\ComboColors.au3" Example() Func Example() ; Create GUI GUICreate( "1 ComboBox", 220, 264 ) ; Create ComboBox for color selection GUICtrlCreateLabel( "Named colors:", 10, 10, 200, 16 ) Local $aInfo = ComboColors_Create( "Tomato", 10, 26, 200, 26, 10, "Colors\NamedColors.txt", 9 ) ; $aInfo = [ $idComboBox, $aColors, $oColors, $sColors, $iColors ] ; $aColors = [ "Color name", 0xBackColor, 0xTextColor, 0xBrush ] ; $oColors dict obj: Key = "Color name", Val = index in $aColors ; $sColors = "Color0|Color1|Color2|..." ; $iColors = Number of colors ; Show GUI GUISetState() ; Message loop While 1 Switch GUIGetMsg() Case $aInfo[0] Local $sColor = GUICtrlRead( $aInfo[0] ) Local $iIndex = $aInfo[2]($sColor) ConsoleWrite( "Color = " & $sColor & @CRLF & _ "Index = " & $iIndex & @CRLF & _ "Back = 0x" & Hex( ($aInfo[1])[$iIndex][1], 6 ) & @CRLF & _ "Fore = 0x" & Hex( ($aInfo[1])[$iIndex][2], 6 ) & @CRLF & _ "Brush = " & ($aInfo[1])[$iIndex][3] & @CRLF & @CRLF ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup GUIDelete() EndFunc Two different sources can be used to specify colors: An array and a text file. It's demonstrated in examples. ComboColors_Create() is defined this way: ; Create ComboBox for color selection ; ; Error code in @error Return value ; 1 => Invalid color info file/array Success => [ $idComboBox, $aColors, $oColors, $sColors, $iColors ] ; 2 => Error creating ComboBox Failure => 0 ; 3 => Too many ComboBoxes ; Func ComboColors_Create( _ $sColorInit, _ ; Initial ComboBox color $x, $y, $w, $h, _ ; Left, top, width, height $iListRows, _ ; Rows in drop-down ListBox $vColorInfo, _ ; File/array with color info $iFirstRow = 0 ) ; First row with color info There is also a ComboColors_Delete() function. This is a picture of an example with two ComboBoxes: The example above and this example is included in zip-file. Zip-file You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. ColorSelection.7z
    1 point
  3. NOTE: TOPIC HAS BEEN MERGED TO HERE: MapIt Quest Special thanks: AdmiralAlkex, Melba23, MrCrearoR, Dragon Warrior 3, SDL MapIt is a tile world editor. MapIt was built around the concept of reversing Dragon Warrior map images. MapIt can take image input and produce a tile and world array. Changing and replacing tile / world data is easy. B/c tile world editor. CTRL+R in image above to signal replace tile action and I use "G" to Get the tile under mouse. A full list of hotkeys can be assigned in the: Help Menu\Hotkeys MapParser is a C++ project that scans images for unique tiles. MapIt can be downloaded without MapParser. MapParser can be toggled off in the Scan_Image dialog. Without MapParser, MapIt will use the Scan_Tiles() function written in AutoIt ; which is 100 * slower Idk. If MapParser.exe will not run for you: Installing Visual C++ Redistributable for Visual Studio 2015 should fix it: https://www.microsoft.com/en-us/download/details.aspx?id=48145 You can start with example world and tiles. Example world was made following these steps: Started with a tile map image of DragonWarrior3 town of: Reeve From MapIt World Menu \ New \ Scan_Image dialog, I set the area to exclude the key legend to the far right of image. After scanning the map image to world and tile array. I removed a few of the map artifacts. More work could be done on this world; removing unwanted tiles, but it is fine for now. I saved my world to disk. This creates folder: Worldname: Containing folder of Tiles and a Worldname.txt. Using The Gimp, I edited some tiles to have a transparent color: Stairs, Trees, Desk Tables, Chest-of-drawers, Chairs, Signs, Doors, Beds. I changed the world layers to 2: World Menu \ Properties. F9 Finds all selected tile on current layer and changes to a new selected tile on new layer. I used F9 to change all Trees on layer: 0 to Trees on layer: 1. Then I used F9 to change all Trees on layer: 0 to Grass on layer: 0 In this video you can see how I used the Tile Menu \ Replace From Disk option to remap tile images to my custom tiles. Conveniently my tiles already have a transparent pixel. See video for how that was done: To use the example world: First unzip the world save file: http://songersoft.com/programming/mapit/worlds/Reeve_Swapped.zip From the World Menu: choose \Load Navigate to the Reeve_Swapped.txt located in the extracted zip. Or you can scan any image. The map images I used are here: http://www.realmofdarkness.net/dq/games/nes/dw3/maps/world For download, videos, and example of created world file data; please visit the MapIt webpage: http://songersoft.com/programming/mapit/mapit_about.phtml
    1 point
  4. Maybe one option could be ControlEnable, another one would be some effort on your part.
    1 point
  5. search for setwindowrgn and you will get examples on non rectangular windows. I assume you then can make forms with holes in it
    1 point
  6. Hello. Here you have. $filepath=@ScriptDir & "\zero.wav" $sServerURL = "https://api.speechmatics.com/v1.0/user/41049/jobs/?auth_token=MmQ5MTk4ZjQtOGU5YS00OWFhLWI3YzUtOWZkMDYwZWI4Zjg0" $boundary = "------WinHttpBoundaryLine_96747.69683" $Postdata = $boundary & @CRLF & _ 'Content-Disposition: form-data; name="data_file"; filename="' & filename($filepath) & '"' & @CRLF & _ 'Content-Type: application/octet-stream' & @CRLF & @CRLF & _ BinaryToString(FileRead($filepath)) & @CRLF & _ $boundary & @CRLF & _ 'Content-Disposition: form-data; name="model"' & @CRLF & @CRLF & _ 'en-US' & @CRLF & _ $boundary & "--" & @CRLF $oHTTP = ObjCreate('winhttp.winhttprequest.5.1') $oHTTP.Open("POST", $sServerURL, False) $oHTTP.SetRequestHeader("User-Agent", 'Mozilla/5.0 (Windows NT 10.0; WOW64) WinHttp/1.6.3.9 (WinHTTP/5.1) like Gecko') $oHTTP.SetRequestHeader("Content-Type", 'multipart/form-data; boundary=----WinHttpBoundaryLine_96747.69683') $oHTTP.SetRequestHeader("Accept", "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,*/*;q=0.5") $oHTTP.SetRequestHeader("Accept-Charset", "utf-8;q=0.7") $oHTTP.SetRequestHeader('Content-Length', StringLen($Postdata)) $oHTTP.Send(Binary($Postdata)) $oHTTP.WaitForResponse() $hotlink = $oHTTP.ResponseText ConsoleWrite($hotlink) Func filename($filepath) Local $file = StringSplit($filepath, "\") Return $file[(UBound($file) - 1)] EndFunc Saludos
    1 point
  7. ContolSetText is another quick option Func _OutFile() $TempEdit = GUICtrlRead($Edit1) $OutEdit = StringReplace($TempEdit, @LF, "") Run("notepad.exe") WinWaitActive("Untitled - Notepad") Sleep(1000) ControlSetText("Untitled - Notepad", "", "Edit1", $OutEdit) EndFunc
    1 point
  8. Easiest way would be with _jQuerify -- #include <IE.au3> $oIE = _IECreate("https://www.hkex.com.hk/Market-Data/Futures-and-Options-Prices/Equity-Index/Hang-Seng-Index-Futures-and-Options?sc_lang=en#&product=HSI") $jQuery = _jQuerify($oIE) $jQuery('.sewvbm > li:nth-child(2)').click() ; #FUNCTION# ==================================================================================================================== ; Name ..........: _jQuerify ; Description ...: ; Syntax ........: _jQuerify(Byref $oIE) ; Parameters ....: $oIE - Object variable of an InternetExplorer.Application. ; Return values .: an object variable pointing to the jQuery library ; Author ........: Chimp ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _jQuerify(ByRef $oIE) Local $msie, $jsEval, $jQuery, $otherlib = False $msie = Execute('$oIE.document.documentMode') If ($msie = "") Or Number($msie) < 11 Then ; an IE version < 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('window.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.parentwindow.eval') Until IsObj($jsEval) Else ; IE version > = 11 ; create a reference to the javascript eval() function $oIE.document.parentWindow.setTimeout('document.head.eval = eval', 0) Do Sleep(250) $jsEval = Execute('$oIE.Document.head.eval') Until IsObj($jsEval) EndIf ; if jQuery is not already loaded then load it If $jsEval("typeof jQuery=='undefined'") Then ; check if the '$' (dollar) name is already in use by other library If $jsEval("typeof $=='function'") Then $otherlib = True Local $oScript = $oIE.document.createElement('script'); $oScript.type = 'text/javascript' ; If you want to load jQuery from a disk file use the following statement ; where i.e. jquery-1.9.1.js is the file containing the jQuery source ; (or also use a string variable containing the whole jQuery listing) ;~ $oScript.TextContent = FileRead(@ScriptDir & "\jquery-1.9.1.js") ; <--- from a file ; If you want to download jQuery from the web use this statement $oScript.src = 'https://code.jquery.com/jquery-latest.min.js' ; <--- from an url $oIE.document.getElementsByTagName('head').item(0).appendChild($oScript) Do Sleep(250) Until $jsEval("typeof jQuery == 'function'") EndIf Do Sleep(250) $jQuery = $jsEval("jQuery") Until IsObj($jQuery) If $otherlib Then $jsEval('jQuery.noConflict();') Return $jQuery EndFunc ;==>_jQuerify
    1 point
  9. I ran into the same thing. It doesn't look like a console compiled a3x is able to write to the console (tried on Win7 and Win10 x64). I used this workaround. ;~** put this near beginning of program ** DllCall("kernel32.dll", "bool", "AllocConsole") $hConsole = DllCall("kernel32.dll", "handle", "GetStdHandle", "int", -11) ;~** this is the function to call to write to the new console ** Func _cprint($str) $aRet = DllCall("kernel32.dll", "bool", "WriteConsoleW", "handle", $hConsole[0], "wstr", $str, "dword", StringLen($str), "dword*", 0, "ptr", 0) EndFunc ;~** put this at the end of the program DllCall("kernel32.dll","bool","FreeConsole") ;~** the message box is just used to hold the console window open, otherwise it will close after the program is done and you won't see anything MsgBox(0, "done", "done") This works good if you are running it on a desktop session, but if you are remote connected to another machine through a console, it won't work.
    1 point
  10. Melba23

    Keyloggers

    The Forum Rules specifically mention that "keyloggers" are a prohibited subject on this forum. Of late we have had several threads locked because they have strayed (usually unwittingly) into keylogger territory. Here is a reminder of what Jon (the site owner) has set out as the basis for acceptability: "how to check for a few keys being pressed is one thing" We are not going to define "a few" in absolute terms, but if you post any code which checks for the best part of the keyboard you can be absolutely sure that you are in breach of the rules, that your thread will be locked, and that sanctions may follow. So please do not post such scripts - we do not want to be heavy-handed, but after this announcement your excuses had better be very good ones! M23
    1 point
  11. Melba23

    Keyloggers

    Previously when code which was (or could very easily be converted to) a keylogger has appeared on the forum I have limited my actions to deleting the code and warning the poster. I even went to the trouble to post the above announcement so there could be no doubt as to the fact that such code was not permitted here. Yesterday I had to remove code which checked the entire keyboard and lit up the pressed key on a "virtual keyboard" GUI. Note that the post above talks of "code which checks for the best part of the keyboard" - that is exactly what this code did and with the addition of a few lines it could easily have been turned into a crude, but entirely workable, keylogger. The poster is now enjoying a short holiday - and the same fate awaits anyone else who posts similar code in future. The prohibitions in the Forum rules are there to keep this forum clean and to protect the reputation of AutoIt - which is in the interests of us all. Please use your brains and do not post code which flouts the spirit, if not the exact letter, of the rules. If you do then do not complain if you are moderated and warned. M23
    1 point
  12. JLogan3o13

    Asked assistant

    @amerali this forum is here to help people with their own scripts; it is not a place where you put in an order and someone barfs up the code for you. You have not been specific, and until you are, we cannot help: What site are you trying to upload to - your site, a third party site, etc. How are you expecting to upload the file - FTP, etc, Help us help you.
    0 points
×
×
  • Create New...