Leaderboard
Popular Content
Showing content with the highest reputation on 03/25/2019 in all areas
-
[BUGFIX VERSION] - 6 Apr 24 Fixed: UDF failed if header colours were initialised but not specifically set. New UDF in the zip below. -------------------------------------------------------------------------------------- Note: This is a new recoded and expanded version of my earlier UDF of the same name. If you move to this new version there might well be several script-breaking changes, particularly when setting which columns are to be editable. Please read the "Beginner's Guide" and look at the included example scripts to see where things have changed. -------------------------------------------------------------------------------------- This UDF allows you to do much more with ListView controls (either native or UDF created): Edit the content with plain text, combos or date-time pickers - and edit the headers too Move rows within the ListView Drag rows both within the ListView and to other ListViews in the same GUI (or not as required) Insert and delete columns and rows Sort columns by simply clicking the header Colour individual ListView items and headers Only select a single cell rather then the entire row Save and load entire ListViews For the advanced user: If you use certain Windows message handlers (In particular WM_NOTIFY) in your script, please read the function headers for the equivalent handlers within the UDF. Here is the UDF, with 6 examples and the guide, in zip format: GUIListViewEx.zip Credit to: martin (basic drag code), Array.au3 authors (array functions), KaFu and ProgAndy (font function), LarsJ (colouring code) Happy to take compliments or criticism - preferably the former! M231 point
-
Thank you!! that works perfectly1 point
-
put this two lines in front of your script. Opt("ExpandVarStrings", 1) ;0=don't expand, 1=do expand Opt("ExpandEnvStrings", 1) ;0=don't expand, 1=do expand1 point
-
Notify when specified user password has been changed
Earthshine reacted to BrewManNH for a topic
The best training is to actually read the help file and the thousands of example scripts inside of it, and look at what each function is doing and how to change them to your needs. Reading from a book is great if you're in a classroom and there will be a test later, but that's not how to learn anything.1 point -
consolewrite can read ini values but why can i not use them in script?
FrancescoDiMuro reacted to Jos for a topic
Thanks, guess I've never used that as I don't like these types of declarations.1 point -
Just an introduction..
powbam reacted to JLogan3o13 for a topic
@powbam While we understand that the game you are modding may be open to such automation, and may even have the developers' blessing, it is still not something we want discussed here. AutoIt has a long history of struggling against the bad reputation of game botters, viewed by many other players and by companies as cheaters. The goal of this forum is to provide a place where people can learn and improve their skills at using the language, so long as those uses do not harm the AutoIt's reputation. Welcome to the forum nevertheless. Please do go through the rest of the forum rules now that you have found them, and bear them in mind when posting in the future. Hope to see you soon with a legitimate question.1 point -
Forum has some limitation/configuration in this regards, but I do not remember exactly.1 point
-
January 2, 2019: New SciTE4AutoIt3 available with the updated SciTE v4.1.2 release
argumentum reacted to Jos for a topic
Iam not going to implement these kinds of requests as they potentially could cripple the script and doubt this saves much space anyways. Jos1 point -
1 point
-
Welcome to AutoIt and the forum! What have you tried so far?1 point
-
Autoclick on emulator
yutijang reacted to JLogan3o13 for a topic
Throughout this entire thread you seem to be at the same time hurling thinly veiled insults at those trying to help you while at the same time showing zero effort yourself in trying to resolve the issue. You seem at once to be waiting for someone to spoon-feed the code to you while complaining because they aren't getting around to it quickly enough to suit you. You keep stating it is too complex for everyone here, yet you are here because it is too complex for you; perhaps some willingness to follow suggestions and provide decent feedback rather than "it won't work" will get you farther toward your goal. As you have seen already, several of the forum's most prolific helpers have bowed out; perhaps think about changing your approach if you would like people to continue to offer assistance. Edit: Apologies @Jos stepped on your close1 point -
I feels like you just burned you last option to get help here.... so lets close this topic and not continue it any further. Jos1 point
-
1 point
-
Autoclick on emulator
yutijang reacted to Earthshine for a topic
how is it not a programming language? just because it's interpreted? just like Python? hahahaha sounds like a n003 to me. so if you know so much, go write your function that you need--in this non programming language.. and when we say post code, it's post the CODE, not a gif.1 point -
I found different solutions to do it and I finally decided to merge them in a single "optimal" code. During the typing it checks each new word (from the previous whitespace to the current pointer) and proposes to complete it with words included in a array. Predicted words are shown in a list under the input field and can be selected with mouse or with up/down/enter keys. These are the sources considered to create this code: '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> '?do=embed' frameborder='0' data-embedContent>> And this is the code: #include <GUIConstantsEx.au3> #include <WinAPI.au3> #Include <GuiListBox.au3> #include <WindowsConstants.au3> Global $asKeyWords[21] = [20, "fight", "first", "fly", "third", "fire", "wall", "hi", "hello", "world", "window", _ "window 1", "window 2", "window 3", "window 4", "window 5", "window 6", "window 7", "window 8", "window 9", "window 10"] _Main() Func _Main() Local $hGUI, $hList, $hInput, $aSelected, $sChosen, $hUP, $hDOWN, $hENTER, $hESC Local $sCurrInput = "", $aCurrSelected[2] = [-1, -1], $iCurrIndex = -1, $hListGUI = -1 $hGUI = GUICreate("AutoComplete Input Text", 300, 100) GUICtrlCreateLabel('Start to type words like "window" or "fire" to test it:', 10, 10, 280, 20) $hInput = GUICtrlCreateInput("", 10, 40, 280, 20) GUISetState(@SW_SHOW, $hGUI) $hUP = GUICtrlCreateDummy() $hDOWN = GUICtrlCreateDummy() $hENTER = GUICtrlCreateDummy() $hESC = GUICtrlCreateDummy() Dim $AccelKeys[4][2] = [["{UP}", $hUP], ["{DOWN}", $hDOWN], ["{ENTER}", $hENTER], ["{ESC}", $hESC]] GUISetAccelerators($AccelKeys) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hESC If $hListGUI <> -1 Then ; List is visible. GUIDelete($hListGUI) $hListGUI = -1 Else ExitLoop EndIf Case $hUP If $hListGUI <> -1 Then ; List is visible. $iCurrIndex -= 1 If $iCurrIndex < 0 Then $iCurrIndex = 0 EndIf _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hDOWN If $hListGUI <> -1 Then ; List is visible. $iCurrIndex += 1 If $iCurrIndex > _GUICtrlListBox_GetCount($hList) - 1 Then $iCurrIndex = _GUICtrlListBox_GetCount($hList) - 1 EndIf _GUICtrlListBox_SetCurSel($hList, $iCurrIndex) EndIf Case $hENTER If $hListGUI <> -1 And $iCurrIndex <> -1 Then ; List is visible and a item is selected. $sChosen = _GUICtrlListBox_GetText($hList, $iCurrIndex) EndIf Case $hList $sChosen = GUICtrlRead($hList) EndSwitch Sleep(10) $aSelected = _GetSelectionPointers($hInput) If GUICtrlRead($hInput) <> $sCurrInput Or $aSelected[1] <> $aCurrSelected[1] Then ; Input content or pointer are changed. $sCurrInput = GUICtrlRead($hInput) $aCurrSelected = $aSelected ; Get pointers of the string to replace. $iCurrIndex = -1 If $hListGUI <> -1 Then ; List is visible. GUIDelete($hListGUI) $hListGUI = -1 EndIf $hList = _PopupSelector($hGUI, $hListGUI, _CheckInputText($sCurrInput, $aCurrSelected)) ; ByRef $hListGUI, $aCurrSelected. EndIf If $sChosen <> "" Then GUICtrlSendMsg($hInput, 0x00B1, $aCurrSelected[0], $aCurrSelected[1]) ; $EM_SETSEL. _InsertText($hInput, $sChosen) $sCurrInput = GUICtrlRead($hInput) GUIDelete($hListGUI) $hListGUI = -1 $sChosen = "" EndIf WEnd GUIDelete($hGUI) EndFunc ;==>_Main Func _CheckInputText($sCurrInput, ByRef $aSelected) Local $sPartialData = "" If (IsArray($aSelected)) And ($aSelected[0] <= $aSelected[1]) Then Local $aSplit = StringSplit(StringLeft($sCurrInput, $aSelected[0]), " ") $aSelected[0] -= StringLen($aSplit[$aSplit[0]]) If $aSplit[$aSplit[0]] <> "" Then For $A = 1 To $asKeyWords[0] If StringLeft($asKeyWords[$A], StringLen($aSplit[$aSplit[0]])) = $aSplit[$aSplit[0]] And $asKeyWords[$A] <> $aSplit[$aSplit[0]] Then $sPartialData &= $asKeyWords[$A] & "|" EndIf Next EndIf EndIf Return $sPartialData EndFunc ;==>_CheckInputText Func _PopupSelector($hMainGUI, ByRef $hListGUI, $sCurr_List) Local $hList = -1 If $sCurr_List = "" Then Return $hList EndIf $hListGUI = GUICreate("", 280, 160, 10, 62, $WS_POPUP, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST, $WS_EX_MDICHILD), $hMainGUI) $hList = GUICtrlCreateList("", 0, 0, 280, 150, BitOR(0x00100000, 0x00200000)) GUICtrlSetData($hList, $sCurr_List) GUISetControlsVisible($hListGUI) ; To Make Control Visible And Window Invisible. GUISetState(@SW_SHOWNOACTIVATE, $hListGUI) Return $hList EndFunc ;==>_PopupSelector Func _InsertText(ByRef $hEdit, $sString) #cs Description: Insert A Text In A Control. Returns: Nothing #ce Local $aSelected = _GetSelectionPointers($hEdit) GUICtrlSetData($hEdit, StringLeft(GUICtrlRead($hEdit), $aSelected[0]) & $sString & StringTrimLeft(GUICtrlRead($hEdit), $aSelected[1])) Local $iCursorPlace = StringLen(StringLeft(GUICtrlRead($hEdit), $aSelected[0]) & $sString) GUICtrlSendMsg($hEdit, 0x00B1, $iCursorPlace, $iCursorPlace) ; $EM_SETSEL. EndFunc ;==>_InsertText Func _GetSelectionPointers($hEdit) Local $aReturn[2] = [0, 0] Local $aSelected = GUICtrlRecvMsg($hEdit, 0x00B0) ; $EM_GETSEL. If IsArray($aSelected) Then $aReturn[0] = $aSelected[0] $aReturn[1] = $aSelected[1] EndIf Return $aReturn EndFunc ;==>_GetSelectionPointers Func GUISetControlsVisible($hWnd) ; By Melba23. Local $aControlGetPos = 0, $hCreateRect = 0, $hRectRgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) Local $iLastControlID = _WinAPI_GetDlgCtrlID(GUICtrlGetHandle(-1)) For $i = 3 To $iLastControlID $aControlGetPos = ControlGetPos($hWnd, '', $i) If IsArray($aControlGetPos) = 0 Then ContinueLoop $hCreateRect = _WinAPI_CreateRectRgn($aControlGetPos[0], $aControlGetPos[1], $aControlGetPos[0] + $aControlGetPos[2], $aControlGetPos[1] + $aControlGetPos[3]) _WinAPI_CombineRgn($hRectRgn, $hCreateRect, $hRectRgn, 2) _WinAPI_DeleteObject($hCreateRect) Next _WinAPI_SetWindowRgn($hWnd, $hRectRgn, True) _WinAPI_DeleteObject($hRectRgn) EndFunc ;==>GUISetControlsVisible Any advice to improve the code is welcome.1 point
-
New Version includes major changes: Improvements made to wind simulation and more realisic correlation between average wind speed and chime activity using an asymptotic algorithm. Wind speeds range from 1 to 60 mph. There are now eleven different instruments to choose from - each creating a unique ambience. I have retuned all the chimes to produce much better musical results in Randomise mode. There will always be some accidental dissonances with wind chimes, but the random element can sometimes produce surprising and interesting results. I have also fixed a couple of errors in the earlier chime arrangements, created a new Custom GUI. Latest Version (30-12-2012) hirajoshi2.4.3.zip Previous Downloads 87 Change Log (20-06-2012) Change Log (14-06-2012) Change Log (30-12-2012) Eat your heart out Pink Floyd! Have fun!1 point
-
As a general point about looping through an array - If you loop through an array and possibly delete an element as you go then you must loop from the last to the first. (Or you complicate the code as M23's example.) Otherwise you will loose track of where you are in the array and the final value for the array element will be invalid if any elements were removed. #include <array.au3> Local $array[5]; $array[0] = "c" $array[1] = "b" $array[2] = "e" $array[3] = "c" $array[4] = "f" For $n = UBound($array) - 1 to 0 step -1 If $array[$n] = "c" Then _ArrayDelete($array, $n) EndIf Next ConsoleWrite("result===================" & @CRLF) For $element IN $array ConsoleWrite($element & @CRLF) Next1 point
-
Steveiwonder, You cannot use a For...In loop for this as you are trying to modify the array. From the Help file: Autoit Array's are read-only when using For...In. While you can assign the variable inside the For...In loop a value, this change is not reflected in the array itself. To modify the contents of an array during enumeration, use a For...To loop. So for what you are trying to do you need something like this: #include <array.au3> Local $array[5] = ["a", "b", "c", "d", "e"] _ArrayDisplay($array) For $i = 0 To UBound($array) - 1 ConsoleWrite("Testing " & $array[$i] & @CRLF) If $array[$i] = "c" Then ConsoleWrite("Deleting " & $array[$i] & @CRLF) _ArrayDelete($array, $i) ; But we have shortened the array, so we need to do 2 things ; 1. Adjust the index so Next keeps us in the same place (we have just replaced the index we tested with the one below $i -= 1 EndIf ; 2. Test that we are not over the end of the shortened array as we cannot change the end value once we have started If $i = UBound($array) - 1 Then ExitLoop Next _ArrayDisplay($array)As you can see it is fairly simple, but you need the extra lines. Modifying arrays in a loop is pretty fraught experience - you might prefer to create a new array like this: #include <array.au3> Local $array[5] = ["a", "b", "c", "d", "e"] _ArrayDisplay($array) ; Create blank array Global $Newarray[UBound($array)] $iNewcount = 0 For $i = 0 To UBound($array) - 1 ConsoleWrite("Testing " & $array[$i] & @CRLF) If $array[$i] <> "c" Then $Newarray[$iNewcount] = $array[$i] ConsoleWrite("Copying " & $array[$i] & @CRLF) $iNewcount += 1 Else ConsoleWrite("Missing " & $array[$i] & @CRLF) EndIf Next ; get rid of blank elements Redim $Newarray[$iNewcount] _ArrayDisplay($Newarray)Your choice! M231 point