I was googling around and found out that you can create a short cut to call a specific skype user. All I needed now was to figure out how to get this short cut to open all on its own. I thought I could have an executable run that would open the file, and I remebered a line of code for opening files with C++ from a yahoo question. Now all I needed was to block the file opening line in a never ending loop. I did that but I knew that would create a program that opened the short cut continuously (which doesnt seem like such a bad idea now that I think of it). So, I went looking for the sourcode for a time delay that would cause the open file in to execute only after every certain amount of time. Finally, I ended up with this:
// include insertion symbols
#include stdio.h
#include stdlib.h
#include time.h
void sleep( clock_t wait );
int main( void )
{
long i = 6000000L;
clock_t start, finish;
double duration;
while (true)
{
// Delay for a specified time.
printf( "Delay for 2 minutes\n" );
sleep( (clock_t)120 * CLOCKS_PER_SEC );
printf( "Calling!\n" );
system("C:/calluser.url");
/*the line just above this comment opens the shortcut you have to make. Right click desktop, click new, click short cut, and type in
skype:username?chat
and then press OK or whatever. In the case of my sourcecode, the shortcut's name is calluser with the url extension, but you can name the shortcut whatever you want. My shortcut's location is C:/. Remember to replace "username" with a username on your skype contact list or a number.*/
}
system ("PAUSE"); // unncessary and not reccomended
}
// Pauses for a specified number of milliseconds.
void sleep( clock_t wait )
{
clock_t goal;
goal = wait + clock();
while
( goal > clock() ) ;
}
/*********************************************************
There's potential for more features. I could change some literals into variables that can be changed by the user so I don't have to change the source code and compile every time I want to change the length of the delay. I could also just eliminate the time delay all together so it would execute continuously, but now that I think of this method again, I remember that you get an error message when you try to call someone when you're offline and if I had it do that I'd get a 1000 of those error messages every time I went offline with the auto caller program running, so that's no good. The delay stays! I could add some code that creates the url for you and asks you for the username or number using some stream methods.
**********************************************************/
No comments:
Post a Comment