Need a "timer" program that counts down....

Mayh3m's Avatar, Join Date: May 2006
Newbie Member
Hi, first of all let me say that Im an idiot and I know nothing about programming anything more than the most rudimentary HTML.

However, it seems logical that the program I have in mind wouldnt be longer than 10 lines of code max. The problem is I dont know what those 10 lines of code are or how I would go about compiling them...

What Im looking to do is create a "spawn timer" for Battlefield 2 MC that would alert me with an auditory alarm every 14 seconds.

The reason behind this is that there is an ongoing "spawn timer" on BF2 servers. Every 14 seconds, whoever is dead will be allowed to respawn. The counter starts as soon as the game starts and cylces over and over until the end of the game.

Thus, if I simply synchronise my program timer with the servers, I should be able to "hear" when people are going to be spawning in around me and be ready for them.

The specifics: A program that has a start button, a visible 14 second cyclical countdown timer which plays "spawnimminent.wav" on 02.00 seconds and then resets after reaching 00.00 seconds.

Im not sure if you guys take program requests or not, but this seems like such an easy thing that it would take you geniuses about 14 seconds to create it =P. Also, I'm willing to tip whoever does this 5 bucks or so via paypal.

Thanks!
0
Aztec's Avatar, Join Date: May 2006
Contributor
This might give you a hint
Code:
#include<ctime>
#include<iostream>

int main()
{

	time_t t1=time(0);
	time_t t2=time(0);
	while(difftime(t2,t1)!=14)
		{
			std::cout<<"hello";
			t2=time(0);
		}
	return 0;
}
0
Mayh3m's Avatar, Join Date: May 2006
Newbie Member
Ah, Thanks! I have no idea what program to use to compile that, but its a damn good start.
Thanks for taking the time to respond!
0
Aztec's Avatar, Join Date: May 2006
Contributor
Quote:
Originally Posted by Mayh3m
I have no idea what program to use to compile that, but its a damn good start.
It's a C++ code. So, it's pretty obvious you need a C++ compiler. You can download DEV C++.