• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Trying to implement something to happen every 1 to 3 minutes...

Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
I am trying to set this up so that it will repeat the text "You character is still AFK" anywhere from 1 minute to 3 minutes consistently. I can get it to repeat itself but, it is constantly and not allowing any breaks in between. My kidney failure is really screwing with me because it should be so simple to do but, I can't focus. My ultimate goal is to change this so that it will be a keep alive system in game because it is always disconnecting after leaving the client opened and not doing anything with for a while. It is quite frustrating. Can someone offer a hand with this? Thank you.



CUser * pUser = ((CUser*)this);
int i = 1;<< This should represent minutes
if(IsAfk() && GetTickCount() - pUser->m_dwLastWalkTick >= MIN( i++ ))//Set timer based on each minute or 2 or etc...Right now it is popping up constantly instead of doing it only once a minute
{
g_UserMng.UpdateAfkState(pUser);
pUser->AddText("You character is still AFK.");
return;
}

if( GetTickCount() - pUser->m_dwLastWalkTick >= MIN( 1 ) ) //hier wird die Zeit eingestellt!
{
if(!IsAfk())
{
m_bAfk = TRUE;
g_UserMng.UpdateAfkState(pUser);
pUser->AddText("You will now be displayed as AFK.");
}
}
 
Back
Top