// By GorthexTiger
- script hourlypoints -1,{
//--Start of the Script
OnPCLoginEvent:
attachnpctimer ""+strcharinfo(0)+"";
initnpctimer;
end;
OnTimer30000:
//Check if Vending (normal or @at)
if(checkvending() >= 1 || checkchatting() == 1) {
dispbottom "The Ragnarok Online hourly cash points event stopped because you were vending / chatting. Please relog if you wish to start again.";
stopnpctimer;
end;
}
//Check if Idle
getmapxy( .@map$, .@x, .@y, 0 );
if(@map$ == .@map$ && @x == .@x && @y == .@y) {
set @afk, @afk + 1;
}
//If move timer resets
else {
set @afk, 0;
}
set @map$, .@map$; set @x, .@x; set @y, .@y;
//Idle Check for 10 Minutes
if(@afk == 10) {
dispbottom "The Ragnarok hourly points event stopped because you were idle for 5 minutes. Please relog if you wish to start again.";
stopnpctimer;
end;
}
end;
OnTimer60000:
set @min_check,@min_check + 1; // For checking minutes in-game.
set @minute, @minute + 1;
//Check for 1 Minute
if(@minute == 60){
set @minute,0;
set .@amount, 10; //Points to get every hour (default: 10)
set .@reward, 7227; //Change the "7227" into any item ID you wish them to receive. Use "set" instead of "getitem" if you want to set a variable for it like #CASHPOINTS, #KAFRAPOINTS, or any custom variable.
getitem .@reward,.@amount;
dispbottom "You received 10 TCG Cards by staying in-game for 1 hour";
dispbottom "You've been online for "+@min_check+" minutes."; // Displays the corresponding minutes online. Doesn't reset.
set @consecutive_hour, @consecutive_hour + 1;
}
stopnpctimer;
initnpctimer;
end;
}
//--End of the Script
Credits to GorthexTiger for this Hourly Points Script and I only modified a few lines.
This part displays the corresponding minutes you are online and doesn't resets every after 1 hour :
dispbottom "You've been online for "+@min_check+" minutes."; // Displays the corresponding minutes online. Doesn't reset.
As you can see, I added a minute check at this script :
set @min_check,@min_check + 1; // For checking minutes in-game.
So if you have been online for 2 hours, it'll display on the player's chat box as "You've been online for 120 minutes."
Just edit the value of .@amount for the amount to be given and the .@reward for the item name ID if you want them to receive :
set .@amount, 10; //Points to get every hour (default: 10)
set .@reward, 7227; //Change the "7227" into any item ID you wish them to receive. Use "set" instead of "getitem" if you want to set a variable for it like #CASHPOINTS, #KAFRAPOINTS, or any custom variable.
getitem .@reward,.@amount;
If you want to set a variable for it like Cash Points, edit the part "getitem" to "set" and edit the variable to be used at .@reward:
For example, I want them to receive 10 Cash Points every hour so the script should be like this instead of the one above :
set .@amount, 10; //Points to get every hour (default: 10)
set .@reward, #CASHPOINTS;
set .@reward,.@amount;
Hope I helped... Please don't forget to click the Green UP Button on the lower right of my comment if I helped. Thanks