Jump to content

WMP Visualisation ScreenSaver !


buzz44
 Share

Recommended Posts

All the screen savers I have suck! but i really like the visualisations in Window Media Player 10. So I thought to myself, "AHA!".

If your mouse is inactive for 10 minutes it will open up windows media player, put it to full size, and play a blank 10 second file.

Before using this as a screensaver be sure that your screensaver is set to "none", and that you have "repeat" ticked in WMP so it plays over and over again.

Thanks to CyberSlug for helping me with the Run() Function

The blank .wav file is included below, keep it in the same directory and the script.

#NoTrayIcon

$NWMP = 1
$Time = 1

$Exe = RegRead("HKEY_USERS\.DEFAULT\Software\Microsoft\Keyboard\Native Media Players\WMP", "ExePath")

While 1
   If Not ProcessExists("wmplayer.exe") Then
      $MousePos_1 = MouseGetPos()
      Sleep(5)
      $MousePos_2 = MouseGetPos()
      If $MousePos_2[0] = $MousePos_1[0] Or $MousePos_2[1] = $MousePos_1[1] Then
         $NWMP = 1
         If $Time = 1 Then
            $Begin = TimerInit()
            $Time = 0
         EndIf
         While 1
            $Dif = TimerDiff($Begin)
            If $NWMP = 1 Then
               If $Dif > 600000 Then
                  Run($Exe & ' "' & @ScriptDir & '\test.wav"', "", @SW_SHOW)
                  WinWaitActive("Windows Media Player")
                  Sleep(2000)
                  Send("!{ENTER}")
                  ExitLoop
               EndIf
               _WMP()
            EndIf
            If $NWMP = 0 Then
               ExitLoop
            EndIf
         WEnd
      Else
         $Time = 1
      EndIf
   Else
      _NWMP()
   EndIf
WEnd

Func _WMP()
   $MousePos_3 = MouseGetPos()
   Sleep(5)
   $MousePos_4 = MouseGetPos()
   If $MousePos_4[0] <> $MousePos_3[0] Or $MousePos_4[1] <> $MousePos_3[1] Then
      $NWMP = 0
   EndIf
EndFunc

Func _NWMP()
   $MousePos_3 = MouseGetPos()
   Sleep(5)
   $MousePos_4 = MouseGetPos()
   If $MousePos_4[0] <> $MousePos_3[0] Or $MousePos_4[1] <> $MousePos_3[1] Then
      ProcessClose("wmplayer.exe")
      $NWMP = 1
      $Begin = TimerInit()
   EndIf
EndFunc

Edit: HMMMMMMMMMMM, Sry about the other posts, I have no idea why they are there lol, If a Mod would like to delete them, please do.

Edit2: Removed attached file... It was taking up too much room lol.

Edited by Burrup

qq

Link to comment
Share on other sites

Blank file at 218 kb!?

Change the file compression to something better, OGG or something can get a 1 second blank file down to like 1kb, probably :)

"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
Link to comment
Share on other sites

  • 5 months later...
  • 4 weeks later...

I think you may want to change this line;

If $MousePos_2[0] = $MousePos_1[0] Or $MousePos_2[1] = $MousePos_1[1] Then

TO

If $MousePos_2[0] = $MousePos_1[0] AND $MousePos_2[1] = $MousePos_1[1] Then

Just a thought but in theory the mouse could be moved and be on 1 of the same axis's, however unlikely, it still could happen. =)

Later; Lew

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