Leaderboard
Popular Content
Showing content with the highest reputation on 06/13/2022 in all areas
-
From MiniMax to Machine Learning ... Tic Tac Toe is a good game for studying AI algorithm because it's simple! I use Tabular Q Learning to implement this game, Every time a game finished, it will use the Q function to update the score of each steps it played. Q(S,A) = Q(S,A) + α ∗ (γ ∗ maxaQ(S′,a) − Q(S,A)) S being the current state, A the current action, S′ the state after doing A, α being the learning rate, γ being the discount factor, and maxaQ(S′,a) the highest Q value of any move in the next state S′, i.e. the Q value of the best move in the following state. It's funny to see that it plays better and better. That's why people were charmed by Machine Learning! Thank you! Download: tic_tac_toe.zip2 points
-
Au3toCmd --- Avoid false virus positives Since many virus scanners sometimes prevent a "compiled autoit EXE" from being executed as "false positive", the "*.A3X" format is a suitable format to avoid this problem. See here for more information. In order to simplify this procedure, I wrote the Au3toCmd script. Here a *.Cmd file is generated from a *.Au3 file. The necessary files Autoit3.exe and *.A3x are added to the "*.Cmd" file as "alternate data streams" "Base64" encoded data. Now the Autoit Script can be called by clicking on the cmd file and the anti-virus scanners do not recognize the "false positive". If the short-term flashing of the CMD window bothers you, you can click the desktop shutcut that runs in a minimized window. Unfortunately, because the "alternate data streams", this CMD file cannot be distributed via FTP or email. Only a USB sti ck or removable disk formatted with NTFS can be used. As the new version now uses Base64 data instead of ADS, this statement is out of date. For reasons of compatibility, the old version was sunk into the spoiler here. The script can be called with a file name of an AU3 script as a parameter. If no name is entered, a query is made. For more information, see the header of the script. Suggestions, improvements and bug reports are welcome. Here the versions using base64 data Version: 2022.05.12 (Support blanks in pathnames) Version: 2022.06.23 (Support release candidates. Changed @CrLf to @Lf. Annual cleaning. Optimized #AutoIt3Wrapper handling) Version: 2022.07.22 (Support scripts with the same name but different content in different directories) Version: 2022.07.27 (Support blanks in usernames) Au3toCmd.au3 Version: 2022.09.01 (Optimized annual cleaning) Au3toCmd.au31 point
-
Refresh the page and copy the code again i edited my post twice and the second time i removed a "or 1" from the if block that checks red1 point
-
Hi @Majedz. I guess you want to count the number of red and blue lines? then here: $iRed = 0 $iBlue = 0 For $L=1 to 19 $yLine=280+($L*20); the Y coordination of the first line is 300; so 300-20 is 280 MouseMove(28,$yLine); local $color1=PixelGetColor(28,$yLine) ;consolewrite($color1) if ($color1=14170419) then $iRed+=1 endif if ($color1=24225) then $iBlue+=1 endif next ConsoleWrite("Red: "&$iRed&@crlf) ConsoleWrite("Blue: "&$iBlue&@crlf) Sorry @junkew i was too lazy to type it all so i borrowed most of yours1 point
-
search for bitblt in the forum it will help you analysing colorbits quicker. But to start slow are you just looking for if ...then ? I would just start to see what happens if you do for $yLine=280 to 680 to see which values you get For $L=1 to 19 $yLine=280+($L*20); the Y coordination of the first line is 300; so 300-20 is 280 MouseMove(28,$yLine); local $color1=PixelGetColor(28,$yLine) consolewrite($color1) if ($color1=14170419) then consolewrite("red") endif if ($color1=24225) then consolewrite("blue") endif next1 point
-
DllCall pass string containing zero chrd
Ontosy reacted to pixelsearch for a topic
Though the preceding script works, I'm not a big fan of these C char[] arrays that you can't display because there is a chr(0) inside and their manipulation isn't very easy. I tried initially to use std::string but I couldn't make it (i.e. to fill a std::string directly from both parameters) though I guess it's doable. Anyway, now that the char[] array is created and functional in the preceding script, I succeeded to create a std::string based on the char[] array, which gives good results for displaying the variable at once (no for loop). Also, manipulating std::string is easier than manipulating char[] So if we add the 3 following lines at the end of the preceding C++ code, this is the good result that will be displayed in Scite Console : std::string true_string(string_text, string_length); cout << "True String : size = " << true_string.size() << endl; cout << "True String : text = " << true_string << endl; Now that's fresh air If I find a way to create the std::string directly (without the char[] lines) then I'll add a post here.1 point -
[OT] Perhaps, because he wants to break the record of 50 posts in one day .1 point
-
Are my AutoIt exes really infected?
obiwanceleri reacted to Exit for a topic
@obiwanceleri It is best not to use an EXE file, but a CMD file. This is very easy to do with Au3toCmd. Just look in my signature.1 point -
1 point
-
You really like answering in 2 posts don't you? Try to reply in one single post or (later) edit the post in case you wanted to say something more. The edit function will come available soon for you.1 point
-
Are my AutoIt exes really infected?
obiwanceleri reacted to argumentum for a topic
...not much that can be done. Exempt the EXEs or/and folders in Defender.1 point -
Image detection problem after editor update - (Moved)
ashraful089 reacted to AlessandroAvolio for a topic
CTRL+H , Find what: "," (no space) Replace with: ", " (one space)1 point -
Is it possible to do this?
TesterMachine reacted to Parsix for a topic
Without GUIOnEventMode The order of execution of the commands was added #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiRichEdit.au3> _Gui() Func _Gui() Local $ConvertService = GUICreate("ConvertService", 714, 416, 192, 124) Local $lbl_title = GUICtrlCreateLabel("Convert Service Name and CommandLine", 144, 24, 291, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Local $lbl_Service = GUICtrlCreateLabel("Services :", 73, 65, 73, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Local $edt_Service = _GUICtrlRichEdit_Create($ConvertService, "", 16, 91, 201, 297, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetFont($edt_Service, 8, "MS Sans Serif") Local $btn_convert = GUICtrlCreateButton("Convert", 240, 192, 100, 25) GUICtrlSetFont(-1, 10, 800, 0) Local $lbl_ScConfigs = GUICtrlCreateLabel("Sc Configs : ", 239, 227, 90, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Local $chb_Stop = GUICtrlCreateCheckbox("Stop", 240, 256, 97, 17) Local $chb_Start = GUICtrlCreateCheckbox("Start", 240, 280, 97, 17) Local $chb_Config = GUICtrlCreateCheckbox("Config", 240, 304, 97, 17) Local $cmb_config = GUICtrlCreateCombo("", 240, 328, 100, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "boot|system|auto|demand|disabled|delayed-auto") Local $btn_clear = GUICtrlCreateButton("Clear", 240, 328 + 25 + 7, 100, 25) Local $lbl_Converted = GUICtrlCreateLabel("Converted :", 446, 67, 83, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Local $edt_Converted = _GUICtrlRichEdit_Create($ConvertService, "", 382, 91, 313, 297, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY )) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") _WinAPI_SetFocus($edt_Service) GUISetState(@SW_SHOW, $ConvertService) While 1 ;Sleep(100) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btn_clear _GUICtrlRichEdit_SetSel($edt_Service, 0, -1, True) ; select all, but hide _GUICtrlRichEdit_ReplaceText($edt_Service, "") ; replace all _GUICtrlRichEdit_SetSel($edt_Service, 0, 0) ; set cursor to start _GUICtrlRichEdit_SetSel($edt_Converted, 0, -1, True) ; select all, but hide _GUICtrlRichEdit_ReplaceText($edt_Converted, "") ; replace all _GUICtrlRichEdit_SetSel($edt_Converted, 0, 0) ; set cursor to start _WinAPI_SetFocus($edt_Service) Case $btn_convert _GUICtrlRichEdit_SetSel($edt_Converted, 0, -1, True) ; select all, but hide _GUICtrlRichEdit_ReplaceText($edt_Converted, "") ; replace all _GUICtrlRichEdit_SetSel($edt_Converted, 0, 0) ; set cursor to start Local $iAll_Lines = _GUICtrlRichEdit_GetLineCount ( $edt_Service ) Local $sConverted = "" Local $sText = "" If $iAll_Lines>0 Then _GUICtrlRichEdit_AppendText ( $edt_Converted, "@echo off" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo Uptimize Services" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo." & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo --Start-----------------------------------" & @LF ) EndIf For $iLine = 1 To $iAll_Lines $sText = _GUICtrlRichEdit_GetTextInLine ( $edt_Service, $iLine ) If $sText<>"" Then _GUICtrlRichEdit_AppendText ( $edt_Converted, 'echo Service Name : '& $sText & @LF ) If _IsChecked($chb_Stop) Then $sConverted = _create_commandline($sText, "stop") If $sConverted Then _GUICtrlRichEdit_AppendText ( $edt_Converted, $sConverted & @LF ) EndIf If _IsChecked($chb_Config) Then Local $sSC_config = GUICtrlRead($cmb_config) If $sSC_config = "" Then $sSC_config = Default $sConverted = _create_commandline($sText, "config", $sSC_config) If $sConverted Then _GUICtrlRichEdit_AppendText ( $edt_Converted, $sConverted & @LF ) EndIf If _IsChecked($chb_Start) Then $sConverted = _create_commandline($sText, "start") If $sConverted Then _GUICtrlRichEdit_AppendText ( $edt_Converted, $sConverted & @LF ) EndIf EndIf Next If $iAll_Lines>0 Then _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo --End-------------------------------------" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo." & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "pause" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "exit" & @LF ) EndIf EndSwitch WEnd #Region ;Exit _GUICtrlRichEdit_Destroy($edt_Service) _GUICtrlRichEdit_Destroy($edt_Converted) GUIDelete($ConvertService) Exit #EndRegion ;Exit EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func _create_commandline($serviceName, $sSc_SW, $sSc_config_SW = Default) Local $sOutput = "" Local $oError = False Switch $sSc_SW Case "stop" $sOutput = "sc stop " & '"' & $serviceName & '"' Case "start" $sOutput = "sc start " & '"' & $serviceName & '"' Case "config" ;<boot|system|auto|demand|disabled|delayed-auto> Switch $sSc_config_SW Case 1, "boot" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "boot" Case 2, "system" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "system" Case 3, "auto", Default $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "auto" Case 4, "demand" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "demand" Case 5, "disabled" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "disabled" Case 6, "delayed-aut" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "delayed-aut" EndSwitch EndSwitch If $sOutput Then Return $sOutput Return $oError EndFunc in GUIOnEventMode : The order of execution of the commands was added #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiRichEdit.au3> Opt("GUIOnEventMode", 1) _Gui() Func _Gui() Global $ConvertService = GUICreate("ConvertService", 714, 416, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "_onChange") GUISetOnEvent($GUI_EVENT_MINIMIZE, "_onChange") Local $lbl_title = GUICtrlCreateLabel("Convert Service Name and CommandLine", 144, 24, 291, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Local $lbl_Service = GUICtrlCreateLabel("Services :", 73, 65, 73, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Global $edt_Service = _GUICtrlRichEdit_Create($ConvertService, "", 16, 91, 201, 297, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetFont($edt_Service, 8, "MS Sans Serif") Global $btn_convert = GUICtrlCreateButton("Convert", 240, 192, 100, 25) GUICtrlSetOnEvent(-1, "_onChange") GUICtrlSetFont(-1, 10, 800, 0) Local $lbl_ScConfigs = GUICtrlCreateLabel("Sc Configs : ", 239, 227, 90, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Global $chb_Stop = GUICtrlCreateCheckbox("Stop", 240, 256, 97, 17) Global $chb_Start = GUICtrlCreateCheckbox("Start", 240, 280, 97, 17) Global $chb_Config = GUICtrlCreateCheckbox("Config", 240, 304, 97, 17) Global $cmb_config = GUICtrlCreateCombo("", 240, 328, 100, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "boot|system|auto|demand|disabled|delayed-auto") Global $btn_clear = GUICtrlCreateButton("Clear", 240, 328 + 25 + 7, 100, 25) GUICtrlSetOnEvent(-1, "_onChange") Local $lbl_Converted = GUICtrlCreateLabel("Converted :", 446, 67, 83, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x0078D7) Global $edt_Converted = _GUICtrlRichEdit_Create($ConvertService, "", 382, 91, 313, 297, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY )) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") _WinAPI_SetFocus($edt_Service) GUISetState(@SW_SHOW, $ConvertService) While 1 Sleep(100) WEnd EndFunc Func _onChange() Switch @GUI_CtrlId Case $GUI_EVENT_CLOSE _GUICtrlRichEdit_Destroy($edt_Service) _GUICtrlRichEdit_Destroy($edt_Converted) GUIDelete($ConvertService) Exit Case $btn_clear _GUICtrlRichEdit_SetSel($edt_Service, 0, -1, True) ; select all, but hide _GUICtrlRichEdit_ReplaceText($edt_Service, "") ; replace all _GUICtrlRichEdit_SetSel($edt_Service, 0, 0) ; set cursor to start _GUICtrlRichEdit_SetSel($edt_Converted, 0, -1, True) ; select all, but hide _GUICtrlRichEdit_ReplaceText($edt_Converted, "") ; replace all _GUICtrlRichEdit_SetSel($edt_Converted, 0, 0) ; set cursor to _WinAPI_SetFocus($edt_Service) Case $btn_convert _GUICtrlRichEdit_SetSel($edt_Converted, 0, -1, True) ; select all, but hide _GUICtrlRichEdit_ReplaceText($edt_Converted, "") ; replace all _GUICtrlRichEdit_SetSel($edt_Converted, 0, 0) ; set cursor to start Local $iAll_Lines = _GUICtrlRichEdit_GetLineCount ( $edt_Service ) Local $sConverted = "" Local $sText = "" If $iAll_Lines>0 Then _GUICtrlRichEdit_AppendText ( $edt_Converted, "@echo off" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo Uptimize Services" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo." & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo --Start-----------------------------------" & @LF ) EndIf For $iLine = 1 To $iAll_Lines $sText = _GUICtrlRichEdit_GetTextInLine ( $edt_Service, $iLine ) If $sText<>"" Then _GUICtrlRichEdit_AppendText ( $edt_Converted, 'echo Service Name : '& $sText & @LF ) If _IsChecked($chb_Stop) Then $sConverted = _create_commandline($sText, "stop") If $sConverted Then _GUICtrlRichEdit_AppendText ( $edt_Converted, $sConverted & @LF ) EndIf If _IsChecked($chb_Config) Then Local $sSC_config = GUICtrlRead($cmb_config) If $sSC_config = "" Then $sSC_config = Default $sConverted = _create_commandline($sText, "config", $sSC_config) If $sConverted Then _GUICtrlRichEdit_AppendText ( $edt_Converted, $sConverted & @LF ) EndIf If _IsChecked($chb_Start) Then $sConverted = _create_commandline($sText, "start") If $sConverted Then _GUICtrlRichEdit_AppendText ( $edt_Converted, $sConverted & @LF ) EndIf EndIf Next If $iAll_Lines>0 Then _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo --End-------------------------------------" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "echo." & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "pause" & @LF ) _GUICtrlRichEdit_AppendText ( $edt_Converted, "exit" & @LF ) EndIf EndSwitch EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc ;==>_IsChecked Func _create_commandline($serviceName, $sSc_SW, $sSc_config_SW = Default) Local $sOutput = "" Local $oError = False Switch $sSc_SW Case "stop" $sOutput = "sc stop " & '"' & $serviceName & '"' Case "start" $sOutput = "sc start " & '"' & $serviceName & '"' Case "config" ;<boot|system|auto|demand|disabled|delayed-auto> Switch $sSc_config_SW Case 1, "boot" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "boot" Case 2, "system" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "system" Case 3, "auto", Default $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "auto" Case 4, "demand" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "demand" Case 5, "disabled" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "disabled" Case 6, "delayed-aut" $sOutput = "sc config " & '"' & $serviceName & '"' & " start= " & "delayed-aut" EndSwitch EndSwitch If $sOutput Then Return $sOutput Return $oError EndFunc1 point -
Looks like that hasn't been updated for a while.1 point
-
https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.16.1-rc2-setup.zip https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.16.1-rc2.zip 3.3.16.1 (xxx, 2022) (Release) AutoIt: - Fixed #3866: REGEXPCLASS broken in 3.3.16.0. - Fixed #3865: Image Control resizing behave as forced $GUI_DOCKWIDTH and $GUI_DOCKHEIGHT. - Fixed #3864: StringRegExp() crash with patterns that cause infinite recursion. - Fixed #3876: Hex Number Arithmetic is incorrect. - Fixed #3869: Subtraction operator before power operation is parsed incorrectly. - Fixed #3879: Dim Map to Array. - Fixed #3875: GUICtrlSetResizing() performance by Reverting #3831: GUICtrlSetPos() $GUI_DOCKHCENTER. - Fixed: missing uninstalling file GUICtrlInternals.au3 since 3.3.15.2. UDFs: - Added: UBound[2] example. - Added: StringRegExp[5] example. - Added: _GUICtrlEdit_SetPadding() function and example. - Added: _WinAPI_RegDeleteKey() can use $hKey as in RegRead(). - Added #3863: _WinAPI_GetCapture(). - Added: Allows _DebugArrayDisplay() to be used in UserFunc. - Added: _ArrayDisplay() and _DebugArrayDisplay() support Min Column width. - Added: _Array2DCreate() support 1D and/or 2D arrays. - Added: _DebugReportVar() display DllStruct content. - Added: _ArrayDisplay() and _DebugArrayDisplay() display {Array[dims]}, {Map[nentry]} and {Object}. - Fixed #3867: Changes in 'SecurityConstants.au3' to avoid name conflict. THIS IS A SCRIPT BREAKING CHANGE - Fixed: Regression in 3.3.15.1, _WinAPI_RegCreateKey() and _WinAPI_RegOpenkey(). - Fixed: Regression of #3835 on _GDIPlus_GraphicsGet*(). - Fixed #3871: _ArrayDisplay() Hang sorted array with Null element. - Fixed: _FTP_FileGetSize() very big size. - Fixed #3872: FTP-Server in AutoIt Help no longer accessible. - Fixed #3877: GUICtrlCreateLabel() overlapping controls doc precision ($WS_CLIPSIBLINGS). - Fixed #3883: _DebugArrayDisplay() produces uncalled console message.1 point
-
How can I stop a MouseClick with function?
Alexmaria11 reacted to RaxXxz0r for a topic
It’s a website where I should click as fast as possible no specific program. I’m testing mouseclicker and want to add more function to it. And i want to add code which tells the script to stop at a certain amount of a desired numbers. Like, stop after you clicked 50 clicks. It’s not a program. https://clickspeedtest.com/1 point -
Thanks and yes, well this is a pretty common example: #include <Console.au3> Main() Func Main() Local $Name Local $Age Local $Answer Local $Continue = True While $Continue Cout("Enter your name: ") Cin($Name) Cout("Enter your age: ") Cin($Age) Cout("Do you want your answers printed in red? y/n: ") Cin($Answer) If StringInStr($Answer,"y") Then Cout(@LF & "Your name is ") Cout($Name & @LF,$FOREGROUND_RED) Cout("You were born in ") Cout(@Year - $Age & @LF,$FOREGROUND_RED) Else Cout(@LF & "Your name is ") Cout($Name & @LF) Cout("You were born in ") Cout(@Year - $Age & @LF) EndIf $Answer = "" Cout(@LF & "Do you want to try again? y/n: ") Cin($Answer) If StringInStr($Answer,"n") Then $Continue = False EndIf WEnd system("pause") EndFunc Thanks.1 point