Currently untested but yeah.
prontera,100,100,5 script hourlypoints 139,8,11,{
end;
OnTouch:
dispbottom "Stay here to get afk hourly points.";
attachnpctimer();
startnpctimer();
end;
OnTimer3600000:
getmapxy(.@map$,.@x,.@y,0);
if( distance(.x,.y,.@x,.@y)<=11
&& .@map$==.map$ ) {
if( !@afk ) {
set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt;
dispbottom "You received "+.point_amt+" Kafrapoints by staying afk ingame for 1 hour";
dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints";
set @consecutive_hour, @consecutive_hour + 1;
if(@consecutive_hour == 3) {
set @consecutive_hour,0;
set #KAFRAPOINTS, #KAFRAPOINTS + .cpoint_amt;
dispbottom "You receive "+.cpoint_amt+" Kafrapoints in afking for 3 consecutive hours";
dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints";
}
} else if( @afk>=gettimetick(2) ) {
set #KAFRAPOINTS, #KAFRAPOINTS + .off_point_amt;
set @consecutive_hour, @consecutive_hour + 1;
if(@consecutive_hour == 3) {
set @consecutive_hour,0;
set #KAFRAPOINTS, #KAFRAPOINTS + .coff_point_amt;
}
} else {
stopnpctimer();
set(.@player$, strcharinfo(0));
detachrid;
atcommand "@kick \""+.@player$+"\"";
end;
}
attachnpctimer();
initnpctimer();
} else {
dispbottom "You left the afk area and will no longer receive Kafrapoints.";
stopnpctimer();
}
end;
OnAFK:
set(@afk,1);
atcommand "@afk";
end;
OnInit:
getmapxy(.map$,.x,.y,1);
bindatcmd "afk","hourlypoints::OnAFK";
set .cpoint_amt, 50; //Points gained for consecutive time online.
set .point_amt, 10; //Normal points gained.
set .coff_point_amt, 10; //Points gained for consecutive time offline.
set .off_point_amt, 5; //Normal offline points gained.
}
prontera,0,0,5 script Offline AFK 100,{
set .@npc$, strnpcinfo(1);
mes "["+.@npc$+"]";
mes "Would you like to activate offline afk?";
next;
if(select("Yes:No")==2) {
mes "["+.@npc$+"]";
mes "Alright, maybe next time.";
close;
}
mes "["+.@npc$+"]";
mes "Ok, how long would you like to afk offline?";
next;
set @menu, select(.menu$)-1;
if(Zeny>=.pric[@menu]) {
set(Zeny, Zeny-.pric[@menu]);
mes "["+.@npc$+"]";
mes "See you soon!";
close2;
set(@afk,gettimetick(2)+(.time[@menu]*60));
atcommand "@afk";
} else {
mes "["+.@npc$+"]";
mes "I'm sorry but it seems you don't have enough Zeny for that...";
close2;
}
end;
OnInit:
function t {
function s;
set .@left, getarg(0);
if ( .@left <= 0 ) return getarg(0);
set .@day, .@left / 86400;
set .@hour, .@left % 86400 / 3600;
set .@min, .@left % 3600 / 60;
set .@sec, .@left % 60;
return ( ( .@day ? .@day +" day"+ s( .@day ) : "" ) + ( .@hour ? .@hour +" hour"+ s( .@hour ) : "" ) + ( .@min ? .@min +" min"+ s( .@min ) : "" ) + ( .@sec ? .@sec +" sec"+ s( .@sec,1 ) : "" ) );
function s { return ( ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " ) ); }
}
setarray .time, 10, 30, 60, 120, 240, 480; //In minutes
setarray .pric, 1500, 4400, 8800, 17600 35300, 70000; //In Zeny
set .len, getarraysize(.time);
unitwarp 0,
getvariableofnpc(.map$,"hourlypoints"),
getvariableofnpc(.x,"hourlypoints"),
getvariableofnpc(.y,"hourlypoints")
;
for(set(.@a,0);.@a<.len;set(.@a,.@a+1))
set(.menu$,.menu$+t(.time[.@a]*60)+" for "+.pric[.@a]+" Zeny.:");
}
Variations ( shortcuts ) of the command @afk may be used to abuse this system for example @autotrade ( @at )...
I recommend you add them after...
bindatcmd "afk","hourlypoints::OnAFK";
Like...
bindatcmd "autotrade","hourlypoints::OnAFK";