Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/08/2013 in all areas

  1. Hello everyone, Just a little recreation of the Space Invaders game. I'm sure it's been done before (?) but it's good practice to do it myself! There's no sound because I wanted to try to keep it to a single .au3 file and I'm pretty sure you can't generate your own sounds. The controls are: ENTER - play game LEFT/RIGHT - move left or right SPACEBAR - fire Any ideas on how to optimise it would be great, I wanted to add the barriers that you usually get to hide behind but it was becoming too slow. And of course, if I've got any rules wrong then feel free to correct it... space invaders v2.au3
    1 point
  2. I was looking for some examples of custom drawn TreeViews. I didn't find any so here is two. I have made the examples for ListViews too. The first example shows some named colors from the MS HTML documentation. The colors are sorted in different ways in five text files in the zipfile. The forecolor, backcolor, color name and RGB value is shown in the GUI's. Remark that the forecolor in the first column in the ListView is bold. Click on the colors in the TreeView to see some of the effects of custom drawing. The second example enumerates the fonts for the character sets in FontConstants.au3 and shows the fonts in the GUI's. Click on the fonts in the TreeView to see the name of the fonts. The zipfile contains 5 text files with color definitions and 4 au3-files with GUI's. CustDrawTvLv.zip 2016-03-22: For colors and fonts in listviews take a look at Colors and fonts in custom drawn ListViews - UDF version.
    1 point
  3. No problem, we're all learning still.
    1 point
  4. Ah so you did. In that case Local $condition = True Local $bBlank = False For $i = 1 To 6 Local $skey = Eval("key" & $i) If $skey = "" Then $bBlank = True If $i = 1 Then $condition = False ExitLoop EndIf Else If $bBlank = True Or Not FileExists($skey) Then $condition = False ExitLoop EndIf EndIf Next MsgBox(0, 'test', $condition)
    1 point
  5. BrewManNH, Great minds probably - at least I hope it is not the corollary. M23
    1 point
  6. AdemSezgin, You add the necessary bits of my script (the creation of the dummy, the GUIRegisterMsg line, the Case code for the list and the dummy, and the handler function) to your script and change the variable names to match yours. When I do that it works perfectly. Give it a try and come back if you cannot get it to work - but I want to see the code you tried if so. M23
    1 point
  7. AdemSezgin, I would do it like this: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListBox.au3> #include <EditConstants.au3> $hGUI = GUICreate("Test", 200, 400) $cInput = GUICtrlCreateInput("", 5, 5, 190, 20) $cList = GUICtrlCreateList("", 5, 30, 190, 365) ;, BitOR(0x00100000, 0x00200000)) $cCheck_Dummy = GUICtrlCreateDummy() GUISetState() _Fill_List() GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cList $sChosen = GUICtrlRead($cList) If $sChosen <> "" Then GUICtrlSetData($cInput, $sChosen) EndIf Case $cCheck_Dummy $sText = GUICtrlRead($cInput) $iIndex = _GUICtrlListBox_FindString($cList, $sText) If $iIndex <> -1 Then _GUICtrlListBox_SetCurSel($cList, $iIndex) Else _GUICtrlListBox_SetCurSel($cList, -1) EndIf EndSwitch WEnd Func _WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) If $lParam = GUICtrlGetHandle($cInput) Then If BitShift($wParam, 16) = $EN_CHANGE Then GUICtrlSendToDummy($cCheck_Dummy) EndIf EndIf EndFunc Func _Fill_List() Local $sData For $i = 0 To 99 $sData &= Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) & Chr(Random(65, 90, 1)) & "|" Next GUICtrlSetData($cList, $sData) EndFunc All clear? M23
    1 point
  8. PKG

    do loop until 10 times

    Use this code. #include <ImageSearch.au3> $x = 0 $y = 0 $NUM = 0 While $NUM <= 10 start() Sleep(10) WEnd Func start() Do $Search = _ImageSearch('pic.bmp', 0, $x, $y, 0) If $Search = 0 Then Sleep(1000) Until $Search = 1 If $Search = 1 Then MouseMove($x, $y, 10) MouseClick("left", $x, $y, 1) EndIf EndFunc ;==>start
    1 point
  9. 1 point
  10. Well the best place to start is looking here and reading thoroughly. Regular expressions are something that won't come to you overnight, I am still learning.
    1 point
  11. Here. '(FileInstall\([^)]+\))' Hopefully you now have the idea of how regular expressions work.
    1 point
  12. Try this, the regular expression can now move on to the re-tweaking stage. #include <Array.au3> Local $sData = 'FileInstall("SOURCE", "DEST", 0)' & @CRLF Local $aSRE = StringRegExp($sData, 'FileInstall\(\h*([''"])(.+?)\1,\h*([''"])(.+?)\3\h*(?:,\h*(\d)\h*)?\)', 3) ; By guinness 2013. _ArrayDisplay($aSRE)
    1 point
  13. Hopefully this is clear as mud. But I'll let you fill in the missing dots, etc. While x < y ..... Start() ...... Wend Func Start() ........ Do ..... ..... Until x ........ EndFunc You really need to try some tutorials and carefully read the Help file though. And probably put in the sleep that JohnOne mentioned.
    1 point
  14. Move the function outside of the loop, and call the function from inside the loop. Add a Sleep() in the loop too.
    1 point
  15. Have a look at this thread >> '?do=embed' frameborder='0' data-embedContent>> (created by me!) The regular expression is ([''"]).*?\1
    1 point
  16. Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".
    1 point
  17. Thanks Martin, I was able to fix the issue with "Controllistview". Ran into an other problem, I have a grid with multiple columns . I am able to get the Item ans Sub-item count for the grid. But I am not able to get the text or values. Searched the forum and found that there is a limitation for autoit with Grids. Is there and workaround for this. Can you please direct me to the right direction.
    1 point
  18. ScriptingSteve

    API calling

    I am attempting to use Microsoft APIs within AutoIT to change system folder locations based on context - i.e. laptop logging on to network gets My Documents pointed to network folder, whereas the same laptop logging on disconnected would have local My Documents. Our organization has not implemented Folder Redirection via Group Policy, so I'm trying to appropriately simulate it. I was able to implement API SHGetFolderPath, but am unable to get SHSetFolderPath to work. SetFolderPath requires an ordinal to be passed first to API GetProcAddress, and then the subsequent pointer (I think) referenced to perform the intended action. I am trying to change the location of "My Documents", and am thus attempting to use csidl '5' as an integer representation of csidl "CSIDL_PERSONAL"... I can't seem to visualize how to implement these actions in AutoIt... If anyone can help, that would be great! I have attached what is working so far... Getpaths.au3
    1 point
×
×
  • Create New...