Jump to content

CodyBarrett

Active Members
  • Posts

    1,220
  • Joined

  • Last visited

About CodyBarrett

  • Birthday 03/12/1993

Profile Information

  • Member Title
    I LOVE Juicy Fruit!!!
  • Location
    CANADA - Manitoba

Recent Profile Visitors

1,105 profile views

CodyBarrett's Achievements

Universalist

Universalist (7/7)

3

Reputation

  1. While True If $State = 'main' Then Sleep (75) main () ElseIf $State = 'pick_bike' Then Sleep (75) pick_bike () ElseIf $State = 'match' Then Start_Cycle_Sleep () match () Finish_Cycle_Sleep () EndIf WEnd this fixes it for MY machine, what about yours?
  2. i believe so, its MUCH faster on my machine now... is it too fast for you guys? (updated the DL link) thanks admiral
  3. i did, the first one slowed it down so much that a sleep wasn't necessary while getting the timer diffs in its own DO LOOP. and the second didn't seem usefull as i need a dynamic, not a precise sleep.
  4. i've updated the Download link with some minor changes, including a simple? sleep calculation. is that what you've been looking for?
  5. thats interesting, both of them, the first would be usefull for games, and the second, wow, a NANOseconds? thats impressive... but, i'm still looking for, say a dynamic sleep-speed optimized for pcs, depending on the CPU speed? it runs (currently) fine on my 3ghz single core x86, but on my buddies machine its much faster, dual-core 2.6ghz x64. i'd like to make the run-time speeds equal for any machine.
  6. Oops. Forgot about that lol had the controls reversed then realized the players would be crossing over eachother to play. Im not sure how to dynamically make the sleep() so it runs well on all machines. I had sleeps in the main and pick bike funcs and not in the match func but i couldnt navigate the bike at all without crashing. Too fast. More tweaking. Thanks admiral!
  7. NEW VERSION completely rewritten, updated at the top, i've left the other scrips ive written for people to know how many attempts i've made with this, and how far its come along. let me know if the new version has any bugs or needs improvements! BTW, networking is still under development.
  8. i'm one of those people who don't use KODA at all, good for getting a handle on GUIs but i prefer to make it myself instead of have it generated.
  9. use GDI+ and bmps of the desktop with mousemove and mouse click? it sounds kinda like you want a VNC client?
  10. so far... 1st PLACE) Variant 2nd Place) 1d array 3rd place) DllStruct
  11. so a variable is more efficient, when looping is not necessarily needed...? (yes it is only a small amount of time, but with enough variables/array elements it might become significant.)
  12. prolly a stupid question. but i've googled it, even with the prefix to search only autoitscript.com, i've gotten mixed results, and nothing that is definitive. is accessing a 1d array element repeatedly, slower than having simple vars?(i only use an array for looping, but i could easily change it to simple variables if it faster.)
  13. Hmmm.. Ill try that. My script has multiple functions like main. So maybe i CAN grt rid of the buffer. Ill get back to you after im done testing. Edit: Awesome it worked perfectly... Solved both the issues! Yet again... You save the day!
  14. its probably just a small detail or a timing issue for me... i just can't find it.
  15. hey guys, i've got another GDI issue no matter what i do to this code i can't get the flicker to stop when i'm redrawing. (use the Arrow Keys (UP & DOWN) also, when i set $scale to 2 it runs fairly smoothly.. but when i set it to anything smaller than 1.7 (for a bigger screen) it becomes unresponsive and the only thing that happens is it closes on ESC. Why? what am i doing wrong? spent a couple hours looking it up, maybe i'm blind or something... haven't found my answer yet. #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> Global $State = False Global $Buffer_Speed = 45, $key_count = 0 Global $Black = '000000', $Blue = '0000AA', $Red = 'AA0000', $White = 'FFFFFF' Global $hBB_BMP, $hBB_Graphic, $hGraphic, $hRed, $hBlue, $hWhite, $hBlack, $hFamily,$hFont, $hFormat Global $scale = 2 Global $hWnd, $height=@DesktopHeight/$scale, $width=@DesktopWidth/$scale, $style=$WS_POPUP, $exstyle=BitOR ($WS_EX_APPWINDOW,$WS_EX_TOPMOST) init () ;=================== ;MAIN LOOP ;=================== While True Switch $State Case 'main' main () Case False quit () Case Else ;do nothing EndSwitch Sleep (100) WEnd ;=================== ;MAIN LOOP ;=================== Func init () Opt ('GUIOnEventMode',1) $hWnd = GUICreate ('Main',$width,$height,0,0,$style,$exstyle) GUISetOnEvent (-3,'quit',$hWnd) GUISetState (@SW_SHOW,$hWnd) _GDIPlus_Startup () $hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd) $hBB_BMP = _GDIPlus_BitmapCreateFromGraphics ($width,$height,$hGraphic) $hBB_Graphic = _GDIPlus_ImageGetGraphicsContext ($hBB_BMP) $hBlack = _GDIPlus_BrushCreateSolid ('0xFF' & $Black) $hBlue = _GDIPlus_BrushCreateSolid ('0x90' & $Blue) $hRed = _GDIPlus_BrushCreateSolid ('0x90' & $Red) $hWhite = _GDIPlus_BrushCreateSolid ('0xFF' & $White) $hFormat = _GDIPlus_StringFormatCreate () $hFamily = _GDIPlus_FontFamilyCreate ('Tahoma') $hFont = _GDIPlus_FontCreate ($hFamily, 20, 1) $State = 'main' GUIRegisterMsg(0xF, 'MY_PAINT') GUIRegisterMsg(0x85, 'MY_PAINT') AdlibRegister ('BUFFER',$Buffer_Speed) EndFunc Func main () draw_main () While $State = 'main' If _IsPressed ('26') Or _IsPressed ('28') Then If _IsPressed ('26') Then If $key_count = 0 Then $key_count = 2 Else $key_count -= 1 EndIf EndIf If _IsPressed ('28') Then If $key_count = 2 Then $key_count = 0 Else $key_count += 1 EndIf EndIf ConsoleWrite ($key_count & @CRLF) draw_main () EndIf Sleep (100) WEnd EndFunc Func draw_main () Local $string = 'Use The Arrow Keys To Navigate:' & @CRLF & _ 'First Choice' & @CRLF & _ 'Second Choie' & @CRLF & _ 'Third Choice' Local $w = $width/2, $h = $height/2 Local $tLayout = _GDIPlus_RectFCreate (0,0,$w,$h) Local $aInfo = _GDIPlus_GraphicsMeasureString ($hBB_Graphic, $string, $hFont, $tLayout, $hFormat) _GDIPlus_GraphicsClear ($hBB_Graphic,'0xFF' & $Black) _GDIPlus_GraphicsFillRect ($hBB_Graphic,0,1.1*($key_count+1)*30,$w,35,$hBlue) _GDIPlus_GraphicsDrawStringEx ($hBB_Graphic,$string,$hFont,$aInfo[0],$hFormat,$hWhite) EndFunc Func quit () AdlibUnRegister ('BUFFER') _GDIPlus_GraphicsDispose ($hGraphic) _GDIPlus_ImageDispose ($hBB_BMP) _GDIPlus_GraphicsDispose ($hBB_Graphic) _GDIPlus_BrushDispose ($hBlack) _GDIPlus_BrushDispose ($hBlue) _GDIPlus_BrushDispose ($hRed) _GDIPlus_BrushDispose ($hWhite) _GDIPlus_FontDispose ($hFont) _GDIPlus_FontFamilyDispose ($hFamily) _GDIPlus_StringFormatDispose ($hFormat) _GDIPlus_Shutdown () Exit EndFunc Func BUFFER () _GDIPlus_GraphicsDrawImage($hGraphic, $hBB_BMP, 0, 0) EndFunc Func MY_PAINT($hWnd, $msg, $wParam, $lParam) _WinAPI_RedrawWindow($hWnd,Default,Default, BitOR($RDW_INVALIDATE, $RDW_UPDATENOW, $RDW_FRAME)) Return $GUI_RUNDEFMSG EndFunc
×
×
  • Create New...