AutoHotkey Community

It is currently May 27th, 2012, 8:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Shocker
PostPosted: March 2nd, 2006, 10:38 pm 
Offline

Joined: October 10th, 2005, 10:44 am
Posts: 299
Location: Germany
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:

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 March 6th, 2006, 3:38 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2006, 3:33 am 
Offline

Joined: February 13th, 2006, 10:40 pm
Posts: 389
Location: Utah
:twisted: :twisted: :twisted: MWAHAHAHAHAHA :twisted: :twisted: :twisted:

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

_________________
Image
"Power can be given overnight, but responsibility must be taught. Long years go into its making."


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2006, 5:10 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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 :roll:

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2006, 5:12 pm 
Offline

Joined: October 10th, 2005, 10:44 am
Posts: 299
Location: Germany
Thanks for the appreciation. I was kinda amazed by myself when I thought of that file-trigger... ;)

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... :) (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)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 6th, 2006, 3:41 pm 
Offline

Joined: October 10th, 2005, 10:44 am
Posts: 299
Location: Germany
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 :( ). These will automatically be extracted to the compiled EXE's dir when it is run - this makes distribution a little easier... :twisted:


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Aravind, Google Feedfetcher, sks, Stigg and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group