          *---------------------------------*
          |                                 |
          |           Keep Awake            |
          |             v1.0                |
          |                                 |
          |  Want to go away from keyboard  |
          |       without being AFK?        |
          |                                 |
          *---------------------------------*

               (c) 2006 Chris Canfield     

              KeepAwake@ChrisCanfield.net
         http://chriscanfield.net/designs.html   



What it is
__________________________________________
       
Keep Awake is a little app that moves your mouse, fooling other 
applications into thinking you're still there.

Useful if you want to check your dinner, but don't want to be 
logged off your game or appear AFK in your chat application.


Instructions
__________________________________________

Run the app, or leave it running in the background.

Pressing Ctrl + Shift + Esc at any point afterwards
will make the mouse move randomly.

Esc again ends the movement.



Extra Details
__________________________________________

So long as you give some credit where due, this script can be modified 
edited altered hijacked or otherwise used for any non-nefarious purposes.

Please use this script wisely.  Don't stay logged in to something all 
weekend when other people are trying to get on.  

This was created with the free / open source app, AutoHotKey.  Head on 
over to http://www.autohotkey.com for the latest version.

For those really curious, I've included the script below which is what
AutoHotKey makes the app from.  It is just a text script, and can be run 
on it's own once you've installed Auto Hot Key.  Just cut out the rest of 
the readme, and rename that file something.ahk

Full Text of the script follows:


__________________________________________

/*   Keep Alive

A simple app to move your mouse around randomly.  
A randomly moving target and a spring constant drive the motion.

*/

#NoEnv
#SingleInstance

CoordMode, Mouse, Screen
SysGet, ScreenXMin, 76
SysGet, ScreenYMin, 77
SysGet, ScreenX, 78
SysGet, ScreenY, 79

ScreenXmax := ScreenXMin + ScreenX
ScreenYmax := ScreenYMin + ScreenY

Gui, Add, Picture,, KeepAwake.jpg
Gui, Color, ABABAB
Gui, Font, s10 bold, Verdana
Gui, Add, Text, Center c263519 w320, Ctrl + Shift + Esc in target application
Gui, Add, Text, Center c263519 w320 Section, to start movement.  Esc again stops.
Gui, Add, Button, w50 xs+25 ys+30, Quit
Gui, Add, Button, w50 xs+250 ys+30, About
Gui, Show, Center, Keep Awake

Loop
{
}

ButtonQuit:
GuiClose:
ExitApp
return

ButtonAbout:
MsgBox, Keep Awake v1.0 (c) Chris Canfield  KeepAwake@chriscanfield.net
return


+^Esc::


AccX = 0
AccY = 0
VelocityX = 0
VelocityY = 0
MouseGetPos, PositionX, PositionY
LastPositionX := PositionX
GoSub, ChangeTarget
InLoop = 1
ChangeTar = 0
SetTimer, ChangeTarget, 4000

Loop
{
	MouseGetPos, PositionX, PositionY
    If InLoop = 0
        break
    AccX := 0.01 * (TargetX - PositionX)
    AccY := 0.01 * (TargetY - PositionY)
    VelocityX := VelocityX + AccX
    VelocityY := VelocityY + AccY
    If (( PositionX + VelocityX < ScreenXMin ) OR (PositionX + VelocityX > ScreenXMax )) ;
        VelocityX := - ( .5 * VelocityX )
    If (( PositionY + VelocityY < ScreenYMin ) OR (PositionY + VelocityY > ScreenYMax )) ;
        VelocityY := - ( .5 * VelocityY )
    PositionX := PositionX + VelocityX
    PositionY := PositionY + VelocityY
    LastPositionX := PositionX
    MouseMove, PositionX, PositionY, 0
    VelocityX := .98 * VelocityX
    VelocityY := .98 * VelocityY    
}
return

ChangeTarget:
Random, TargetX, %ScreenXMin%, %ScreenXMax%
Random, TargetY, %ScreenYMin%, %ScreenYMax%  
return

Esc::InLoop = 0



; --------------------Debut Output Function -------------------------
; Shoves some text into notepad for perusal

DebugOutput( TextBlock )
{
	IfWinNotExist, Untitled - Notepad
	{
    	Run, notepad.exe
		Sleep 1000
	}
	
    WinActivate Untitled - Notepad
    clipboard = %TextBlock%
	Send ^v {Enter}
	
}
}