viewing paste topic/4070- hourly point giver | Athena

Posted on the | Last edited on
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  kfbdskfsdkf -1,{
OnPCLoginEvent:
    while ( !getstatus(SC_JAILED) ) {
        if ( checkvending() || checkchatting() || checkidle() >= .sleeploop / 1000 ) {
            .@afk++;
            if ( .@afk >= .afk && ( .@afk % .afk == 0 ) ) {
                dispbottom "you have afk for "+( .@afk * .sleeploop / 1000 )+" seconds";
                .@tick = 0;
            }
        }
        else {
            .@afk = 0;
            .@tick++;
            if ( .@tick >= .tick ) {
                dispbottom "You have earn 1 red potion by active for more than "+( .@tick * .sleeploop / 1000 )+" seconds";
                getitem 501,1;
                .@tick = 0;
            }
        }
        sleep2 .sleeploop;
    }
    end; // shouldn't reach
OnInit:
    .sleeploop = 5000; // every 5 seconds
    .tick = 6; // loop 6 times of 5 seconds == 30 seconds
    .afk = 2; // loop 2 times of 5 seconds = 10 seconds
    end;
}
Viewed 1723 times, submitted by AnnieRuru.