Hack Forums
[Shell] [IDEAS]School Project[IDEAS] - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] [IDEAS]School Project[IDEAS] (/showthread.php?tid=2500097)



[IDEAS]School Project[IDEAS] - cressi97 - May 16, 2012

Hi everyone!

Here's the thing; I'm having a school project where we're supposed to make a timer, counting up to a minute and then making a sound/beep or whatever.

I'm making mine in Batch, so any ideas on what to include, or tips for the design?

Thankful for any help ^^


* - Revo. - May 16, 2012

Is it even possible to make the batch file make a sound from the origin file, idk if its possible to play it straight from CMD, it might have to open a audio file from your dir.

And ooh, if you have the code for the timer can i have it please?


* - darksrc - May 16, 2012

What OS you running on? This'll work on any windows but XP and lower I'm pretty sure

Code
@echo off
::Loop
set /a timer=0
set /a limit=60 ::Amount of seconds you want it to run
:start
cls
echo Time: %timer% seconds
timeout 1 >nul
if %timer% LESS %limit% goto start
::End Loop

CODE STUFF HERE
pause >nul

~Ultim8um 🤝


* - Revo. - May 16, 2012

shit man, im running on Windows Seven :(


* - evol - May 16, 2012

To set the beep you need to open a cmd window and type..
Code
echo @echo Alt+7>beep.bat

The catch here is you use the Alt key and 7 with Num Lock key pressed on the numeric keypad and not the regular keyboard.

This will now create a beep.bat run it and see. :)


* - cressi97 - May 16, 2012

Thanks for the ideas everyone, especially 'bout the beep and code suggestion (pretty much the only ones I've gotten so far, though)...

I'll post the code when I'm done and see what you think, hopefully it's OK ^^


* - evol - May 16, 2012

(May 16, 2012 03:41 AM)Revo. Wrote:  shit man, im running on Windows Seven :(

Are you trying to run edit.com, you could try Vim ?


* - Toblerone - May 16, 2012

how about making the timer count down to whatever you want then restarting and asking again maybe a graphical (you know what i mean) countdown


* - White Light - May 16, 2012

To make it beep, do this:
1. Open the command prompt, and type "echo "
2. Push CTRL+G. It should show up as ^G.
3. Type " > temp.bat" and hit enter.
4. Type "notepad temp.bat"

The window should have a little box in the window, in front of it put "echo. "

Running that code will cause your computer to beep.


* - CardinalOfOne - May 16, 2012

Use the built in "timeout" function to get an accurate second count....


* - XxXTIMMYMANXxX - May 17, 2012

(May 16, 2012 12:21 PM)White Fang Wrote:  To make it beep, do this:
1. Open the command prompt, and type "echo "
2. Push CTRL+G. It should show up as ^G.
3. Type " > temp.bat" and hit enter.
4. Type "notepad temp.bat"

The window should have a little box in the window, in front of it put "echo. "

Running that code will cause your computer to beep.

That's actually really handy!
Would +1 you for that if I could.

If you're really that dumb and couldn't follow his instructions, here's the end result:
Beeping batch file

or

Beeping batch file (link 2)