Leaderboard
Popular Content
Showing content with the highest reputation on 01/15/2016 in all areas
-
No clue why it's like that but Microsoft says that's the way it works.1 point
-
That code is working, the problem is that you can't see the color change in Print Layout view, Draft view and Outline view. It's only going to be visible in Web layout and full screen view modes.I'm not getting an error message when I run it though.1 point
-
1 point
-
[GAME] AUTOITEROIDS v1.019 Build 2016-01-14 Final
argumentum reacted to UEZ for a topic
Here my 1st game ever. A try to remake of the arcade classical 2D game Asteroids® by Atari (1979). More information about Asteroids® here or here! Play online here Please don't link to file below directly from other websites! Downloads (2263 previously): AUTOITEROIDS v1.019 Build 2016-01-14.7z (use e.g. 7-Zip to extract archive) Only compiled version incl. needed files here: <4shared.com> or <MediaFire.com> LEGAL NOTICE: This game is an unoffical clone of the original Asteroids® game and is not endorsed by the registered trademark and copyright owners Atari Interactive, Inc. Short description: AUTOITEROIDS is a remake of the video arcade game released in 1979 by Atari, Inc. It was one of the most popular and influential games of the Golden Age of Arcade Games. The player controls a spaceship in an asteroid field which is periodically traversed by flying saucers. The object of the game is to shoot and destroy asteroids and saucers while not colliding with either, or being hit by the saucers' counter-fire. Keys: ctrl - shoot, up - thrust, left - turn left, right - turn right, space - hyper jump Game details: game is starting with 3 asteroids every 10.000 points increase of level (among other things amount of asteroids + 1) every 30.000 points extra live biggest asteroid = 20 points medium asteroid = 50 points smallest asteroid = 100 points big alien spaceship = 200 points small alien spaceship = 1000 point Credits: Main code: UEZ Bass UDF: BrettF Bass DLL: www.un4seen.com GDI+ font loader code: Yashied Menu item code: rasim Sound + sound code modifications: Spiff59 Font: ck! [Freaky Fonts] GetKeyboardState code: eukalyptus Atari for the original game concept AutoIt forum for all the help and the source of knowledge Have fun UEZ Change log:1 point -
[GAME] AUTOITEROIDS v1.019 Build 2016-01-14 Final
argumentum reacted to mLipok for a topic
this old link is not actuall http://games.atari.com/arcade.php?game=asteroids here is new https://www.atari.com/arcade#!/arcade/asteroids/play1 point -
Checkout _GDIPlus_FontPrivate* functions in the help file!1 point
-
31290, I have completely recoded the delimiter parsing section to deal with the annoying "Name" section - please test this and see if it works for you: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StringConstants.au3> #include <Array.au3> #include <GuiListView.au3> ; Read file into array $aLines = FileReadToArray("EPES18.txt") ; Deal with title line $aLines[0] = StringRegExpReplace($aLines[0], "(\x20+)", "|") ; Now the other lines For $i = 1 To UBound($aLines) - 1 ; Extract line $sLine = $aLines[$i] ; Replace tabs with spaces $sLine = StringReplace($sLine, @TAB, " ") ; Extract possible name field $sName = StringRegExpReplace($sLine, "(?U)^.*(\x20.*\x20)(connected|notconnect|err-disabled).*$", "$1") ; Convert multiple spaces to singles $sStrippedName = StringRegExpReplace($sName, "\x20+", " ") ; Set placeholder if no name field If $sStrippedName = " " Then $sStrippedName = " ~ " ; Replace original name string in line with stripped version - add spaces to ensure multiple spaces before and after $sLine = StringReplace($sLine, $sName, " " & $sStrippedName & " ") ; Set delimiters by replacing multiple spaces $sLine = StringRegExpReplace($sLine, "(\x20{2,19})", "|") ; Remove placeholders $sLine = StringReplace($sLine, "~", "") ; Replace existing line with delimited line $aLines[$i] = $sLine Next $hGUI = GUICreate("Test", 500, 500) ; Create ListView with first 4 headers $cLV = GUICtrlCreateListView(StringRegExpReplace($aLines[0], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), 10, 10, 480, 380) ; Set column widths For $i = 0 To 3 _GUICtrlListView_SetColumnWidth($cLV, $i, 110) Next ; Add content of first 4 fields in each line For $i = 1 To UBound($aLines) - 1 $cLVItem = GUICtrlCreateListViewItem(StringRegExpReplace($aLines[$i], "(?U)^(.*\|.*\|.*\|.*)\|.*$", "$1"), $cLV) Next GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") GUISetState() ; Set sort state Local $aSortSense[_GUICtrlListView_GetColumnCount($cLV)] While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_NOTIFY($hWnd, $imsg, $wParam, $lParam) ; Struct = $tagNMHDR and "int Item;int SubItem" from $tagNMLISTVIEW Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If @error Then Return Local $iCode = BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) Switch $iCode Case $LVN_COLUMNCLICK ; Get column index Local $iCol = DllStructGetData($tStruct, 5) If $iCol <> 0 Then ; Sort column _GUICtrlListView_SimpleSort($cLV, $aSortSense, $iCol) EndIf Case $NM_DBLCLK $iRow = DllStructGetData($tStruct, 4) ; Row 0 in ListView is row 2 in the array $sData = $aLines[$iRow + 2] ; Split $aData = StringSplit($sData, "|") ConsoleWrite("Row Data: " & $aData[1] & " - " & $aData[2] & " - " & $aData[3] & " - " & $aData[4] & @CRLF) Case $NM_CUSTOMDRAW Local $tNMLVCUSTOMDRAW = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $dwDrawStage = DllStructGetData($tNMLVCUSTOMDRAW, "dwDrawStage") Switch $dwDrawStage ; Holds a value that specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins Return $CDRF_NOTIFYITEMDRAW ; Notify the parent window of any item-related drawing operations Case $CDDS_ITEMPREPAINT ; Before painting an item Return $CDRF_NOTIFYSUBITEMDRAW ; Notify the parent window of any subitem-related drawing operations Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM) ; Before painting a subitem Local $iItem = DllStructGetData($tNMLVCUSTOMDRAW, "dwItemSpec") ; Item index Local $iSubItem = DllStructGetData($tNMLVCUSTOMDRAW, "iSubItem") ; Subitem index ; Gte text of item $sText = _GUICtrlListView_GetItemText($cLV, $iItem, $iSubItem) ; Set default back colour $iBkColour = 0xC4C4C4 ; Now check for our spoecific items Switch $iSubItem Case 2 ; connection Switch $sText Case "connected" $iBkColour = 0x00FF00 Case "notconnect" $iBkColour = 0x0000FF Case "err-disabled" $iBkColour = 0xC4C4C4 EndSwitch Case 3 ; vlan Switch $sText Case "trunk" $iBkColour = 0x00FFFF Case "1" $iBkColour = 0xFFFF00 Case "10" $iBkColour = 0xC4FFC4 Case "13" $iBkColour = 0xFF00FF EndSwitch EndSwitch ; Set required back colour DllStructSetData($tNMLVCUSTOMDRAW, "ClrTextBk", $iBkColour) Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch EndSwitch EndFunc ;==>_WM_NOTIFY If you still have problems, then please let me see the file containing the lines causing difficulty so I can refine the process further. M231 point
-
now, suppose you want to install your scheduled task into a subfolder. that way it will be visible to the user only if the "Task Scheduler Library" branch is expanded, so it is visually segregated from users' tasks - same way Microsoft do with their phenomenal list of tasks (some 88 tasks in 58 folders...). the trick is to prefix the task name with the subfolder, e.g. au3\au3@task instead of just au3@task as in the example above, for the task to be placed in the au3 subfolder. also, don't forget to remove it at uninstall. so this is the updated setup script: #RequireAdmin #AutoIt3Wrapper_Res_Fileversion=0.0.1.0 #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=y #NoTrayIcon #include <MsgBoxConstants.au3> Global $sTitle = 'au3@task Setup' Global $sDrive = StringLeft(@WindowsDir, 3) Global $sTaskDir = 'au3' Global $sTaskName = 'au3@task' Global $sTaskFullName = $sTaskDir & '\' & $sTaskName If AlreadyInstalled() Then If MsgBox($MB_ICONQUESTION + $MB_YESNO, $sTitle, 'Uninstall? ') = $IDYES Then If Uninstall() Then MsgBox($MB_ICONINFORMATION, $sTitle, 'Uninstallation completed successfully. ') Else MsgBox($MB_ICONERROR, $sTitle, 'Uninstallation error. ') EndIf Else MsgBox($MB_ICONINFORMATION, $sTitle, 'Uninstallation aborted. ') EndIf Else If MsgBox($MB_ICONQUESTION + $MB_YESNO, $sTitle, 'Install? ') = $IDYES Then If Install() Then If MsgBox($MB_ICONQUESTION + $MB_YESNO, $sTitle, 'Installation completed successfully. Run task now? ') = $IDYES Then If RunWait('schtasks.exe /Run /TN ' & $sTaskFullName, '', @SW_HIDE) = 0 Then MsgBox($MB_ICONINFORMATION, $sTitle, 'Task is running. ') Else MsgBox($MB_ICONERROR, $sTitle, 'Error running the task. ') EndIf Else MsgBox($MB_ICONINFORMATION, $sTitle, 'Done. ') EndIf Else MsgBox($MB_ICONERROR, $sTitle, 'Installation error. ') EndIf Else MsgBox($MB_ICONINFORMATION, $sTitle, 'Installation aborted. ') EndIf EndIf Func AlreadyInstalled() If Not FileExists($sDrive & 'au3@task.exe') Then Return False If RunWait('schtasks.exe /Query /TN ' & $sTaskFullName, '', @SW_HIDE) <> 0 Then Return False Return True EndFunc ;==>AlreadyInstalled Func Install() If Not FileInstall('au3@task.exe', $sDrive, 1) Then Return False Local $sXML = _ '<?xml version="1.0" encoding="UTF-16"?>' & @CRLF & _ '<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">' & @CRLF & _ ' <Triggers>' & @CRLF & _ ' <BootTrigger>' & @CRLF & _ ' <Enabled>true</Enabled>' & @CRLF & _ ' </BootTrigger>' & @CRLF & _ ' </Triggers>' & @CRLF & _ ' <Principals>' & @CRLF & _ ' <Principal id="Author">' & @CRLF & _ ' <UserId>S-1-5-18</UserId>' & @CRLF & _ ' <RunLevel>HighestAvailable</RunLevel>' & @CRLF & _ ' </Principal>' & @CRLF & _ ' </Principals>' & @CRLF & _ ' <Settings>' & @CRLF & _ ' <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>' & @CRLF & _ ' <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>' & @CRLF & _ ' <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>' & @CRLF & _ ' <AllowHardTerminate>false</AllowHardTerminate>' & @CRLF & _ ' <StartWhenAvailable>false</StartWhenAvailable>' & @CRLF & _ ' <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>' & @CRLF & _ ' <IdleSettings>' & @CRLF & _ ' <StopOnIdleEnd>true</StopOnIdleEnd>' & @CRLF & _ ' <RestartOnIdle>false</RestartOnIdle>' & @CRLF & _ ' </IdleSettings>' & @CRLF & _ ' <AllowStartOnDemand>true</AllowStartOnDemand>' & @CRLF & _ ' <Enabled>true</Enabled>' & @CRLF & _ ' <Hidden>false</Hidden>' & @CRLF & _ ' <RunOnlyIfIdle>false</RunOnlyIfIdle>' & @CRLF & _ ' <WakeToRun>false</WakeToRun>' & @CRLF & _ ' <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>' & @CRLF & _ ' <Priority>7</Priority>' & @CRLF & _ ' </Settings>' & @CRLF & _ ' <Actions Context="Author">' & @CRLF & _ ' <Exec>' & @CRLF & _ ' <Command>ExePath</Command>' & @CRLF & _ ' </Exec>' & @CRLF & _ ' </Actions>' & @CRLF & _ '</Task>' $sXML = StringReplace($sXML, 'ExePath', $sDrive & 'au3@task.exe') Local $sFileXML = @TempDir & '\au3@task.xml' FileDelete($sFileXML) FileWrite($sFileXML, $sXML) If FileRead($sFileXML) <> $sXML Then Return False If RunWait('schtasks.exe /Create /XML "' & $sFileXML & '" /TN ' & $sTaskFullName, '', @SW_HIDE) <> 0 Then Return False FileDelete($sFileXML) Return True EndFunc ;==>Install Func Uninstall() RunWait('schtasks.exe /End /TN ' & $sTaskFullName, '', @SW_HIDE) If RunWait('schtasks.exe /Delete /F /TN ' & $sTaskFullName, '', @SW_HIDE) <> 0 Then Return False Sleep(3000) If Not FileDelete($sDrive & 'au3@task.exe') Then Return False DirRemove(@SystemDir & '\Tasks\' & $sTaskDir) ; remove the folder only if empty Return True EndFunc ;==>Uninstall Note: $sTaskDir can be set to an empty string for not using a subfolder.1 point
-
Why not post it? Part of finding a problem is letting other people try it. So many times I've seen threads like these go on for weeks, then the op says "oops sorry I had spilled iron brew on my laptop and broke it"1 point