Jump to content

Recommended Posts

Hy all..

I made a game in autoit, a puzzle game.

All you need to do is to find the correct buttons. Every button have number indicators.

Number indicators for each button indicate how many of button's adjacent buttons are correct buttons, excluding diagonals and itself.(e.g. 0 means all buttons adjacent to that button are incorrect)

You need to find 4 green buttons. If you click on a wrong button, that button is turning to red and wrong count is +1. If wrong count is 2 you lose the game.

Game.exe

PuzzleGame.exe

Source

main.au3

Sugestion and critics are welcome

Version : 0.3

ps. sorry for my english

Edited by PlayHD
Link to post
Share on other sites

Haha, cool!

It actualy took me a min or 2 to solve a single puzzle. xD

I was used to Minesweeper

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Zaoka
      HI,
      for couple of years I'm using  Jos script for sending reports, email with excel attachment. But from last week i'm getting this error when sending excel or word attachment
      message has lines too long for transport jpeg, pdf works with no problems, any sugestion ?
    • By diepfeile
      I'm using the following:
      Autoit 3.3.14.5
      newly installed Beta 3.3.15.5
      SQlite version 3380000 aka 3.38.0
      I put sqlite3.dll and sqlite3_x64.dll in C:\Windows\System32 since many scripts depend on them.


      I extended the output of _SQLite_Startup()
      with:
      ConsoleWrite("@AutoItX64 " & @AutoItX64 & @CRLF) ConsoleWrite("$sDll_Filename " & $sDll_Filename & @CRLF) ConsoleWrite("_SQLite_LibVersion=" & _SQLite_LibVersion() & @CRLF)

      Also using the script from https://www.autoitscript.com/autoit3/docs/libfunctions/_SQLite_Startup.htm for testing.

       
      >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "R:\Download\aasdf.au3" @AutoItX64 0 $sDll_Filename sqlite3.dll _SQLite_LibVersion=0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3_x64.exe "R:\Download\aasdf.au3" @AutoItX64 1 $sDll_Filename sqlite3_x64.dll _SQLite_LibVersion=3.38.0 >Running:(3.3.15.5):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "R:\Download\aasdf.au3" @AutoItX64 0 $sDll_Filename sqlite3.dll _SQLite_LibVersion=0 >Running:(3.3.15.5):C:\Program Files (x86)\AutoIt3\Beta\autoit3_x64.exe "R:\Download\aasdf.au3" @AutoItX64 1 $sDll_Filename sqlite3_x64.dll _SQLite_LibVersion=3.38.0


      Why doesn't it work in 32bit, despite me having the 32bit sqlite.dll? Autoit urges running scripts in 32bit mode and Scite starts scripts just in 32bit mode without the flag?
      With #AutoIt3Wrapper_UseX64=Y it just works, both normal Autoit and beta!
      sqlite3.dll sqlite3_x64.dll
    • By Iraj
      Hello Team, Greetings!
      Is there any way to run any 3rd party application silently in background without the GUI getting in the front ?
      I was implementing angry-ip scanner with autoit & wanted the angry-ip application to run in background quietly as I am copying its output to other file on completion. is there any way to achieve my query?
      Below is code I tried: 
      $range = "192.168.0.1 192.168.0.255" ShellExecuteWait("C:\Windows\DDM\ipscan.exe","-f:range "&$iprange&" -q -o C:\temp\ScanResults.csv","","open",@SW_HIDE) Thanks!
    • By PeterVerbeek
      This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.26 contains 214 functions divided into these topics:
      window, desktop and monitor GUI, mouse and color GUI controls including graphical buttons (jpg, png) logics and mathematics include constants string, xml string and file string dialogues and progress bars data lists: lists, stacks, shift registers and key maps (a.ka. dictionaries) miscellaneous: logging/debugging, process and system info Change log and files section  on the PAL website (SourceForge).
      A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension, which is a user interface for the system-wide audio driver called Equalizer APO.
    • By Gianni
      ... Surfing the net my eye fell on a device called "Divoom".
      It reminded me of a little toy I liked to play when I went to kindergarten (more than 55 years ago... ), it was called "Chiodini colorati".
      So I made this little script to emulate it, ...maybe some kids will have fun playing with it.

      The attached zip file contains the script and also some "pixel art" files ready to be loaded.
      P.S.
      Thanks to @KaFu for it's _WinSetClientSize() function and to @InunoTaishou for it's CaptureWindow() function (references are in the script)
      #include <WinAPISysWin.au3> #include <File.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> #cs ----------------------------------------- "Chiodini colorati" (colored thumb tacks) a little toy for the kids 16x16 pixel art sheet Programmed by Gianni Addiego - Italy December 2021 #ce ----------------------------------------- _Chiodini() Func _Chiodini() Local $aColors[16] = [0xffffff, 0xFF0000, 0xFF00FF, 0xFFC0CB, 0x964B00, 0xCD853F, 0xFF6600, 0xFFCC00, _ 0xFFFF00, 0xCCFF00, 0x00FF00, 0x228B22, 0x0000FF, 0x00FFFF, 0x7F7F7F, 0x000000] Local $iColor = $aColors[0], $sFileName, $aAzioni, $bOkToSave Local $aColori, $aChiodini, $GUIGetMsg, $hShowActiveColor Local $hGui = GUICreate("Chiodini colorati") $aColori = _GuiControlPanel("Button", 1, 16, 50, 20, 0, 0, 5, 0, 0, 1, True, "Colors") For $i = 1 To UBound($aColori) - 1 GUICtrlSetBkColor($aColori[$i], $aColors[$i - 1]) Next $aChiodini = _GuiControlPanel("Label", 16, 16, 20, 20, ($aColori[0])[11], 0, 3, 3, 1, 1, True, "") ; Local $aBackColors[UBound($aChiodini)] For $i = 1 To UBound($aChiodini) - 1 GUICtrlSetBkColor($aChiodini[$i], $iColor) $aBackColors[$i] = $iColor Next $iColor = $aColors[1] $aAzioni = _GuiControlPanel("Button", 4, 1, 80, 50, ($aColori[0])[11] + 0, ($aChiodini[0])[12], 0, 0, 5, 1, True, "") GUICtrlSetData($aAzioni[1], "Clear with color") GUICtrlSetData($aAzioni[2], "Load txt File") GUICtrlSetData($aAzioni[3], "Save txt File") GUICtrlSetData($aAzioni[4], "Save JPG") $hShowActiveColor = _GuiControlPanel('Label', 1, 1, 45, 30, 8, ($aColori[0])[12], 0, 0, 0, 0, True, "Active") GUICtrlSetBkColor($hShowActiveColor[1], $iColor) _WinSetClientSize($hGui, ($aChiodini[0])[11] + ($aColori[0])[11], ($aChiodini[0])[12] + ($aAzioni[0])[12]) ; GUISetState() ; --------- ; Main loop ; --------- While True $GUIGetMsg = GUIGetMsg() ; -------------------------------------------- ; scan all buttons to check if one was pressed ; -------------------------------------------- For $i = 1 To UBound($aColori) - 1 If $GUIGetMsg = $aColori[$i] Then $iColor = $aColors[$i - 1] GUICtrlSetBkColor($hShowActiveColor[1], $iColor) ContinueLoop 2 EndIf Next For $i = 1 To UBound($aChiodini) - 1 If $GUIGetMsg = $aChiodini[$i] Then GUICtrlSetBkColor($aChiodini[$i], $iColor) $aBackColors[$i] = $iColor ContinueLoop 2 EndIf Next Switch $GUIGetMsg Case $aAzioni[1] ; ----- Clear with color For $i = 1 To UBound($aChiodini) - 1 GUICtrlSetBkColor($aChiodini[$i], $iColor) $aBackColors[$i] = $iColor Next Case $aAzioni[2] ; ----- File Load $sFileName = FileOpenDialog("File to load", @ScriptDir, "Text files (*.txt)") If FileExists($sFileName) Then _FileReadToArray($sFileName, $aBackColors, $FRTA_NOCOUNT) For $i = 1 To UBound($aBackColors) - 1 GUICtrlSetBkColor($aChiodini[$i], $aBackColors[$i]) Next Else MsgBox(64, "Info", "File not found") EndIf Case $aAzioni[3] ; ----- File Save $sFileName = FileSaveDialog("File to save", @ScriptDir, "Text files (*.txt)") $bOkToSave = True If FileExists($sFileName) Then $bOkToSave = 6 = MsgBox(4 + 48, "warning", "File already exists, do you want overwrite it?") EndIf If $bOkToSave Then _FileWriteFromArray($sFileName, $aBackColors) EndIf Case $aAzioni[4] ; ----- Save image $sFileName = FileSaveDialog("Image name to save", @ScriptDir, "Image jpg (*.jpg)") $bOkToSave = True If FileExists($sFileName) Then $bOkToSave = 6 = MsgBox(4 + 48, "warning", "File already exists, do you want overwrite it?") EndIf If $bOkToSave Then CaptureWindow($sFileName, ($aChiodini[0])[13], ($aChiodini[0])[14], ($aChiodini[0])[15], ($aChiodini[0])[16], $hGui) EndIf EndSwitch If $GUIGetMsg = -3 Then Exit ; If 6 = MsgBox(4 + 32, "?", "Do you really want to quit?") Then Exit EndIf WEnd EndFunc ;==>_Chiodini ; #FUNCTION# ==================================================================================================================== ; Name...........: _GuiControlPanel v1.1 2021/12 ; Description ...: Creates a rectangular panel with adequate size to contain the required amount of controls ; and then fills it with the same controls by placing them according to the parameters ; Syntax.........: _GuiControlPanel( $ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, $xPos = 0, $yPos = 0, $xBorder, $yBorder, $xSpace = 1, $ySpace = 1) ; Parameters ....: $ControlType - Type of controls to be generated ("Button"; "Text"; ..... ; $nrPerLine - Nr. of controls per line in the matrix ; $nrOfLines - Nr. of lines in the matrix ; $ctrlWidth - Width of each control ; $ctrlHeight - Height of each control ; $xPanelPos - x Position of panel in GUI ; $yPanelPos - y Position of panel in GUI ; $xBorder - distance from lateral panel's borders to the matrix (width of left and right margin) default = 0 ; $yBorder - distance from upper and lower panel's borders to the matrix (width of upper and lower margin) default = 0 ; $xSpace - horizontal distance between the controls ; $ySpace - vertical distance between the controls ; $Group - if you want to group the controls (true or false) ; $sGrpTitle - title of the group (ignored if above is false) ; Return values .: an 1 based 1d array containing references to each control ; element [0] contains an 1d array containing various parameters about the panel ; Author ........: Gianni Addiego (Chimp) ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _GuiControlPanel($ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, $xPanelPos = 0, $yPanelPos = 0, $xBorder = 0, $yBorder = 0, $xSpace = 1, $ySpace = 1, $Group = False, $sGrpTitle = "") Local Static $sAllowedControls = "|Label|Input|Edit|Button|CheckBox|Radio|List|Combo|Pic|Icon|Graphic|" If Not StringInStr($sAllowedControls, '|' & $ControlType & '|') Then Return SetError(1, 0, "Unkown control") Local $col, $row, $left, $top, $text Local $PanelWidth = (($ctrlWidth + $xSpace) * $nrPerLine) - $xSpace + ($xBorder * 2) Local $PanelHeight = (($ctrlHeight + $ySpace) * $nrOfLines) - $ySpace + ($yBorder * 2) Local $InnerXPos = $xPanelPos, $InnerYPos = $yPanelPos, $InnerWidth = $PanelWidth, $InnerHeight = $PanelHeight If $Group Then $PanelWidth += 2 $InnerXPos += 1 If $sGrpTitle = "" Then $InnerYPos += 7 $PanelHeight += 8 GUICtrlCreateGroup("", $xPanelPos, $yPanelPos, $PanelWidth, $PanelHeight) Else $InnerYPos += 15 $PanelHeight += 18 GUICtrlCreateGroup($sGrpTitle, $xPanelPos, $yPanelPos, $PanelWidth + 2, $PanelHeight) ; + 18) EndIf EndIf ; create the controls Local $aGuiGridCtrls[$nrPerLine * $nrOfLines + 1] Local $aPanelParams[17] = [ _ $ControlType, $nrPerLine, $nrOfLines, $ctrlWidth, $ctrlHeight, _ $xPanelPos, $yPanelPos, $xBorder, $yBorder, $xSpace, $ySpace, $PanelWidth, $PanelHeight, $InnerXPos, $InnerYPos, $InnerWidth, $InnerHeight] For $i = 0 To $nrPerLine * $nrOfLines - 1 ; coordinates 1 based $col = Mod($i, $nrPerLine) + 1 ; Vertical position within the grid (row) $iVtab $row = Int($i / $nrPerLine) + 1 ; Horizontal position within the grid (column) $iHtab $left = $InnerXPos + ((($ctrlWidth + $xSpace) * $col) - $xSpace) - $ctrlWidth + $xBorder $top = $InnerYPos + ((($ctrlHeight + $ySpace) * $row) - $ySpace) - $ctrlHeight + $yBorder $text = '' ; $i + 1 ; "*" ; "." ; "(*)" $aGuiGridCtrls[$i + 1] = Execute("GUICtrlCreate" & $ControlType & "($text, $left, $top, $ctrlWidth, $ctrlHeight)") Next If $Group Then GUICtrlCreateGroup("", -99, -99, 1, 1) ; close group $aGuiGridCtrls[0] = $aPanelParams Return $aGuiGridCtrls EndFunc ;==>_GuiControlPanel ; By kafu ; https://www.autoitscript.com/forum/topic/201524-guicreate-and-wingetclientsize-mismatch/?do=findComment&comment=1446141 Func _WinSetClientSize($hWnd, $iW, $iH) Local $aWinPos = WinGetPos($hWnd) Local $sRect = DllStructCreate("int;int;int;int;") DllStructSetData($sRect, 3, $iW) DllStructSetData($sRect, 4, $iH) _WinAPI_AdjustWindowRectEx($sRect, _WinAPI_GetWindowLong($hWnd, $GWL_STYLE), _WinAPI_GetWindowLong($hWnd, $GWL_EXSTYLE)) WinMove($hWnd, "", $aWinPos[0], $aWinPos[1], _ $aWinPos[2] + (DllStructGetData($sRect, 3) - $aWinPos[2]) - DllStructGetData($sRect, 1), _ $aWinPos[3] + (DllStructGetData($sRect, 4) - $aWinPos[3]) - DllStructGetData($sRect, 2)) EndFunc ;==>_WinSetClientSize ; By InunoTaishou ; https://www.autoitscript.com/forum/topic/181655-redraw-your-desktop-with-gdi/?tab=comments#comment-1304386 Func CaptureWindow($sFileName = "", $iLeft = -1, $iTop = -1, $iWidth = -1, $iHeight = -1, $hWnd = WinGetHandle("[Active]"), $bClientArea = True) If (Not IsHWnd($hWnd)) Then $hWnd = WinGetHandle($hWnd) If (@error) Then Return SetError(1, 0, False) If (BitAND(WinGetState($hWnd), 16) = 16) Then Return SetError(2, 0, False) Local $iSrcWidth = 0 Local $iSrcHeight = 0 Local $tRectWindow = _WinAPI_GetWindowRect($hWnd) ; Get the absolute width, using Abs on all of the memembers because the [1] index of the struct may be negative, supports multiple monitors Local $iAbsWidth = Abs(Abs(DllStructGetData($tRectWindow, 3)) - Abs(DllStructGetData($tRectWindow, 1))) ; Get the absolute height, using Abs on all of the memembers because the [1] index of the struct may be negative, supports multiple monitors ; Subtracts the caption bar if $bClientArea only Local $iAbsHeight = Abs(Abs(DllStructGetData($tRectWindow, 4)) - Abs(DllStructGetData($tRectWindow, 2))) - ($bClientArea ? _WinAPI_GetSystemMetrics($SM_CYCAPTION) : 0) If ($iWidth = -1 Or $iWidth = 0 Or $iWidth = Default Or $iWidth > $iAbsWidth) Then $iWidth = $iAbsWidth If ($iHeight = -1 Or $iHeight = 0 Or $iHeight = Default Or $iHeight > $iAbsHeight) Then $iHeight = $iAbsHeight $iSrcWidth = $iAbsWidth $iSrcHeight = $iAbsHeight If ($iLeft = -1 Or $iLeft = Default) Then $iLeft = 0 If ($iTop = -1 Or $iTop = Default) Then $iTop = 0 Local $hDC = _WinAPI_GetWindowDC($hWnd) Local $hDestDC = _WinAPI_CreateCompatibleDC($hDC) Local $hDestBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iWidth, $iHeight) Local $hDestSv = _WinAPI_SelectObject($hDestDC, $hDestBitmap) Local $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) Local $hBmp = _WinAPI_CreateCompatibleBitmap($hDC, $iSrcWidth, $iSrcHeight) Local $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hBmp) _WinAPI_PrintWindow($hWnd, $hSrcDC, True) _WinAPI_BitBlt($hDestDC, 0, 0, $iWidth, $iHeight, $hSrcDC, $iLeft, $iTop, $MERGECOPY) _WinAPI_SelectObject($hDestDC, $hDestSv) _WinAPI_SelectObject($hSrcDC, $hSrcSv) _WinAPI_ReleaseDC($hWnd, $hDC) _WinAPI_DeleteDC($hDestDC) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hBmp) $tPoint = 0 $tRectWindow = 0 $tDesktop = 0 If ($sFileName) Then _GDIPlus_Startup() Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hDestBitmap) _GDIPlus_ImageSaveToFile($hBitmap, $sFileName) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() EndIf ; Return $hDestBitmap EndFunc ;==>CaptureWindow  
      Chiodini.zip
×
×
  • Create New...