timer :D
By: a guest | Sep 2nd, 2010 | Syntax:
C | Size: 1.64 KB | Hits: 19 | Expires: Never
/* :D :D Test code for kittieh :D :D *\
/*----------------------------------------------------------------------*\
/*-one button which enables and disables a timer event *\
/*-the timer event itself, which just keeps echoing an embarassing fact.*\
/************************************************************************\
/* ADD THE FOLLOWING UNDER YOUR INCLUDES */
bool test_function = false;
#define TID_TESTFUNCTION 1337
//code is easier to read if we dont have to write the id manually in the code
//TID is an abbreiviation of my own making (Timer ID)
/*END*/
void CCheatzDlg::OnTimer(UINT nIDEvent) //Not sure how this function has to be added, so back up your project before you start trying!
//either somewhere in the dialog interface, or you just add it manually
if (test_function&&nIDEvent==#TID_TESTFUNCTION) { //check if 1) test_function is true and 2) if the right timer was triggered
j2.TSFEcho("Shelly likes tentacle porn :-D<-`<");
}
CDialog::OnTimer(nIDEvent); //Not sure what this was, but it was in my code
{
void CCheatzDlg::Ontest_function() //CREATE THIS FUNCTION AS A BUTTON
{
if (!test_function) { //if test_function isn't on yet, we turn it on
Jazz2 j2;
SetTimer(TID_TESTFUNCTION,1,0);
test_function=true;
j2.TSFEcho("The timer should now be turned on");
}
else { //if test_function is already on, we turn it off
j2.TSFEcho("The timer should now be turned off (to do!)");
test_function=false;
//I don't know if the timer needs to be turned off somehow with a command. Should ask jam! :D
}
}