Sign in to follow this  
Followers 0
HackerZer0

Earthquake Notepad

14 posts in this topic

#1 ·  Posted (edited)

not very usful, but amusing for a minute or 2...

F8 to turn on, and F9 to turn off, close notepad to exit completely

Run("notepad.exe")
HotKeySet("{F9}", "_Idle")
HotKeySet("{F8}", "_Earthquake")

$magnitude = 1

$window = "Untitled - Notepad"

WinWaitActive($window)
$startpos = WinGetPos($window)
_Idle()

Func _Idle()
WinMove($window, "", $startpos[0], $startpos[1])
While 1
Sleep(5000)
$state = WinGetState("Untitled - Notepad", "")
If $state = 0 Then _Exit()
Wend
EndFunc

Func _Earthquake()
While 1
$pos = WinGetPos($window)
$pos[0] = $pos[0] + Random($magnitude*-1, $magnitude, 1)
$pos[1] = $pos[1] + Random($magnitude*-1, $magnitude, 1)
WinMove($window, "", $pos[0], $pos[1])
Wend
EndFunc

Func _Exit()
Exit
EndFunc
Edited by HackerZer0

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

not very usful, but amusing for a minute or 2...

F8 to turn on, and F9 to turn off, close notepad to exit completely

That is fairly entertaining, good job! I would add this though: Actually, I would do it like this:

#NoTrayIcon

Opt("WinTitleMatchMode", 2)

Run("notepad.exe")
HotKeySet("{F9}", "_Idle")
HotKeySet("{F8}", "_Earthquake")

$magnitude = 1

$window = "Notepad"

WinWaitActive($window)
$startpos = WinGetPos($window)
_Idle()

Func _Idle()
    WinMove($window, "", $startpos[0], $startpos[1])
    While 1
        Sleep(5000)
        $state = WinGetState("Notepad", "")
        If $state = 0 Then _Exit()
    Wend
EndFunc

Func _Earthquake()
    While 1
        $pos = WinGetPos($window)
        $pos[0] = $pos[0] + Random($magnitude*-1, $magnitude, 1)
        $pos[1] = $pos[1] + Random($magnitude*-1, $magnitude, 1)
        $startpos = WinGetPos($window)
        WinMove($window, "", $pos[0], $pos[1])
    Wend
EndFunc

Func _Exit()
    Exit
EndFunc

edit: No icon, matches any notepad window (or the first) and leaves it in the last "earthquake" position.

Edited by fisofo

Share this post


Link to post
Share on other sites

Just had another thought... i wonder how this would look combined with your "Ghostpad" script. Heh... kinda appropriate for halloween i suppose.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

edit: No icon, matches any notepad window (or the first) and leaves it in the last "earthquake" position.

but if you let it go to far and the blue bar goes above the desktop height its really annoying to get back, cause then all notepads will open in that position

Edited by HackerZer0

Share this post


Link to post
Share on other sites

but if you let it go to far and the blue bar goes above the desktop height its really annoying to get back, cause then all notepads will open in that position

I believe you can get desktop width somehow, although can't remember offhand... anyway, get that and you can tell the script to just bounce against the side of the screens.

Share this post


Link to post
Share on other sites

Just had another thought... i wonder how this would look combined with your "Ghostpad" script. Heh... kinda appropriate for halloween i suppose.

i thought of that...i may put something together, add a few things...

thx for noticing my work :whistle:

Share this post


Link to post
Share on other sites

You need to add sound.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Very nice script. Here's my version, with sound! Press F8 to Toggle (On|Off).

Edit: Minor bugfix.

Edited by Manadar

Share this post


Link to post
Share on other sites

Something i made a while back

; ----------------------------------------------------------------------------
; Shake Window
; Author:        Death Pax <death_pax@msn.com>
;
; Script Function:
;   Shake Window
;
; ----------------------------------------------------------------------------

#include <GUIConstants.au3>
$Gui_Main = GUICreate("Shake Window", 400, 400)
$Button_Shake = GUICtrlCreateButton("Shake Window", 24, 352, 121, 33, 0)
$Button_Close = GUICtrlCreateButton("Close Window", 256, 352, 121, 33, 0)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $Button_Close
        ExitLoop
    Case $msg = $Button_Shake
        _ShakeWindow($Gui_Main, 5)
    Case Else
;;;;;;;
    EndSelect
WEnd
Exit

Func _ShakeWindow($Window,$ShakeAmount)
    $Win_pos=WinGetPos($Window)
    For $i=0 to 20 step 1
    WinMove($Window,"", $Win_pos[0],$Win_pos[1]+$ShakeAmount)
    Sleep(10)
    WinMove($Window,"", $Win_pos[0]+$ShakeAmount,$Win_pos[1])
    Sleep(10)
    WinMove($Window,"", $Win_pos[0],$Win_pos[1]-$ShakeAmount)
    Sleep(10)
    WinMove($Window,"", $Win_pos[0]-$ShakeAmount,$Win_pos[1])
    Sleep(10)
    WinMove($Window,"", $Win_pos[0],$Win_pos[1])
    Sleep(10)
    next
EndFunc

Share this post


Link to post
Share on other sites

lol this script is quite funny

when you try to close notepad while the thing is shaking and u miss..

:whistle:


Share this post


Link to post
Share on other sites

for my dutch friends , uh , fuck im a nerd i dont have friends ^^

the dutch version :-)

Opt("WinTitleMatchMode", 2)

Run("notepad.exe")
HotKeySet("{F9}", "_Idle")
HotKeySet("{F8}", "_Earthquake")

$magnitude = 1

$window = "Kladblok"

WinWaitActive($window)
$startpos = WinGetPos($window)
_Idle()

Func _Idle()
    WinMove($window, "", $startpos[0], $startpos[1])
    While 1
        Sleep(5000)
        $state = WinGetState("Kladblok", "")
        If $state = 0 Then _Exit()
    Wend
EndFunc

Func _Earthquake()
    While 1
        $pos = WinGetPos($window)
        $pos[0] = $pos[0] + Random($magnitude*-1, $magnitude, 1)
        $pos[1] = $pos[1] + Random($magnitude*-1, $magnitude, 1)
        $startpos = WinGetPos($window)
        WinMove($window, "", $pos[0], $pos[1])
    Wend
EndFunc

Func _Exit()
    Exit
EndFunc

Share this post


Link to post
Share on other sites

lol the only difference is that notepad is in a different name. but i thought windows standadised "NotePad" ? or am i wrong


Share this post


Link to post
Share on other sites

lol the only difference is that notepad is in a different name. but i thought windows standadised "NotePad" ? or am i wrong

nope , we still user kladblok :S i dont care if they call it notepad :whistle:

Share this post


Link to post
Share on other sites

lol ok


Share this post


Link to post
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
Sign in to follow this  
Followers 0