AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Shocker

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Ace_NoOne



Joined: 10 Oct 2005
Posts: 333
Location: Germany

PostPosted: Thu Mar 02, 2006 9:38 pm    Post subject: Shocker Reply with quote

I just wrote this little script to play a prank on my brother.
It's kinda wicked, so beware - I take no responsibility for any damage caused to your relatives, friends or anyone else... Twisted Evil

My bro was sitting on the laptop downstairs, so I needed something I could remotely control through the network - which left me with a file as trigger, as that's the only thing I can really control on the other end of the network.

The following script continually checks whether the trigger file exists, and if it does, it starts the "shocking procedure". This basically imitates the various internet pranks of this kind; a flashing image accompanied by a scary sound.

Again, this is nothing for edgy, jittery people, as they might actually get a heart attack. So be careful and, please, don't abuse it!

Code:
/*
ToDo:
- change image and/or sound with each iteration
- option to un-mute (potentially harmful?)
*/

#SingleInstance Force
#Persistent
#NoTrayIcon
OnExit, quit

shockImage = shock.jpg ; http://www.davidbyrne.com/journal/images/2005/06_20_05_a_chimeras.jpg
shockSound = shock.wav ; http://medialab.it.fht-esslingen.de/ftp/multimedia-files/sound/Effekte/Verschiedene/SCREAM.WAV
shockTrigger = shock.txt
startDelay = 60000 ; 60 seconds
flashDelay = 250 ; 0.25 seconds
checkDelay = 10000 ; 10 seconds
flashCount = 3 ; flash 3 times
maxVolume = 100 ; 100%

; include trigger and media files in the compiled script
FileInstall, shock.txt, %shockTrigger%.inactive
FileInstall, shock.jpg, %shockImage%
FileInstall, shock.wav, %shockSound%

; wait before starting the procedure
Sleep, %startDelay%
; continuously check the trigger
SetTimer, checkTrigger, %checkDelay%
; end of auto-execute section
Return

; check for trigger
checkTrigger:
   IfExist, %shockTrigger%
   {
      ; stop checking for trigger
      setTimer, checkTrigger, off
      ; activate shocking procedure
      GoSub, shock
   }
Return

; activate shocking procedure
shock:
   ; backup volume
   SoundGet, volumeBackup
   ; set max. volume
   SoundSet, %maxVolume%
   ; flash an image and play an accompanying sound
   Loop, %flashCount%
   {
      SplashImage, %shockImage%, B
      SoundPlay, %shockSound%
      Sleep, %flashDelay%
      SplashImage, off
   }
   ; terminate script
   GoSub, quit
Return

; terminate script
quit:
   ; restore volume
   SoundSet, %volumeBackup%
   ; terminate script
   ExitApp
Return


updated 2006-03-06


Last edited by Ace_NoOne on Mon Mar 06, 2006 2:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
Veovis



Joined: 13 Feb 2006
Posts: 390
Location: Utah

PostPosted: Fri Mar 03, 2006 2:33 am    Post subject: Reply with quote

Twisted Evil Twisted Evil Twisted Evil MWAHAHAHAHAHA Twisted Evil Twisted Evil Twisted Evil

I like the way you did the network file drop and the IfExist together. Very smart!
Hmmmm....At my school all instant messengers are disabled (ports blocked) but, this gives me an idea... I wonder if you could send files over the network, and using IfExists and FileReads and a GUI to make an AHK-Messenger
_________________

"Power can be given overnight, but responsibility must be taught. Long years go into its making."
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5382
Location: /b/

PostPosted: Fri Mar 03, 2006 4:10 pm    Post subject: Reply with quote

Someone sent me a flash prank once (some one about subliminal messages). I got so scared I almost fainted... for that reason I would not even try this script Rolling Eyes
_________________

Back to top
View user's profile Send private message Visit poster's website
Ace_NoOne



Joined: 10 Oct 2005
Posts: 333
Location: Germany

PostPosted: Fri Mar 03, 2006 4:12 pm    Post subject: Reply with quote

Thanks for the appreciation. I was kinda amazed by myself when I thought of that file-trigger... Wink

Still, I have yet to fine-tune the timing of the flashing; 250 ms seems a little too quick, and also the scream sound is cut off too early.
I couldn't test it on my brother yet though (wasn't quick enough with the coding; he left before I could finish the script) - but it already scared another 'test subject', even though she was semi-prepared!

UPDATE:
Titan replied at the same time as I did - I hate it when that happens...
Anyways, Titan, that's exactly the kind of prank I had in mind when creating this script... Smile (There are a number of videos on eBaum's World showing people get scared to death by such pranks - e.g. this one or this here)
Back to top
View user's profile Send private message
Ace_NoOne



Joined: 10 Oct 2005
Posts: 333
Location: Germany

PostPosted: Mon Mar 06, 2006 2:41 pm    Post subject: Reply with quote

Thanks to PhiLho, I now know how to include the media files in the compiled script, and have updated the code accordingly.
When compiling the script, there have to be three files in the working dir: shock.txt, shock.jpg and shock.wav (the FileInstall command doesn't allow variables as sources Sad ). These will automatically be extracted to the compiled EXE's dir when it is run - this makes distribution a little easier... Twisted Evil
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group