Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/29/2016 in all areas

  1. 109,247 downloads

    A Tutorial for new people * Over 19 InterActive GUI's * Over 50 Step-by-Step Scripts * Verbal Instructions * Complete with Demonstrations. * and Answers * Exe Format for New People Written completely with AutoIt to Demonstrate some of the Capabilities of AutoIt May not Work with Windows 98 ( tested once = fail) Re-Testing is now possible ( Click "Search Help" then type in "me dummy, you fix" ) Enjoy!!! Valuater 8)
    1 point
  2. Declare all of your variables used for each window at the top of the script, then assign them inside the appropriate function call.
    1 point
  3. dynamitemedia, Some people are never satisfied. We need to change the conditions for clearing/resetting the Accel keys. First, add these lines after having created the combo: ;Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("", 40, 32, 260, 250) GUICtrlSetFont(-1, 20, 600, 0, "Arial") ;Add items to the combobox. GUICtrlSetData($idComboBox, "Constants|Functions") GUICtrlSetFont(-1, 20, 600, 0, "Arial") Local $tInfo _GUICtrlComboBox_GetComboBoxInfo($idComboBox, $tInfo) Local $hComboEdit = DllStructGetData($tInfo, "hEdit") Local $hComboList = DllStructGetData($tInfo, "hList") And then change the Accel key clear/reset code to this: ; Check if combo has focus and Accel keys set $hFocus = _WinAPI_GetFocus() If ($hFocus = $hComboEdit Or $hFocus = $hComboList) And $fAccelSet Then ; Clear flag and stop Accel keys $fAccelSet = False GUISetAccelerators(0, $hGUI) GUISetAccelerators(0, $hDialog) ; Check if combo not focused and Accel keys inactive ElseIf ($hFocus <> $hComboEdit And $hFocus <> $hComboList) And (Not $fAccelSet) Then ; Set flag and reset Accel keys $fAccelSet = True GUISetAccelerators($aAccelKeys, $hGUI) GUISetAccelerators($aAccelKeys, $hDialog) EndIf Now the Accel keys are cleared if either the combo edit or list has focus, so the arrow keys will work in either case. M23
    1 point
  4. Well your example does not work but I think I know what you're trying to do. Look in the help file under GUIGetMsg or check out this link on managing multiple GUIs. Here's another small example #include <GUIConstants.au3> Global $hExample = GUICreate("GUI Example", 800, 600, 0, 0, BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX)) Global $idHelpMenu = GUICtrlCreateMenu("Help") Global $idHelpMenu_About = GUICtrlCreateMenuItem("About", $idHelpMenu) Global $hAbout = GUICreate("About", 400, 300) GUICtrlCreateLabel("This program is just an example.", 10, 10, 380, 280) GUISetState(@SW_SHOW, $hExample) While (True) Local $aGuiMsg = GUIGetMsg(1) ; Get array of messages, since we're working with multiple dialogs. Switch ($aGuiMsg[0]) Case $GUI_EVENT_CLOSE Switch ($aGuiMsg[1]) Case $hExample GUIDelete($hExample) GUIDelete($hAbout) Exit 0 Case $hAbout GUISetState(@SW_ENABLE, $hExample) GUISetState(@SW_HIDE, $hAbout) EndSwitch Case $idHelpMenu_About GUISetState(@SW_DISABLE, $hExample) GUISetState(@SW_SHOW, $hAbout) EndSwitch WEnd
    1 point
  5. guiltyking

    FEN, SAN and PGN

    Thanks, for algorithm. used to convert Coordinate notations to SAN in (White Side). ps. remark dancing popup msgbox. #include <Array.au3> ;#include <String.au3> Global $board[9][9] Local $FEN= "rnbqkb1r/ppppp1bp/5p1p/5N2/3P4/5N2/PPP1PPPP/RN1QKB1R w KQkq - 0 5" ; Standard starting position (FEN)"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1" ; => position - player - castling - enpassent target - 50 move rule - move number _EPD_Board_SetUp($FEN) MsgBox($MB_SYSTEMMODAL, "BOARD", _EPD_Board_Show()) Local $CON= "f5g7" ; Coordinate notation _contoSAN($CON) Func _EPD_Board_SetUp($FEN) Local $forsythEdwards, $edwardsForsyth, $fenBoard, $castlingOptions, $piece, $y, $x, $kings[2] $forsythEdwards = StringSplit($FEN, " ") $castlingOptions = $forsythEdwards[3] ; To be used as search criteria. $edwardsForsyth = StringReverse($forsythEdwards[1]) ; Sets up the pieces from black's POV. $fenBoard = StringSplit($edwardsForsyth, "/") ; Separates the eight ranks of the chessboard. For $i = 8 To 1 step -1; ranks 1 to 8 $y = $i ; vertical coordinate $x = 1 ; horizontal coordinate For $j = StringLen($fenBoard[$i]) To 1 step -1 If StringIsDigit(StringMid($fenBoard[$i], $j, 1)) Then ; Indicates one or more unoccupied squares. For $k = 1 To StringMid($fenBoard[$i], $j, 1) $board[$y][$x] = "-" $x += 1 Next Else $piece = StringMid($fenBoard[$i], $j, 1) $board[$y][$x] = $piece ; Places chess pieces on the chessboard. MsgBox($MB_SYSTEMMODAL, $y&":"&$x, $piece,0.31) Select ; To keep tabs on king coordinates for later reference. Case $piece == "K" $kings[0] = $y & $x ; White king location Case $piece == "k" $kings[1] = $y & $x ; Black king location EndSelect $x += 1 EndIf Next Next EndFunc Func _EPD_Board_Show() local $m For $y = 1 To 8 For $x = 1 To 8 $m &= $board[$y][$x] Next $m &= @CRLF Next Return $m EndFunc Func _contoSAN($CON) local $a = StringMid($CON, 1, 1) local $Y = StringMid($CON, 2, 1), $X If $a = "a" Then $X=1 ElseIf $a = "b" Then $X=2 ElseIf $a = "c" Then $X=3 ElseIf $a = "d" Then $X=4 ElseIf $a = "e" Then $X=5 ElseIf $a = "f" Then $X=6 ElseIf $a = "g" Then $X=7 ElseIf $a = "h" Then $X=8 EndIf local $PIECE = $board[$Y][$X] If $PIECE = "P" or $PIECE = "p" Then ; NO purIFY needed BESTMOVE CORDINATE NOTATION for pawn $SAN = $CON Else ; purIFY BESTMOVE CORDINATE NOTATION TO SAN $SAN = $board[$Y][$X] $SAN = StringUpper($SAN) $SAN &= $CON EndIf MsgBox($MB_SYSTEMMODAL, "_contoSAN", "CON: "& $CON&@CRLF&@CRLF&$X&":"&$Y& " PIECE: "& $PIECE&@CRLF&@CRLF&"SANmove: "&$SAN) return $SAN EndFunc
    1 point
  6. @GCUE: Not sure what you try to do but why first in a string then in a file then read it back then split it. You seem to be making it very complex. Whats the full solution you try to accomplish. At first sight it looks that there are better ways of doing it.
    1 point
  7. Well you learn something new everyday.
    1 point
  8. You have my permission to make your little IRC and be the big boss of it. Good luck, and god speed.
    1 point
×
×
  • Create New...