 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Ace_NoOne
Joined: 10 Oct 2005 Posts: 333 Location: Germany
|
Posted: Thu Mar 02, 2006 9:38 pm Post subject: Shocker |
|
|
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...
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 |
|
 |
Veovis
Joined: 13 Feb 2006 Posts: 390 Location: Utah
|
Posted: Fri Mar 03, 2006 2:33 am Post subject: |
|
|
MWAHAHAHAHAHA
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 |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5382 Location: /b/
|
Posted: Fri Mar 03, 2006 4:10 pm Post subject: |
|
|
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  _________________
 |
|
| Back to top |
|
 |
Ace_NoOne
Joined: 10 Oct 2005 Posts: 333 Location: Germany
|
Posted: Fri Mar 03, 2006 4:12 pm Post subject: |
|
|
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) |
|
| Back to top |
|
 |
Ace_NoOne
Joined: 10 Oct 2005 Posts: 333 Location: Germany
|
Posted: Mon Mar 06, 2006 2:41 pm Post subject: |
|
|
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...  |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|