What's new

Discussion [2313453] Timed Process monitor :)

Z

zy0n

Enthusiast
Messages
900
Reaction score
449
Points
165
Sin$
7
Disclaimer: If you don't know what this can be used for... this code isn't for you :tongue:
Code:
timedPro( pname, waitTime, reset ){

if ( !isDefined( self.isProcess[pname]["active"]) ){
self.isProcess[pname]["start"] = getTime();
self.isProcess[pname]["active"] = true;
self.isProcess[pname]["wait"] = waitTime*1000;
return false;
} else {
if ( ( getTime() - self.isProcess[pname]["start"] ) > self.isProcess[pname]["wait"] ){
if ( isDefined( reset ) && reset ) self thread killTimedPro( pname );
return true;
}
else return false;
}
}

killTimedPro( pname ){
self.isProcess[pname]["active"] = undefined;
}

Usage:
Code:
if ( timedPro( <name>, <wait time> )); //Creates/Monitors process wait time
self thread killTimedPro( <name> ); //Removes the process.

Example Usage Test:

Code:
self thread timerTEST(); //put this onPlayerSpawned();

timerTEST(){

for(;;){
if ( timedPro( "test", 5, true ) ){
self iPrintlnBold("TIMES UP");
wait 2;
}
else self iPrintlnBold( "Still Ticking" );	

wait .2;
}
}
 
Compton Mods

Compton Mods

Enthusiast
Messages
408
Reaction score
85
Points
95
Sin$
0
Good job! :smile:

I'm definitely going to have fun with this!
tongue.gif
 
xVVhiteboy

xVVhiteboy

Contributor
Messages
2,902
Reaction score
663
Points
325
Sin$
0
It'll print Still ticking, till it hits 5 seconds, and then it'll say times up and then restart :smile:
Oh lol, I should have looked harder lol, This will be fun for verification.
 
Andrew74

Andrew74

Enthusiast
Messages
824
Reaction score
219
Points
165
Sin$
7
I'm guessing this is a timer for verification...

If thats the case there is better codes to use for that.
 
Z

zy0n

Enthusiast
Messages
900
Reaction score
449
Points
165
Sin$
7
I'm guessing this is a timer for verification...

If thats the case there is better codes to use for that.

you're guess is wrong... lolz and better codes... haha mr godmode releaser... roflz

This code can be used for a plethora of different things.
 
Andrew74

Andrew74

Enthusiast
Messages
824
Reaction score
219
Points
165
Sin$
7
you're guess is wrong... lolz and better codes... haha mr godmode releaser... roflz

This code can be used for a plethora of different things.

Maybe later I'll release no recoil LOL. =)
 
S

Soup1d

Newbie
Messages
13
Reaction score
0
Points
35
Sin$
0
So i am not sure if im correct, but i think this can be used for.... Im not going to say to respect the OP. But ill PM you. Tell me if im right.
 
MgK

MgK

Enthusiast
Messages
372
Reaction score
113
Points
115
Sin$
0
did u just call me a noob lol, im not the one relesing bulls***,
plus a word of advice take your girl of your sig lol
 
Top Bottom
Login
Register