Jump to content

prospeed


jpam
 Share

Recommended Posts

  • Replies 511
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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

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...

#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 by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

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

Drawing with Bees? :D

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 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)

$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 -1

Dim $CopyBee1[$NumOfSpr]

;Dim $CopyBee2[$NumOfSpr/2]

For $i = 1 to $EndDim

$CopyBee1[$i] = CopySprite($Bee1)

next

For $i = 1 to $EndDim

SetSpriteSpeed($CopyBee1[$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

;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)

$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 * 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)

Next

WEnd

Func _exit()

Exit

EndFunc

Enjoy! :)

Edit: Jpam has added this example to the first page with the UDF. :D

Edited by Lakes

2015 - Still no flying cars, instead blankets with sleeves.

Link to comment
Share on other sites

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 :D

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

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

@ mega

Screenshot("C:\Desk.jpg",@DesktopWidth,@DesktopHeight, 0, 0, 1)

Hi,

still gives me an memory error. :">

So long,

Mega

Does 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

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

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

Here's another bees-demo. I modified lakes original code using a better sprite moving mode (bresenham).

#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

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... :D

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...