jpam Posted January 14, 2007 Author Share Posted January 14, 2007 (edited) WinSetOnTop($gui,"",1); OnTop... why doesnt work??should be WinSetOnTop("Prospeed","",1) Edited January 14, 2007 by jpam Link to comment Share on other sites More sharing options...
GtaSpider Posted January 15, 2007 Share Posted January 15, 2007 Hello! $gui gives the Handle from the gui back so it must also work with this,but thx for reply Mfg/best regards Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
jpam Posted January 15, 2007 Author Share Posted January 15, 2007 New update ! Added SpriteHandle User can define Spritename as String Syntax; $Spaceship = sprite($Sprite1, 0, 0, 24, 18, 1, 1, 6, -30, 150) SetmovingRectangle($Spaceship, 0, 0, 800, 350) Movesprite($Spaceship, 810, 350) Have Fun Link to comment Share on other sites More sharing options...
Lakes Posted January 16, 2007 Share Posted January 16, 2007 (edited) New update ! Added SpriteHandle User can define Spritename as String Syntax; $Spaceship = sprite($Sprite1, 0, 0, 24, 18, 1, 1, 6, -30, 150) SetmovingRectangle($Spaceship, 0, 0, 800, 350) Movesprite($Spaceship, 810, 350) Have Fun Example code for the new UDF... expandcollapse popup#include <GUIConstants.au3> #include <Prospeed.au3> Opt("MouseCoordMode",0) Opt("GUIOnEventMode", 1) HotKeySet("{Esc}","_exit") $gui = GUICreate("Prospeed",800, 400, -1, -1,$WS_POPUP) GUISetState() ;Background(FILE, POSX, POSY) ;loads Background Background(@scriptdir & "\Hintergrund.jpg", 0, 0) $POSX = 0 $POSY = 0 $SprOfX = 0 $SprOfY = 0 $SpWid = 24 $SpHgt = 18 $SpFrms = 4 $SpStFrm = 1 $SpFrmSpd = 6 $SpPosX = -30 $Sprite1 = @scriptdir & "\Sprites.gif" $Sprite2 = @scriptdir & "\Sprites2.gif" $SprSpdX = 3 $SprSpdY = 4 ;Sprite("Sprite picture", offsetX, offsetY, WIDTH, HEIGHT, FRAMES, START_FRAME, FRAME_SPEED, posX, posY) ;loads sprites $Bee1 = sprite($Sprite1,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40) $Bee2 = sprite($Sprite2,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,60) $Bee3 = sprite($Sprite2,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,80) SetSpriteSpeed($Bee3, $SprSpdX, $SprSpdY) SetmovingRectangle($Bee3, 0, 0, 790, 390) SetSpriteAnimMove($Bee3, 1, 0, 0) SetSpriteAnimMove($Bee3, 2, 0, 0) SetSpriteAnimMove($Bee3, 3, 0, 0) SetSpriteAnimMove($Bee3, 5, 0, 32) SetSpriteAnimMove($Bee3, 6, 0, 32) SetSpriteAnimMove($Bee3, 7, 0, 32) $NumOfSpr = 80 $EndDim = $NumOfSpr/2 -1 Dim $CopyBee1[$NumOfSpr/2] Dim $CopyBee2[$NumOfSpr/2] For $i = 1 to $EndDim $CopyBee1[$i] = CopySprite($Bee1) next For $i = 1 to $EndDim $CopyBee2[$i] = CopySprite($Bee2) next For $i = 1 to $EndDim SetSpriteSpeed($CopyBee1[$i], $SprSpdX, $SprSpdY) next For $i = 1 to $EndDim SetSpriteSpeed($CopyBee2[$i], $SprSpdX, $SprSpdY) next For $i = 1 to $EndDim SetSpriteAnimMove($CopyBee1[$i], 1, 0, 0) SetSpriteAnimMove($CopyBee1[$i], 2, 0, 0) SetSpriteAnimMove($CopyBee1[$i], 3, 0, 0) SetSpriteAnimMove($CopyBee1[$i], 5, 0, 32) SetSpriteAnimMove($CopyBee1[$i], 6, 0, 32) SetSpriteAnimMove($CopyBee1[$i], 7, 0, 32) Next For $i = 1 to $EndDim SetSpriteAnimMove($CopyBee2[$i], 1, 0, 0) SetSpriteAnimMove($CopyBee2[$i], 2, 0, 0) SetSpriteAnimMove($CopyBee2[$i], 3, 0, 0) SetSpriteAnimMove($CopyBee2[$i], 5, 0, 32) SetSpriteAnimMove($CopyBee2[$i], 6, 0, 32) SetSpriteAnimMove($CopyBee2[$i], 7, 0, 32) Next ;SetmovingRectangle(Sprite nr, LEFT, TOP, RIGHT, BOTTOM) sets cage for sprite For $i = 1 to $EndDim SetmovingRectangle($CopyBee1[$i], 0, 0, 790, 390) next For $i = 1 to $EndDim SetmovingRectangle($CopyBee2[$i], 0, 0, 790, 390) next ;SetSpritePos($alias, $posX, $posY, $NextposX, $NextposY) While 1 For $i = 1 to $EndDim $pos = MouseGetPos() movesprite($Bee3,$pos[0],$pos[1]) SetSpritePos($CopyBee1[$i], Random(5,800, 1), Random(5,410, 1), Random(5,800, 1), Random(5,410, 1)) Sleep(10) Next For $i = 1 to $EndDim SetSpritePos($CopyBee2[$i], Random(5,800, 1), Random(5,410, 1), Random(5,800, 1), Random(5,410, 1)) $pos = MouseGetPos() Movesprite($Bee3,$pos[0],$pos[1]) Sleep(10) Next WEnd Func _exit() Exit EndFunc Edited January 16, 2007 by Lakes 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
jpam Posted January 16, 2007 Author Share Posted January 16, 2007 New Update ! added ImageHandle User can define Imagename as String Syntax; $tiger = LoadImage("D:\tiger.jpg", 0, 0, 0) ;LoadImage(FILE, offset X, offset Y, Onscreen 0/1) blur($tiger, 0, 0, 50, 1) ;blur(Alias, POS X, POS Y, VALUE, Onscreen 0/1) Extra option added onscreen 0/1 0 = holds image in memory 1 = copies image on screen When in memory you can add different effects added Onscreen(Alias, offsetX, offsetY) ;copies anytime a Image to screen added HasSpriteArrived Documentation in udf updated Downloads on post 1 jpam Link to comment Share on other sites More sharing options...
Lakes Posted January 17, 2007 Share Posted January 17, 2007 (edited) Drawing with Bees? CODE#include <GUIConstants.au3>#include <Prospeed.au3>#include <Math.au3>Opt("MouseCoordMode",0)Opt("GUIOnEventMode", 1)HotKeySet("{Esc}","_exit")$gui = GUICreate("Prospeed",800, 400, -1, -1,$WS_POPUP)GUISetState();Background(FILE, POSX, POSY) ;loads BackgroundBackground(@scriptdir & "\Hintergrund.jpg", 0, 0)$POSX = 0$POSY = 0$SprOfX = 0$SprOfY = 0$SpWid = 24$SpHgt = 18$SpFrms = 4$SpStFrm = 1$SpFrmSpd = 6$SpPosX = -30$Sprite1 = @scriptdir & "\Sprites.gif"$Sprite2 = @scriptdir & "\Sprites2.gif"$SprSpdX = 3$SprSpdY = 4;Sprite("Sprite picture", offsetX, offsetY, WIDTH, HEIGHT, FRAMES, START_FRAME, FRAME_SPEED, posX, posY) ;loads sprites$Bee1 = sprite($Sprite1,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40)$Bee3 = sprite($Sprite2,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,80)SetSpriteSpeed($Bee3, $SprSpdX, $SprSpdY)SetmovingRectangle($Bee3, 0, 0, 790, 390)SetSpriteAnimMove($Bee3, 1, 0, 0)SetSpriteAnimMove($Bee3, 2, 0, 0)SetSpriteAnimMove($Bee3, 3, 0, 0)SetSpriteAnimMove($Bee3, 5, 0, 32)SetSpriteAnimMove($Bee3, 6, 0, 32)SetSpriteAnimMove($Bee3, 7, 0, 32)$NumOfSpr = 160$EndDim = $NumOfSpr -1Dim $CopyBee1[$NumOfSpr];Dim $CopyBee2[$NumOfSpr/2]For $i = 1 to $EndDim$CopyBee1[$i] = CopySprite($Bee1)nextFor $i = 1 to $EndDimSetSpriteSpeed($CopyBee1[$i], $SprSpdX, $SprSpdY)next For $i = 1 to $EndDimSetSpriteAnimMove($CopyBee1[$i], 1, 0, 0)SetSpriteAnimMove($CopyBee1[$i], 2, 0, 0)SetSpriteAnimMove($CopyBee1[$i], 3, 0, 0)SetSpriteAnimMove($CopyBee1[$i], 5, 0, 32)SetSpriteAnimMove($CopyBee1[$i], 6, 0, 32)SetSpriteAnimMove($CopyBee1[$i], 7, 0, 32)Next;SetmovingRectangle(Sprite nr, LEFT, TOP, RIGHT, BOTTOM) sets cage for spriteFor $i = 1 to $EndDimSetmovingRectangle($CopyBee1[$i], 0, 0, 790, 390)next;For $i = 1 to $EndDim;SetmovingRectangle($CopyBee2[$i], 0, 0, 790, 390);next;SetSpritePos($alias, $posX, $posY, $NextposX, $NextposY)$Size = 20 ; vars for circle$OrgX = 400 ;$OrgY = 200 ;$Stp = 10 ;$n = 0While 1 For $i = 1 to $EndDim - 1 $pos = MouseGetPos() $R = _Radian ($n) $X = Sin($R)*$Size * 2 + $OrgX $Y = Cos($R)*$Size + $OrgY moveSprite($CopyBee1[$i], $X, $Y) $n = $n + 10 if $n > 360 then $n = 0 $Size = $Size + 10 If $Size > 200 then $Size = 20 Endif Sleep(50) NextWEnd Func _exit() ExitEndFunc Enjoy! Edit: Jpam has added this example to the first page with the UDF. Edited January 17, 2007 by Lakes 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
XxXFaNtA Posted January 17, 2007 Share Posted January 17, 2007 Wow this was really cool /[center][/center] Link to comment Share on other sites More sharing options...
jpam Posted January 17, 2007 Author Share Posted January 17, 2007 New Update ! added DirectXSound functions DSoundInit DSoundLoad DSoundPlay DSoundStop DSoundSetPan Every DSoundPlay has it own Volume setting and loop on/off Documentation in udf updated Link to comment Share on other sites More sharing options...
GtaSpider Posted January 17, 2007 Share Posted January 17, 2007 Hello! Ok! here is now my function for you It will create a grey background! It's not perfekt and complete but its a start here is it: #include <prospeed.au3> $grbck = _GreyBackground() MsgBox(4096,"","_GreyBackground test 1!") GUIDelete($grbck) Sleep(500) $grbck = _GreyBackground(1,1) MsgBox(4096,"","_GreyBackground test 2! With blur and fade in") GUIDelete($grbck) Func _GreyBackground($iBlur=0,$iFade=0,$onTop=1) Local $iGui = GUICreate("Prospeed",@DesktopWidth,@DesktopHeight, 0,0,-2147483648,128);$WS_POPUP, $WS_EX_TOOLWINDOW If $onTop Then WinSetOnTop($iGui,"",1) ScreenShot(@ScriptDir&"\Desktop.jpg",@DesktopWidth,@DesktopHeight,0,0,1) WinSetTrans($iGui,"",0) GUISetState() $dsktop = LoadImage(@scriptdir & "\Desktop.jpg", 0, 0,1,$iGui) Grey($dsktop, 0,0,1) If $iFade Then For $i = 1 To 255 step 5 WinSetTrans($iGui,"",$i) Next WinSetTrans($iGui,"",255) Else WinSetTrans($iGui,"",254) WinSetTrans($iGui,"",255) EndIf If $iBlur Then blur($dsktop, 0,0,30,1) Return $iGui EndFunc Mfg / Best Regards Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
jpam Posted January 17, 2007 Author Share Posted January 17, 2007 You should change; $dsktop = LoadImage(@scriptdir & "\Desktop.jpg", 0, 0,1,$iGui) To ; $dsktop = LoadImage(@scriptdir & "\Desktop.jpg", 0, 0, 1) Kind Regards jpam Link to comment Share on other sites More sharing options...
jpam Posted January 18, 2007 Author Share Posted January 18, 2007 Thanks for looking larry ! changed the Udf for wrong offset It was a issue with the WindowDC Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 18, 2007 Share Posted January 18, 2007 Hi, how to get the screenshot func to work? I tried to change the $S_Screen[0] to $S_Screen and so on, but no luck. Thanks! So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
jpam Posted January 18, 2007 Author Share Posted January 18, 2007 @ mega Screenshot("C:\Desk.jpg",@DesktopWidth,@DesktopHeight, 0, 0, 1) Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 19, 2007 Share Posted January 19, 2007 @ megaScreenshot("C:\Desk.jpg",@DesktopWidth,@DesktopHeight, 0, 0, 1)Hi,still gives me an memory error. :"> So long,MegaDoes it work for you? Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Lakes Posted January 19, 2007 Share Posted January 19, 2007 Just tried it here with no problem. 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 19, 2007 Share Posted January 19, 2007 Hi, I got it. I had a wrong prospeed.dll. I took the one out of Franks demo. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Will66 Posted January 19, 2007 Share Posted January 19, 2007 I'm using production version AutoIt v3.2.2.0. The dll is in system 32 folder and script directory too. The only script i can get to work is beees.au3 but still beees.au3 throws following errors/warnings:: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Program Files\AutoIt3\dll\beees.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +> Starting AutoIt3Wrapper v.1.7.5 >Running AU3Check (1.54.6.0) params: from:C:\Program Files\AutoIt3 C:\PROGRA~1\AutoIt3\Include\Prospeed.au3(245,91) : WARNING: $S_FXHANDLE1: possibly used before declaration. DllCall($S_DLL,"long","Fog","long",$hDC,"long",$S_POSX,"long",$S_POSY,"long",$S_FXHANDLE1, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\Prospeed.au3(245,111) : WARNING: $S_FXHANDLE2: possibly used before declaration. DllCall($S_DLL,"long","Fog","long",$hDC,"long",$S_POSX,"long",$S_POSY,"long",$S_FXHANDLE1,"long",$S_FXHANDLE2, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\Prospeed.au3(284,96) : WARNING: $S_InitExtFX1: possibly used before declaration. DllCall($S_DLL,"long","Rotate","long",$hDC,"long",$S_POSX,"long",$S_POSY,"long",$S_InitExtFX1, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\Prospeed.au3(332,94) : WARNING: $S_InitExtFX: possibly used before declaration. DllCall($S_DLL,"long","Rustle","long",$hDC,"long",$S_POSX,"long",$S_POSY,"long",$S_InitExtFX) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\Prospeed.au3(226,39) : WARNING: $S_FXHANDLE1: declared global in function only. Prefer top of file. Global $S_FXHANDLE1 = $S_FXHANDLE1[0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\dll\beees.au3 - 0 error(s), 5 warning(s) ->AU3Check ended.rc:1 >Running:(3.2.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\dll\beees.au3" +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 5.356 Link to comment Share on other sites More sharing options...
Nordwind Posted January 19, 2007 Share Posted January 19, 2007 Here's another bees-demo. I modified lakes original code using a better sprite moving mode (bresenham). expandcollapse popup#include <GUIConstants.au3> #include <Prospeed.au3> #include <Math.au3> Opt("MouseCoordMode",0) ;Opt("GUIOnEventMode", 1) HotKeySet("{Esc}","_exit") $gui = GUICreate("Prospeed",800, 400, -1, -1,$WS_POPUP) GUISetState() Background(@scriptdir & "\Hintergrund.jpg", 0, 0) $POSX = 0 $POSY = 0 $SprOfX = 0 $SprOfY = 0 $SpWid = 24 $SpHgt = 18 $SpFrms = 4 $SpStFrm = 1 $SpFrmSpd = 6 $SpPosX = -30 $Sprite1 = @scriptdir & "\Sprites.gif" $Sprite2 = @scriptdir & "\Sprites2.gif" $SprSpdX = 4 $SprSpdY = 4 $Bee1 = sprite($Sprite1,$SprOfX, $SprOfY, $SpWid, $SpHgt, $SpFrms, $SpStFrm, $SpFrmSpd, $SpPosX,40) DllCall($S_DLL,"long","SetSpriteMovingMode","long",$Bee1,"long",1) $NumOfSpr = 160 $EndDim = $NumOfSpr -1 Dim $CopyBee1[$NumOfSpr] For $i = 1 to $EndDim $CopyBee1[$i] = CopySprite($Bee1) DllCall($S_DLL,"long","SetSpriteMovingMode","long",$CopyBee1[$i],"long",1) SetSpriteSpeed($CopyBee1[$i], $SprSpdX, $SprSpdY) SetSpriteAnimMove($CopyBee1[$i], 1, 0, 0) SetSpriteAnimMove($CopyBee1[$i], 2, 0, 0) SetSpriteAnimMove($CopyBee1[$i], 3, 0, 0) SetSpriteAnimMove($CopyBee1[$i], 5, 0, 32) SetSpriteAnimMove($CopyBee1[$i], 6, 0, 32) SetSpriteAnimMove($CopyBee1[$i], 7, 0, 32) next $Size = 20; vars for circle $OrgX = 400; $OrgY = 200; $Stp = 10; $n = 0 While 1 For $i = 1 to $EndDim - 1 $pos = MouseGetPos() $R = _Radian ($n) $X = Sin($R)*$Size * 3 + $OrgX $Y = Cos($R)*$Size * 1.5 + $OrgY moveSprite($CopyBee1[$i], $X, $Y) $n = $n + 10 if $n > 360 then $n = 0 $Size = $Size + 10 If $Size > 200 then $Size = 20 Endif Sleep(10) Next WEnd Func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
Lakes Posted January 19, 2007 Share Posted January 19, 2007 Much Nicer! 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Lakes Posted January 19, 2007 Share Posted January 19, 2007 I'm using production version AutoIt v3.2.2.0. The dll is in system 32 folder and script directory too. The only script i can get to work is beees.au3 but still beees.au3 throws following errors/warnings:: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Program Files\AutoIt3\dll\beees.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +> Starting AutoIt3Wrapper v.1.7.5 >Running AU3Check (1.54.6.0) params: from:C:\Program Files\AutoIt3 C:\PROGRA~1\AutoIt3\Include\Prospeed.au3(245,91) : WARNING: $S_FXHANDLE1: possibly used before declaration. DllCall($S_DLL,"long","Fog","long",$hDC,"long",$S_POSX,"long",$S_POSY,"long",$S_FXHANDLE1, [snip]Yes, the current UDF does throw up warnings even when there`s nothing wrong with the program, I`m sure Jpam will tidy things up when hes completed the UDF, hes very busy with this as I think there are 200 functions?, and its does`nt help that I keep asking questions and making suggestions... So, please be patient and work around the current warnings if you can. 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now