viewing paste Unknown #16130 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
-   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;
}
Viewed 602 times, submitted by Guest.