Jump to content

Topher

Active Members
  • Posts

    100
  • Joined

  • Last visited

Everything posted by Topher

  1. Thank you
  2. Is there any way to change the font size in scite?
  3. Just installed version 3.3.8.1 and it now works like a charm. Thank you for the quick solution.
  4. Dumb question, but how do I find out what version I have?
  5. This is my first time using _FileWriteFromArray. It looked straight forward but when I ran the script I got C:\Program Files (x86)\AutoIt3\Include\File.au3 (256) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: If FileWrite($hFile, $a_Array[$x] & @CRLF) = 0 Then If FileWrite($hFile, ^ ERROR And I can't find the problem. Pointers would help. Thanks #include <array.au3> #Include <File.au3> $Root = ".\Data\" Global Const $FileNameGalaxy = $Root & "Galaxy.UU" Global Const $GalaxySize = 400 + Rand(200) Global Const $MaxLinks = 40 Global $SectorLinks Dim $SectorLinks[$GalaxySize+1][$MaxLinks+1] ;-------------------------------------------- Local $a $hSplash = SplashTextOn("Galaxy","Creating") For $itr = 1 To $GalaxySize ; determine number of sector links $Links = Rand(10) $SectorLinks[$itr][0] = RandomDesignation() ControlSetText("","", $hSplash, $GalaxySize - $itr) For $a = 1 To $Links $NewLink = Rand($GalaxySize) $FreeLink = FindEmptyLink($itr) If $NewLink <> 0 Then $SectorLinks[$itr][$FreeLink] = $NewLink $FreeLink = FindEmptyLink($NewLink) If $FreeLink <> 0 Then $SectorLinks[$NewLink][$FreeLink] = $itr Next Next SplashOff() _ArrayDisplay($SectorLinks) WriteGalaxy() Func WriteGalaxy() $file = FileOpen($FileNameGalaxy, 2) If $file = -1 Then MsgBox(16, "Fatal Error", "Can not create galaxy file") Exit EndIf _FileWriteFromArray($file, $SectorLinks, 0) FileClose($file) EndFunc Func DesignationExists($Designation) For $a = 1 To $GalaxySize If StringUpper($SectorLinks[$a][0]) = StringUpper($Designation) Then Return $a Next Return 0 EndFunc Func FindEmptyLink($Sector) For $a = 1 To $MaxLinks If $SectorLinks[$Sector][$a] = 0 Then Return $a Next Return 0 EndFunc Func Rand($pMax) Return Random(0, $pMax, 1) EndFunc Func RandomDesignation() While True $temp = Chr(65 + Rand(25)) If $temp = "I" Then ContinueLoop If $temp = "O" Then ContinueLoop $Designation = "P" & Rand(9) & $temp & "-" & Rand(899)+100 If Not DesignationExists($Designation) Then Return $Designation WEnd EndFunc
  6. Reflex 2.05 is a thorough reworking of This version of the Video game adds mouse and joystick support greatly adding to ease and enjoyment of play. A few new shapes are added as well as a couple of animations and complete overhaul of the displays. Screen Caps For Images, Sounds and Instructions click here The script follows below. Reflex.au3
  7. Windows gives you the option to magnify windows font sizing. 100%, 125%, 150%. This plays havoc with one of my layouts. Is there a way to determine the magnification from within a script?
  8. Cool. Thank you - never would have found them.
  9. That's what I meant. I seem not to be able to find some, but I got a bunch of them.
  10. Thank you. Off to remove some old posts.
  11. I have used all of my 'global upload quota'. How do I get more, or does this mean I can never upload files again?
  12. Thanks What I have scrounged and cobbled from that and others is: #Include <Array.au3> #Include <File.au3> msgbox(0,"", Font_Exists("Times New Rman")) Func Font_Exists($FontName) Local $FileList = _FileListToArray(@WindowsDir & "Fonts", '*.*', 1) Local $FontList[UBound($FileList) - 1] For $i = 1 To $FileList[0] $FontList[$i - 1] = _WinAPI_GetFontResourceInfo($FileList[$i], 1) Next For $i = 0 To UBound($FontList)-1 If $FontList[$i] == $FontName Then Return 1 Next Return 0 EndFunc ; Code below is a subset of WinAPIEx by Yashied ; http://www.autoitscript.com/forum/topic/98712-winapiex-udf/ Func _WinAPI_RemoveFontMemResourceEx($hFont) Local $Ret = DllCall('gdi32.dll', 'int', 'RemoveFontMemResourceEx', 'ptr', $hFont) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf Return 1 EndFunc ;==>_WinAPI_RemoveFontMemResourceEx Func _WinAPI_GetFontResourceInfo($sFont, $fForce = 0) If $fForce Then If Not _WinAPI_AddFontResourceEx($sFont, 0x20) Then Return SetError(1, 0, '') EndIf EndIf Local $Ret = DllCall('gdi32.dll', 'int', 'GetFontResourceInfoW', 'wstr', $sFont, 'dword*', 4096, 'wstr', '', 'dword', 0x01) If (@error) Or (Not $Ret[0]) Then $Ret = 0 EndIf If $fForce Then _WinAPI_RemoveFontResourceEx($sFont, 0x20) EndIf If Not IsArray($Ret) Then Return SetError(1, 0, '') EndIf Return $Ret[3] EndFunc ;==>_WinAPI_GetFontResourceInfo Func _WinAPI_AddFontResourceEx($sFont, $iFlag = 0, $fNotify = 0) Local $Ret = DllCall('gdi32.dll', 'int', 'AddFontResourceExW', 'wstr', $sFont, 'dword', $iFlag, 'ptr', 0) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf If $fNotify Then DllCall('user32.dll', 'none', 'SendMessage', 'hwnd', 0xFFFF, 'uint', 0x001D, 'wparam', 0, 'lparam', 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_AddFontResourceEx Func _WinAPI_RemoveFontResourceEx($sFont, $iFlag = 0, $fNotify = 0) Local $Ret = DllCall('gdi32.dll', 'int', 'RemoveFontResourceExW', 'wstr', $sFont, 'dword', $iFlag, 'ptr', 0) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) EndIf If $fNotify Then DllCall('user32.dll', 'none', 'SendMessage', 'hwnd', 0xFFFF, 'uint', 0x001D, 'wparam', 0, 'lparam', 0) EndIf Return 1 EndFunc ;==>_WinAPI_RemoveFontResourceEx Is '@WindowsDir & "Fonts"' the font directory for all versions of Windows?
  13. Is there anyway to tell if a certain font exists. GUICtrlSetFont does not return false if the font does not exist. And the name of the font isn't the name of the file. I want to use a font that is only in Windows 7 and so would like to use a different font for Vista or XP. I could test for the OS but would like the more certain approach of searching for whether a font exists or not. But I have no idea how to code for this.
  14. Thank you. I'm not use to using OnEvent (someone suggested it as a work around on a different problem.) Easy fix, again thanks - this was driving me nuts.
  15. Nope, that didn't magically fix things this time. I'm stumped.
  16. Sorry, failed to include that when I clipped the middle. I'm remembering now that I had a problem with StringFormat in this routine earlier. I'm going to write my own stringformat routine and see if that fixes things.
  17. Neither the Close button or closing the gui works can't see what I am missing. $StatID = GUICreate("High Scores", 220, 495-30) ... ; wait until window is closed $close = GUICtrlCreateButton("Close", 220-100, 431, 90, 30) Do $msg = GUIGetMsg() If $msg = $close Then ExitLoop Sleep(20) Until $msg = $GUI_EVENT_CLOSE GUIDelete($StatID) OnExit() Routine is at line 828 in whole code Reflex.au3
  18. Thank you. Exactly what I needed. Joystick has been ordered.
  19. Doctor Who mod for Reflex created by my niece. Simply copy the files over the existing ones.
  20. Works perfectly, thanks
  21. Just what I needed. Thank you.
  22. Reflex is my favorite. But IX is the one I am most proud of. Time to start thinking up a new one
  23. Ver 1.4 High Score fixed, properly sorted now. Cosmetic changes to Scoreboard to accommodate more systems Sound is more stable.
  24. I am more stumped by the logic than the format.
×
×
  • Create New...