0

Alright friends, I'm trying to make a joke script which will open and won't close. The windows will flash colors and say "Hacked!" over and over. However, I believe this can be improved upon. I would like to make it so that it cannot be closed via the X button but can be closed when a password is typed in. Here is the code I am currently using. Any help would be appreciated :). Thanks!

 @echo off
title Hacks Enabled!!

color a
:loop
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 1a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 2a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 3a 
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 4a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 5a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 6a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 7a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
color 8a
echo %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
goto loop
Hasteify
  • 63
  • 4
  • 1
    Dirty. You could set up communication between a minimized or hidden master script and a visible slave. Have the slave create a [lock file](http://stackoverflow.com/a/27756667/1683264). Put the master in a loop. On each loop iteration, if the master can write to the lock file, make it re-launch the slave. Listening for the password while repeatedly echoing might be tricky though. Perhaps `choice` commands in sequence with a timeout? I'm not going to write it for you, though. – rojo Mar 05 '15 at 16:58
  • Not sure if it'd work but what about making it into a function then adding an exit trap that calls the function? – Holloway Mar 06 '15 at 09:11

1 Answers1

0

This isn't solution but a little clearer.

@ECHO OFF
TITLE Hacks Enabled!!
SET currColor=0

:loop
ECHO %random% hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O hacked!!! :O 
COLOR %currColor%a
PING localhost -n 1 > NUL
IF %currColor% EQU 8 (SET currColor=0) ELSE (SET /a currColor+=1)
GOTO loop
Elad
  • 1,114
  • 8
  • 15