Jump to content

ScreenSaver


ChrisL
 Share

Recommended Posts

Its a screensaver for a multi-training bay program where one of our trainers can select the customer they are training.

Problem was that the machine can not run a normal screen saver and I only wanted one to run while the login and customer choice was active. I have changed this setting and you can see I have put not needed instead it just says $login = 1

All it does is randomly generate a string across a black screen which says "All your bays are belong to us" but puts up random charaters before settling on the correct one.

It is currently 800x600 but you could change it quite easliy. And changing the message would be pretty straight forward too.

$Running = 0
$Mouse1 = MouseGetPos()
$Count = 1
; Script generated by AutoBuilder 0.5 Prototype
#NoTrayIcon
#include <GuiConstants.au3>
; Not needed this is to run with my other application $Login = WinWait ("X-Bay")
$Login = 1

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

$gui = GuiCreate("XbayScr", 800, 600,(@DesktopWidth-800)/2, (@DesktopHeight-600)/2 , $WS_POPUP + $WS_SYSMENU + $WS_MINIMIZEBOX)
GUISetBkColor("0x000000")

$Text = GuiCtrlCreateLabel("", 50, 120, 600, 40 )
GUICtrlSetFont ($Text, 300 , 800 , "" , "Tahoma" )
GUICtrlSetColor($Text, "0xFFFFFF")

#endregion --- GuiBuilder generated code End ---

While $Login = 1
$Mouse2 = MouseGetPos()

if $mouse1[0] = $Mouse2[0] and $Mouse1[1] = $Mouse2[1] and $running = 0 Then
    $timer = TimerInit ( )
    $Running = 1
    
Endif

If $mouse1[0] <> $Mouse2[0] or $Mouse1[1] <> $Mouse2[1] Then
    $mouse1[0] = $mouse2[0]
    $Mouse1[1] = $Mouse2[1]
    $running = 0
    $Count = 1
    
    $timer = TimerInit ( )
    if WinActive ($gui) then
        GuiSetState(@SW_HIDE,$gui)
        WinSetOnTop($Gui,"",0)
        Endif
    Endif

$TimerDiff = TimerDiff ( $timer )

If $timerDiff > 1000000 and $Mouse1[0] = $Mouse2[0] and $Mouse1[1] = $Mouse2[1] Then ; 10 mins = 1000000
    $Mouse2 = MouseGetPos()
    
    Switch $Count
Case 1
    GUICtrlSetPos ( $Text, Random(10, 400, 1), Random(10, 500, 1),400, 40)
    GUICtrlSetFont ($Text, 20 , 400 , "", "Tahoma" )
    $string =""
    
Case 2
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "A"
    GUICtrlSetData ($Text, $String)

    
Case 3
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "l"
    GUICtrlSetData ($Text, $String)
    
Case 4
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "l"
    GUICtrlSetData ($Text, $String)
    
Case 5
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & " "
    GUICtrlSetData ($Text, $String)
    
Case 6
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "y"
    GUICtrlSetData ($Text, $String)
    
Case 7
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "o"
    GUICtrlSetData ($Text, $String)
    
Case 8
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "u"
    GUICtrlSetData ($Text, $String)
    
Case 9
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "r"
    GUICtrlSetData ($Text, $String)
    
Case 10
    $String = $String & " "
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "b"
    GUICtrlSetData ($Text, $String)
    
Case 11
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
        next
    GUICtrlSetData ($Text, $String)
    
Case 12
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "a"
    GUICtrlSetData ($Text, $String)
    
Case 13
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "y"
    GUICtrlSetData ($Text, $String)
    
Case 14
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "s"
    GUICtrlSetData ($Text, $String)
    
Case 15
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & " "
    GUICtrlSetData ($Text, $String)
    
Case 16
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "a"
    GUICtrlSetData ($Text, $String)
    
Case 17
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "r"
    GUICtrlSetData ($Text, $String)
    
Case 18
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "e"
    GUICtrlSetData ($Text, $String)
    
Case 19
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & " "
    GUICtrlSetData ($Text, $String)
    
Case 20
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "b"
    GUICtrlSetData ($Text, $String)
    
Case 21
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "e"
    GUICtrlSetData ($Text, $String)
    
Case 22
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "l"
    GUICtrlSetData ($Text, $String)
    
Case 23
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "o"
    GUICtrlSetData ($Text, $String)
    
Case 24
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "n"
    GUICtrlSetData ($Text, $String)
    
Case 25
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "g"
    GUICtrlSetData ($Text, $String)
    
Case 26
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & " "
    GUICtrlSetData ($Text, $String)
    
Case 27
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "t"
    GUICtrlSetData ($Text, $String)
    
Case 28
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "o"
    GUICtrlSetData ($Text, $String)
    
Case 29
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & " "
    GUICtrlSetData ($Text, $String)
    
Case 30
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "u"
    GUICtrlSetData ($Text, $String)
    
Case 31
    
        For $i = 1 to 10
        GUICtrlSetData ($Text, $String &randomChr())
        sleep (100)
    next
    $String = $String & "s"
    GUICtrlSetData ($Text, $String)
    Sleep (500)
    
Case 32
    GUICtrlSetData ($Text,  "")
    GUICtrlSetPos ( $Text, 200, 120, 690, 370)
    GUICtrlSetFont ($Text, 100 , 800 , 2 , "Tahoma" )
    GUICtrlSetData ($Text,  "X-Bay")
    Sleep(1000)
Case Else
    $Count = 0
EndSwitch
    $Count = $count + 1
    if not WinActive ($gui) then
        GuiSetState(@SW_SHOW,$gui)
        WinSetOnTop($Gui,"",1)
        Endif
    Endif
Sleep(10)
; not needed it is used for my other application $Login = WinExists ("X-Bay")

    Wend
Func RandomChr()
    
    $Num = Random(32, 125, 1)
    
    Return Chr($num)
    
EndFunc

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