All Activity

This stream auto-updates   

  1. Past hour
  2. You have to add two additional check points otherwise the corner of the player sprite will stay outside the red path object. ; includes --------------------------------------------------------------------- #include-once #include <GDIPlus.au3> #include <Misc.au3> ; declaration ------------------------------------------------------------------ Local Const $iGuiWidth = 1000 Local Const $iGuiHeight = 690 Local Const $iGuiLeft = 10 Local Const $iGuiTop = 10 Local Const $GUI_EVENT_CLOSE = -3 Local Const $iPlayerHeight = 48 Local Const $iPlayerWidth = 32 Local Const $iPlayerStep = 4 Local $iXPosPlayer = 16 Local $iYPosPlayer = 16 Local Const $iXPosBlueRectangle = 100 Local Const $iYPosBlueRectangle = 100 Local Const $iBlueRectangleWidth = 128 Local Const $iBlueRectangleHeight = 160 Local Const $iXPosTree = 100 Local Const $iYPosTree = 100 Local Const $iTreeWidth = 128 Local Const $iTreeHeight = 160 Local Const $sPlayerImg = 'player01_01.png' Local Const $sTreeImg = 'tree01_01.png' ; gui -------------------------------------------------------------------------- Local $hMainGui = GUICreate( '', $iGuiWidth, $iGuiHeight, $iGuiLeft, $iGuiTop ) GUISetState( @SW_SHOW, $hMainGui ) ; init ------------------------------------------------------------------------- Opt( 'GUIOnEventMode', 1 ) GUISetOnEvent( $GUI_EVENT_CLOSE, '_exit' ) _GDIPlus_Startup() Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND( $hMainGui ) Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics( $iGuiWidth, $iGuiHeight, $hGraphics ) Local $hBuffer = _GDIPlus_ImageGetGraphicsContext( $hBitmap ) Local $vWhite = _GDIPlus_BrushCreateSolid( 0xFFFFFFFF ) Local $vBlue = _GDIPlus_BrushCreateSolid( 0xFFABCDEF ) Local $vRed = _GDIPlus_BrushCreateSolid( 0xFFFF0000 ) Local $hGraphicPath = _GDIPlus_PathCreate() _GDIPlus_PathAddRectangle( $hGraphicPath, 130, 215, 70, 35 ) ; set red collision area Local $hImagePlayer = _GDIPlus_ImageLoadFromFile( $sPlayerImg ) Local $hImageThree = _GDIPlus_ImageLoadFromFile( $sTreeImg ) ; functions -------------------------------------------------------------------- Func _exit() _GDIPlus_PathDispose( $hGraphicPath ) _GDIPlus_BrushDispose( $vRed ) _GDIPlus_BrushDispose( $vBlue ) _GDIPlus_BrushDispose( $vWhite ) _GDIPlus_GraphicsDispose( $hBuffer ) _GDIPlus_BitmapDispose( $hBitmap ) _GDIPlus_BitmapDispose( $hImagePlayer ) _GDIPlus_BitmapDispose( $hImageThree ) _GDIPlus_GraphicsDispose( $hGraphics ) _GDIPlus_Shutdown() GUIDelete( $hMainGui ) Exit EndFunc ; processing ------------------------------------------------------------------- While 1 _GDIPlus_GraphicsClear( $hBuffer ) _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) ; draw player background _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosBlueRectangle, $iYPosBlueRectangle, $iBlueRectangleWidth, $iBlueRectangleHeight, $vBlue ) ; draw tree background _GDIPlus_GraphicsDrawImageRect( $hBuffer, $hImagePlayer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight ) ; draw player _GDIPlus_GraphicsDrawImageRect( $hBuffer, $hImageThree, $iXPosTree, $iYPosTree, $iTreeWidth, $iTreeHeight ) ; draw tree _GDIPlus_GraphicsFillPath( $hBuffer, $hGraphicPath, $vRed ) ; draw red collision area If _IsPressed( '25' ) Then ; left If Not Check_for_Collision($iXPosPlayer - $iPlayerStep, $iYPosPlayer, $iXPosPlayer - $iPlayerStep + $iPlayerWidth, $iYPosPlayer, _ $iXPosPlayer - $iPlayerStep, $iYPosPlayer + $iPlayerHeight, $iXPosPlayer - $iPlayerStep + $iPlayerWidth, $iYPosPlayer + $iPlayerHeight, $hGraphicPath) Then $iXPosPlayer -= $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf If _IsPressed( '27' ) Then ; right If Not Check_for_Collision($iXPosPlayer + $iPlayerStep, $iYPosPlayer, $iXPosPlayer + $iPlayerStep + $iPlayerWidth, $iYPosPlayer, _ $iXPosPlayer + $iPlayerStep, $iYPosPlayer + $iPlayerHeight, $iXPosPlayer + $iPlayerStep + $iPlayerWidth, $iYPosPlayer + $iPlayerHeight, $hGraphicPath) Then $iXPosPlayer += $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf If _IsPressed( '26' ) Then ; up If Not Check_for_Collision($iXPosPlayer, $iYPosPlayer - $iPlayerStep, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer - $iPlayerStep, _ $iXPosPlayer, $iYPosPlayer - $iPlayerStep + $iPlayerHeight, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer - $iPlayerStep + $iPlayerHeight, $hGraphicPath) Then $iYPosPlayer -= $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf If _IsPressed( '28' ) Then ; down If Not Check_for_Collision($iXPosPlayer, $iYPosPlayer + $iPlayerStep, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer + $iPlayerStep, _ $iXPosPlayer, $iYPosPlayer + $iPlayerStep + $iPlayerHeight, $iXPosPlayer + $iPlayerWidth, $iYPosPlayer + $iPlayerStep + $iPlayerHeight, $hGraphicPath) Then $iYPosPlayer += $iPlayerStep _GDIPlus_GraphicsFillRect( $hBuffer, $iXPosPlayer, $iYPosPlayer, $iPlayerWidth, $iPlayerHeight, $vWhite ) EndIf EndIf _GDIPlus_GraphicsDrawImageRect( $hGraphics, $hBitmap, 0, 0, $iGuiWidth, $iGuiHeight ) Sleep( 10 ) WEnd Func Check_for_Collision($x1, $y1, $x2, $y2, $x3, $y3, $x4, $y4, $hPath) Return BitOR(_GDIPlus_PathIsVisiblePoint($hPath, $x1, $y1), _GDIPlus_PathIsVisiblePoint($hPath, $x2, $y2), _ _GDIPlus_PathIsVisiblePoint($hPath, $x3, $y3), _GDIPlus_PathIsVisiblePoint($hPath, $x4, $y4), _ _GDIPlus_PathIsVisiblePoint($hPath, $x1, ($y1 + $y3) / 2), _GDIPlus_PathIsVisiblePoint($hPath, $x2, ($y2 + $y4) / 2)) EndFunc Further _GDIPlus_ImageLoadFromFile in an endless loop causes a memory leak!
  3. Funtime60, The include lines you have at the top of your script actually insert the entire include file at that point - so your script does not start until many, many lines later than you think. Look in the SciTE Help file for Au3Stripper with the /MergeOnly option - that gives you a file similar to the one used to compile and allows you to determine which line is giving you the problem. My guess: the StringSplit on line #40, because you will crash if you try to access a non-existent array. So add some errorchecking to confirm you have a valid array after the function call. M23 Edit: Which is what he just said as well!
  4. @Mannyfresh31 in the future when responding please hit the reply button rather than Quote. Quoting everything everyone says pads the thread unnecessarily.
  5. _DlgBox <> _DlgWnd =)
  6. @Funtime60 the difference in lines is due to your includes, as all of those lines are counted too. The best way to narrow down errors is through good coding practices. This would include proper error checking after every action. Below is just a short example of this inside your script: Local $CoFPath, $CoFile, $Config $CoFPath = @WorkingDir & "\Settings.cfg" If FileExists($CoFPath) Then $CoFile = Fileopen($CoFPath, $FO_READ) Else ConsoleWrite("Unable to open " & $CoFPath & @CRLF) EndIf Writing your script in this manner allows you to track down issues much more quickly, and the line number become irrelevant
  7. I'm getting an error on that says there is an error at line 7000 something. There are two major problems here, A) this worked early although it was a different machine, and my code is only 61 lines long. Any clues as to what's going on? (Please excuse any stupid things I wrote in here. I bet there's a lot.) Chat.au3
  8. Si Mira necesito limpiar bien Mi codigo para subirlo y he andado ocupado pero gracias por las sugerencia
  9. Yeap, I'd send something to a https site's form, ...along with a checkbox that entitles the beta/debug/whatnot, to share personal/private/whatnot, info. If I needed a scheduled reboot, instead of writing a script, I'd just add it to the task scheduler. But as your 1st script here at the forums, ...good to see there is a coder in you
  10. Today
  11. It does not, for some reason, work for me. This did: Func _GetHexMask($sDays, $Delim=Default) If $Delim = Default Then $Delim = Opt('GUIDataSeparatorChar') $aDays = StringSplit($sDays, $Delim, 2) Local $Mask = 0 For $i = 0 To UBound($aDays) -1 If $aDays[$i] < 1 Or $aDays[$i] > 31 Then ContinueLoop $Mask += BitShift(0x0001,-($aDays[$i] -1)) Next Return $Mask EndFunc ;==>_GetHexMask @BugFix, if you change your code, i'll remove this ( as it would be redundant ). Thanks for the idea, it's handy
  12. because it's an unsigned executable .. @TRAGENALPHA The main feature of what I was thinking this could do, not sure maybe it does.. That it creates a new "include" directory which collects only the used includes of what the script uses (master UDF's + custom + #AutoIt3Wrapper directions + fileinstall .etc ) I like the concept of the idea and what you managed to get with it so far, this can be a great portable tool if one wants for example to quickly amend something into the script and (compile) when something doesn't work as expected on some other computer (environment) Thanks for sharing
  13. See iuiautomation and faq links in my signature
  14. @vkrisz81, You do know you can edit your posts in stead of firing multiple posts within a minute....right? Jos
  15. is there any other way to automate web pages? to acces a browser and get dta from sites? because ie old, ff dont work!
  16. now i downgraded the mozilla it can communicate it can load a site, but the return does not work, i mean ffopenurl says cant find, while really it loaded.. HOW??? it can navigate but cant see its done??
  17. Maybe you get some answers on the MozRepl homepage:
  18. or mozrepl never will work with ff more?
  19. and is there any solving?
  20. If you're using the latest version of firefox the FF.au3 UDF won't work with it because MozRepl won't work with this version of FF.
  21. the ffstart returns regedit problem, i corrected it to the correct way, but still does not change the url
  22. we know ie too old for modern webpages. if ff udf does not work.. what other udf is presented to communicate with any browser?
  23. Which version of FF are you talking about?
  24. hello! can anybody tell me is there any working udf for firefox? because the .15 version cant communicate with firefox. the first statement does not work . i know it worked because i tested it few months ago, but now its dead. after refresh firefox 2 weeks ago. is there any tip?
  25. Ini files are not generic text files, and have VERY specific formatting rules. Random pictures aren't part of that. Use another type of file and don't use IniWrite/IniRead with it.
  1. Load more activity