- script Hourly Points -1,{
OnPCLoginEvent:
while ( !getstatus(SC_JAILED) ) {
if ( checkvending() || checkchatting() || checkidle() >= .sleeploop / 1000 ) {
.@afk++;
if ( .@afk >= .afk && ( .@afk % .afk == 0 ) ) {
dispbottom "[Hourly Points] You were AFK for "+( .@afk * .sleeploop / 1000 )+" seconds. Move around to reset timer.";
.@tick = 0;
}
}
else {
.@afk = 0;
.@tick++;
if ( .@tick >= .tick ) {
dispbottom "[Hourly Points] Congrats! You got 50 SPECs for playing at least an hour!";
getitem 6153,100;
.@tick = 0;
}
}
sleep2 .sleeploop;
}
end; // shouldn't reach
OnInit:
.sleeploop = 5000; // every 5 seconds
.tick = 720; // loop 6 times of 5 seconds == 3600 seconds
.afk = 60; // loop 2 times of 5 seconds = 300 seconds
end;
}