Leaderboard
Popular Content
Showing content with the highest reputation on 05/26/2018 in all areas
-
#include <GuiSlider.au3> #include <SendMessage.au3> #include <WindowsConstants.au3> $iPercent = 30 ; volume % (0-100) $hWnd = WinGetHandle("SoundWire Server") $hCtrl = ControlGetHandle($hWnd, "", "msctls_trackbar324") _GUICtrlSlider_SetPos($hCtrl, (100 - $iPercent) * 655.35) _SendMessage($hWnd, $WM_VSCROLL, 0, $hCtrl)2 points
-
A cursory websearch would provide plenty of evidence that this is simply untrue, see for example here, here, or here. Or here and here. I'll stop now. And don't get me started on "optimised" compilers attempting to second-guess (and completely wreck) carefully planned, intentional design that takes low-level features and architecture quirks into account. I consider this to be terrible advice as well. C abstraction can obfuscate actual low-level implementation to the point where various types of Heisenbugs become virtually impossible to fix, and you're better off just binning your code and starting from scratch again while following a different implementation model. More generally, if the OP wants to engage with assembly, then maybe we should be providing some forum links that address this interest, rather than suggesting completley different approaches, e.g.: AutoIt Inline Assembly, by Ward FASM, also by Ward Extended FASM, by Beege AssembleIt, by AndyG Assember in AutoIt, by Kip Inline Assembler Snippets, by UEZ Some implementation examples in AutoIt are here, here, and here.2 points
-
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.phtml1 point
-
Cool, thanks a lot. Saved me from a lot of work. I was going to make the combo box an input box and have a list box below to show the history. On enter in the input box, I would have intercepted the enter event and added to the list. The user could recall the history by clicking and selecting on the list box which would populate the input box. Why will this not work though? #include <GUIConstantsEx.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <EditConstants.au3> Global $idComboBox Example() Func Example() Local $hGUI = GUICreate("Example", 300, 200) $idComboBox = GUICtrlCreateCombo("Item 1", 10, 10, 185, 20) Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUICtrlSetData($idComboBox, "Item 2|Item 3", "Item 2") GUISetState(@SW_SHOW, $hGUI) While 1 ; If ControlGetFocus($hGUI, "") = "Edit1" Then ; If _IsPressed("0D") Then DoCmd() ; EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop case _IsPressed("0D") if _GuiCtrlGetFocus($hGUI) = $idComboBox then DoCmd() endif EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func DoCmd() GUICtrlSetData($idComboBox, GUICtrlRead($idComboBox)) MsgBox(4096, "ComboBox", "Enter Pressed") EndFunc Func _GuiCtrlGetFocus($GuiRef) Local $hwnd = ControlGetHandle($GuiRef, "", ControlGetFocus($GuiRef)) Local $result = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hwnd) Return $result[0] EndFunc Still, can't be greedy, I will use your working solution Edit - Actually this works, just had to reverse some code #include <GUIConstantsEx.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <EditConstants.au3> Global $idComboBox Example() Func Example() Local $hGUI = GUICreate("Example", 300, 200) $idComboBox = GUICtrlCreateCombo("Item 1", 10, 10, -1, -1) Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUICtrlSetData($idComboBox, "") ;Item 2|Item 3", "Item 2") GUISetState(@SW_SHOW, $hGUI) While 1 ; If ControlGetFocus($hGUI, "") = "Edit1" Then ; If _IsPressed("0D") Then DoCmd() ; EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop case _GuiCtrlGetFocus($hGUI) = $idComboBox if _IsPressed("0D") then DoCmd() endif EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func DoCmd() local $val $val = GUICtrlRead($idComboBox) GUICtrlSetData($idComboBox, $val) ConsoleWrite("executing " & $val) sleep(100) ; Important - thanks Mikell , otherwise you get repeats ; MsgBox(4096, "ComboBox", "Enter Pressed") EndFunc Func _GuiCtrlGetFocus($GuiRef) Local $hwnd = ControlGetHandle($GuiRef, "", ControlGetFocus($GuiRef)) Local $result = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hwnd) Return $result[0] EndFunc Thanks mikell for your contribution1 point
-
If you use the AutoIt Window Info tool you can get the name of the control, usually it will start at Edit1 and then the next Edit control will be Edit2 etc...1 point
-
Depending on the code to be executed in the DoCmd() function, may I suggest to place a little "Do/Sleep/Until not _IsPressed" at the bottom of the "If _IsPressed" condition1 point
-
Maybe something like: #include <GUIConstantsEx.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> Global $idComboBox Example() Func Example() Local $hGUI = GUICreate("Example", 300, 200) $idComboBox = GUICtrlCreateCombo("Item 1", 10, 10, 185, 20) Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUICtrlSetData($idComboBox, "Item 2|Item 3", "Item 2") GUISetState(@SW_SHOW, $hGUI) While 1 If ControlGetFocus("Example", "") = "Edit1" Then If _IsPressed("0D") Then DoCmd() EndIf Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClose ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func DoCmd() GUICtrlSetData($idComboBox, GUICtrlRead($idComboBox)) MsgBox(4096, "ComboBox", "Enter Pressed") EndFunc1 point
-
@b9k #include <GuiSlider.au3> $hCtrl = ControlGetHandle("SoundWire Server", "", "msctls_trackbar324") $aRange = _GUICtrlSlider_GetRange($hCtrl) ConsoleWrite($aRange[0] & ":" & $aRange[1] & @CRLF) _GUICtrlSlider_SetPos($hCtrl, $aRange[1] * 0.5) ; 50% ControlSend("SoundWire Server", "", $hCtrl, "{up}") MsgBox(0, "", "50%") _GUICtrlSlider_SetPos($hCtrl, $aRange[1]) ; min ControlSend("SoundWire Server", "", $hCtrl, "{up}") MsgBox(0, "", "min") _GUICtrlSlider_SetPos($hCtrl, $aRange[1] * 0.3) ; 70% ControlSend("SoundWire Server", "", $hCtrl, "{up}") MsgBox(0, "", "70%") _GUICtrlSlider_SetPos($hCtrl, $aRange[0]) ; max ControlSend("SoundWire Server", "", $hCtrl, "{up}") MsgBox(0, "", "max")1 point
-
Get a name or ID by the last 3 characters in Internet Explorer [Solved]
SkysLastChance reacted to mikell for a topic
Couldn't such a simple workaround be used ? $var = "_26" ; $sHTML = '<input name="in2xk_92" class="navitem s_147" id="in2xk_26" style="..." etc>' $sHTML = _IEDocReadHTML($oIE) $id = StringRegExpReplace($sHTML, '(?s).*?id="(\w+' & $var & ').*', "$1") ; Msgbox(0,"", $id) $oInput = _IEGetObjById($oIE, $id) ; etc1 point -
Hotstrings topic in example scripts might also be worth a look at.1 point
-
Is this you want? #include <Misc.au3> HotKeySet("{ESC}" , "_close") While 1 if _IsPressed("11") And _IsPressed("12") And _IsPressed("4F") Then MsgBox(0,0,"You Are Pressed CTRL + ALT + O") EndIf Wend Func _close() Exit EndFunc1 point
-
Excel UDF Error
JohnyX reacted to JLogan3o13 for a topic
@JohnyX this is where searching the forum becomes your best friend. There are numerous threads around comparing items in arrays. Here is just one quick and dirty example you would have found: #include <Array.au3> Local $aArray1[0] Local $aArray2[0] For $a = 1 To 100 ;Build arrays _ArrayAdd($aArray1, $a) Switch $a Case 20, 34, 45, 67, 89, 91 ;Do nothing Case Else _ArrayAdd($aArray2, $a) EndSwitch Next For $iIndex In $aArray1 If (_ArraySearch($aArray2, $iIndex)) = -1 Then ConsoleWrite($aArray1[$iIndex] & " not found in $aArray2" & @CRLF) Next You should be able to modify this to your needs pretty easily.1 point -
Not sure what you are asking. Yes you can enforce a script to be ran as Administrator with #RequireAdmin, but that will trigger UAC in case it isn't running at that level yet, unless UAC is disabled. Jos1 point