Jump to content

Recommended Posts

Posted (edited)

  goldenix said:

Maybe you fix this also:

with resolution 1280 x 1024 the snow falls like this:

Screen & snow* at first after we put Random(1,1280,1)

--------------------------------------

|**************************|

|**************************|

|**************************|

| stops falling hire |

| |

| |

| |

| |

| |

--------------------------------------

After a while

--------------------------------------

|**************************|

|**************************|

|**************************|

|**************************|

|**************************|

| stops falling hire |

| |

| |

--------------------------------------

use @desktopheight and @desktopwidth ->

#include "Prospeed.au3"

HotKeySet("{Esc}","_Exit")
WinMinimizeAll()

screencopie()

$M_load = loadsprite("Files\snow.jpg")

Dim $sp[400]
Dim $format[4]
$format[1] = 0
$format[2] = 27
$format[3] = 54

For $i = 1 to 99
    $r = Random(1,3,1)
    $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(1,@DesktopWidth,1), -20)
    Select
        Case $r = 1
            setspritespeed($sp[$i],3,3)
        Case $r = 2
            setspritespeed($sp[$i],2,2)
        Case $r = 3 
            setspritespeed($sp[$i],1,1)
    EndSelect
    $x = GetSpriteX($sp[$i])
    movesprite($sp[$i], $x, @DesktopHeight-15)
    Sleep(250)
Next

While 1
    For $i = 1 to 99
        $hasarrived = HasSpriteArrived($sp[$i])
        If $hasarrived = 1 Then
            
            MarkSprite($sp[$i],1)
            deletesprite($sp[$i])
            cleanup(1); Delete sprites when animation is done
            
            $r = Random(1,3,1)
            $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(1,@DesktopWidth,1), -20)
            If $r = 1 Then setspritespeed($sp[$i],3,3)
            If $r = 2 Then setspritespeed($sp[$i],2,2)
            If $r = 3 Then setspritespeed($sp[$i],1,1)
            $x = GetSpriteX($sp[$i])
            movesprite($sp[$i], $x, @DesktopHeight-15)
        EndIf   
    Next
    Sleep(20)
WEnd

Func _Exit()
   Exit
EndFunc
Edited by Dellairion
  • Replies 62
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

  Dellairion said:

use @desktopheight and @desktopwidth ->

movesprite($sp[$i], $x, @DesktopHeight-15)
Soo this where it was hidden, i see i see, I thought it was the falling speed.

Now all that is left to do is the screencopie thing & if no window is active, then "Let the snow fall...."

cheers.:)

snow_mod.bmp

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Posted

First let me say this is very nice! I was looking for something like that (yes im a sucker for christmas :) )

When i escaped the script the snowflakes would only disappear when the screen refreshed( aka a window is put over it) so i took the liberty of modifying the _Exit() func a little so that if triggered, it will slowly stop snowing and eventually all flakes are destroyed.

Func _Exit()
    For $i = 1 To 99
        Sleep(200)
        if $sp[$i] > 0 Then
            SetSpriteFixMode($sp[$i],1)
            MarkSprite($sp[$i],1)
            deletesprite($sp[$i])
            cleanup(1)
        EndIf
    Next
    Exit
EndFunc

Again .. Good job !

Posted (edited)

I've changed the code a bit (check first post).

The snow still has a purple background but i'll look at that tommorow. (i've got to go to work tommorow and i can use some sleep)

hehe nice one @Creator. Maybe i'll include it.

Going offline now bye :)

Edited by Dellairion
Posted

  Dellairion said:

I've changed the code a bit (check first post).

The snow still has a purple background but i'll look at that tommorow. (i've got to go to work tommorow and i can use some sleep)

Yummmmmie a GUI .... this is getting better by the minute. :)

Posted

well, after long reading on mickysoft msdn

i saw that my window dc call was not correct.

i sprites must have the desktop listview dc

i corrected it in the prospeed.udf

no more corupted windows anymore :)

you need to download the prospeed.udf below !

#include <Prospeed.au3>

HotKeySet("{Esc}","_Exit")

WinMinimizeAll()

screencopie()

$M_load = loadsprite("snow.bmp")

Dim $sp[400]
Dim $format[4]
$format[1] = 0
$format[2] = 27
$format[3] = 54

For $i = 1 to 49
    $r = Random(1,3,1)
    $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(1,@DesktopWidth,1), Random(0,200,1))
    Select
        Case $r = 1
            setspritespeed($sp[$i],3,3)
        Case $r = 2
            setspritespeed($sp[$i],2,2)
        Case $r = 3 
            setspritespeed($sp[$i],1,1)
    EndSelect
    $x = GetSpriteX($sp[$i])
    movesprite($sp[$i], $x, @DesktopHeight)
    Sleep(250)
Next

While 1
    For $i = 1 to 49
        $hasarrived = HasSpriteArrived($sp[$i])
        If $hasarrived = 1 Then
            MarkSprite($sp[$i],1)
            deletesprite($sp[$i])
            cleanup(1)
            $r = Random(1,3,1)
            $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(1,@DesktopWidth,1), Random(0,10,1))
            If $r = 1 Then setspritespeed($sp[$i],3,3)
            If $r = 2 Then setspritespeed($sp[$i],2,2)
            If $r = 3 Then setspritespeed($sp[$i],1,1)
            $x = GetSpriteX($sp[$i])
            movesprite($sp[$i], $x, @DesktopHeight)
        EndIf   
    Next
    Sleep(20)
WEnd

Func _Exit()
   Exit
EndFunc

Prospeed.au3

Posted

  Piano_Man said:

Does this work with the newest version of AutoIt for anyone? I keep getting an error about vectors...

make sure prospeed.dll is in your scriptdir !

Posted (edited)

  Piano_Man said:

Does this work with the newest version of AutoIt for anyone? I keep getting an error about vectors...

Yup it works with beta, but the snowflakes still screw up your screen if you open new window,

If you have no beta you ge this error see below: Soo get the beta.!

ERROR: $WM_PAINT: undeclared global variable.
Edited by goldenix
My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
Posted

  goldenix said:

Yup it works with beta, but the snowflakes still screw up your screen if you open new window,

If you have no beta you ge this error see below: Soo get the beta.!

ERROR: $WM_PAINT: undeclared global variable.
Not if you use de prospeed.au3 in the post from 12:58 from jpam!!
Posted

#include <Prospeed.au3>

HotKeySet("{Esc}","_Exit")

WinMinimizeAll()

screencopie()

$M_load = loadsprite("snow.bmp")
InitPixelEffects()

Dim $sp[400]
Dim $format[4]
$format[1] = 0
$format[2] = 27
$format[3] = 54

For $i = 1 to 70
    $r = Random(1,3,1)
    $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(0,@DesktopWidth,1)-13, Random(0,200,1))
    Select
        Case $r = 1
            setspritespeed($sp[$i],3,3)
        Case $r = 2
            setspritespeed($sp[$i],2,2)
        Case $r = 3 
            setspritespeed($sp[$i],1,1)
    EndSelect
    $x = GetSpriteX($sp[$i])
    movesprite($sp[$i], $x, @DesktopHeight -40)
    Sleep(250)
Next

$p1 = 1
$stackup = 45
While 1 
    For $i = 1 to 70
        $hasarrived = HasSpriteArrived($sp[$i])
        If $hasarrived = 1 Then
            SpriteToHDC($sp[$i])
            Sleep(5)
            MarkSprite($sp[$i],1)
            deletesprite($sp[$i])
            cleanup(1)
            $r = Random(1,3,1)
            $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(0,@DesktopWidth,1)-13, Random(0,10,1))
            If $r = 1 Then setspritespeed($sp[$i],3,3)
            If $r = 2 Then setspritespeed($sp[$i],2,2)
            If $r = 3 Then setspritespeed($sp[$i],1,1)
            $x = GetSpriteX($sp[$i])
            movesprite($sp[$i], $x, 768 -$stackup)
        EndIf
    Next
    If $p1 = 15 Then 
        SetPixelEffect(Random(1,@DesktopWidth,1), -100, 0xffffff, 160, 3, 2, 100, 1, 100)
        $stackup +=1
        $p1 = 1
    EndIf
    $p1 +=1
    Sleep(250)  
WEnd

Func _Exit()
   Exit
EndFunc

added little pixel effect

and snow stacks up now on your screen :)

Posted

Wow, nice effects :) .

@jpam

The last one not work for me ^_^

And what you mean by «snow stacks up now on your screen»?

you mean like it keeping growing on the bottom of the screen?

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted
  Quote

what error did you get ?

No errors, i just can't see anything, the script runing, but there is no snow... :) - can you please tell me what the prospeed.au3 i should use for the AutoIt version 3.2.8.1? i use an old ione i think, the one that was here before gave me lot's of errors (array related etc.).

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted

  MsCreatoR said:

No errors, i just can't see anything, the script runing, but there is no snow... :) - can you please tell me what the prospeed.au3 i should use for the AutoIt version 3.2.8.1? i use an old ione i think, the one that was here before gave me lot's of errors (array related etc.).

Same for me, haven't snow in screen.

Posted (edited)

  Quote

last prospeed.udf

http://www.autoitscript.com/forum/index.ph...amp;hl=prospeed

try to put a sleep after screencopie()

or comment InitPixelEffects() and SetPixelEffect to see if the sprites apear on screen.

Ok, i used now all updated stuff... the problem is still there ^_^, i commented out the mentioned lines (the sleep didn't help either), the snow is falling ok, but not growing on the bottom of the screen - sorry, while i posted it start to grow :) - but it's kind of not in place (a little higher then taskbar), and it collected by lines, like columns...

And btw, i think it would be better to put this with the exit func...

Func _Exit()
    WinMinimizeAllUndo()
    ControlSend("[CLASS:Progman]", "", "SysListView321", "{F5}")
    Exit
EndFunc

So all windows will be restored, and the desktop will be refreshed when we exit the script.

Edited by MsCreatoR

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Posted (edited)

you can change "$stackup = 45" for the taskbar height

play with the parameters for best results

put a sleep after "InitPixelEffects()"

if you dont see any snow falling and you are in the editor "SciTE" use Betarun not F5 or Go

little change;

#include <Prospeed.au3>

HotKeySet("{Esc}","_Exit")

WinMinimizeAll()

screencopie()

$M_load = loadsprite("snow.bmp")
InitPixelEffects()

Dim $sp[400]
Dim $format[4]
$format[1] = 0
$format[2] = 27
$format[3] = 54
$p1 = 1
$stackup = 45

For $i = 1 to 49
    $r = Random(1,3,1)
    $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(0,@DesktopWidth,1)-13, Random(0,200,1))
    Select
        Case $r = 1
            setspritespeed($sp[$i],3,3)
        Case $r = 2
            setspritespeed($sp[$i],2,2)
        Case $r = 3 
            setspritespeed($sp[$i],1,1)
    EndSelect
    $x = GetSpriteX($sp[$i])
    movesprite($sp[$i], $x, @DesktopHeight -$stackup)
    Sleep(250)
Next

While 1 
    For $i = 1 to 49
        $hasarrived = HasSpriteArrived($sp[$i])
        If $hasarrived = 1 Then
            SpriteToHDC($sp[$i])
            Sleep(5)
            MarkSprite($sp[$i],1)
            deletesprite($sp[$i])
            cleanup(1)
            $r = Random(1,3,1)
            $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(0,@DesktopWidth,1)-13, Random(0,10,1))
            If $r = 1 Then setspritespeed($sp[$i],3,3)
            If $r = 2 Then setspritespeed($sp[$i],2,2)
            If $r = 3 Then setspritespeed($sp[$i],1,1)
            $x = GetSpriteX($sp[$i])
            movesprite($sp[$i], $x, @DesktopHeight -$stackup)
        EndIf
    Next
    If $p1 = 15 Then 
        SetPixelEffect(Random(1,@DesktopWidth,1), -100, 0xffffff, 160, 3, 2, 100, 1, 100)
        $stackup +=1
        $p1 = 1
    EndIf
    $p1 +=1
    Sleep(250)  
WEnd

Func _Exit()
    WinMinimizeAllUndo()
    ControlSend("[CLASS:Progman]", "", "SysListView321", "{F5}")
    Exit
EndFunc
Edited by jpam
Posted

#cs
 for people who don't see any snow falling
 written in Autoit v3.2.4.9
 processor pentium Celeron 4 2.4 GHZ
 tested @ screen res 1024/768 and 1280/1024
 make sure you have the last prospeed.udf , http://www.autoitscript.com/forum/index.php?showtopic=38549&st=0&start=0
 copy prospeed.udf in autoit/include or if you are using autoit beta in autoit/beta/include
 put prospeed.dll and snow.bmp in your scriptdir
 download prospeed.dll @ http://www.autoitscript.com/forum/index.php?showtopic=38549&st=0&start=0
#ce

#include <Prospeed.au3>

HotKeySet("{Esc}","_Exit")

WinMinimizeAll()

screencopie()
;Sleep(50) ; If you have a fast computer try sleep here 

$M_load = loadsprite("snow.bmp")
; If you get black sprite's ,get the "snow.bmp" at early post and specify path to it

InitPixelEffects() ; If you don't see any snow falling try commenting "InitPixelEffects()" and SetPixelEffect below
;Sleep(50) ; If you have a fast computer try sleep here

Dim $sp[400]
Dim $format[4]
$format[1] = 0
$format[2] = 27
$format[3] = 54
$p1 = 1
$stackup = 45

For $i = 1 to 49
    $r = Random(1,3,1)
    $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(0,@DesktopWidth,1)-13, Random(0,200,1))
    Select
        Case $r = 1
            setspritespeed($sp[$i],3,3)
        Case $r = 2
            setspritespeed($sp[$i],2,2)
        Case $r = 3 
            setspritespeed($sp[$i],1,1)
    EndSelect
    $x = GetSpriteX($sp[$i])
    movesprite($sp[$i], $x, @DesktopHeight -$stackup)
    Sleep(250)
Next

While 1 
    For $i = 1 to 49
        $hasarrived = HasSpriteArrived($sp[$i])
        If $hasarrived = 1 Then
            SpriteToHDC($sp[$i])
            Sleep(5)
            MarkSprite($sp[$i],1)
            deletesprite($sp[$i])
            cleanup(1)
            $r = Random(1,3,1)
            $sp[$i] = sprite($M_load, $format[$r], 0, 27, 27, 1, 1, 1, Random(0,@DesktopWidth,1)-13, Random(0,10,1))
            If $r = 1 Then setspritespeed($sp[$i],3,3)
            If $r = 2 Then setspritespeed($sp[$i],2,2)
            If $r = 3 Then setspritespeed($sp[$i],1,1)
            $x = GetSpriteX($sp[$i])
            movesprite($sp[$i], $x, @DesktopHeight -$stackup)
        EndIf
    Next
    If $p1 = 15 Then 
        SetPixelEffect(Random(1,@DesktopWidth,1), -100, 0xffffff, 160, 3, 2, 100, 1, 100) ; If you don't see any snow falling comment this line and InitPixelEffects()
        $stackup +=1
        $p1 = 1
    EndIf
    $p1 +=1
    Sleep(250)  
WEnd

Func _Exit()
    WinMinimizeAllUndo()
    ControlSend("[CLASS:Progman]", "", "SysListView321", "{F5}")
    Exit
EndFunc

i put some comments in it

if you check everthing that is in the comments, it must work

you must see the snow !

if not ....... wait for the real snow falling from the sky :)

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
  • Recently Browsing   0 members

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