Jump to content
  • 0

Hourly Rewards Version 2


NexusXVI

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

Hi guys :D

Can you make an "hourly reward" script that can only work in a certain "rectangular coordinates" on a "certain map"?

So that players will only get a reward if he/she AFKed in that certain(rectangular) spot only. :D

It's like a resting zone. where using @afk will literaly generate rewards

06d70c71-abfa-42fd-bb36-edf729ae8ca4_zps


BUMP!

Edited by NexusXVI
Link to comment
Share on other sites

20 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

I really don't know much about the @afk command I also don't know if the players can even be called while in that state 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( checkidle() ) {
			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;

			//Check for 3 hours consecutive
			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";
			}
		}
		attachnpctimer();
		initnpctimer();
	} else {
		dispbottom "You left the afk area and will no longer receive Kafrapoints.";
		stopnpctimer();
	}
	end;

OnInit:
	getmapxy(.map$,.x,.y,1);
	set .cpoint_amt, 50; //Points gained for consecutive time online.
	set .point_amt, 10; //Normal points gained.
}
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

Are you going to have multiple of these? It would probably be best to use OnTouch: when doing something like this and just setting the npc in the center of the square with a radius of how ever many squares but that all depends on how big you wanted the area and how many of them.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

Are you going to have multiple of these? It would probably be best to use OnTouch: when doing something like this and just setting the npc in the center of the square with a radius of how ever many squares but that all depends on how big you wanted the area and how many of them.

Ok !! atleast someone saw my post xD

A single rectangular 8x11 tile would do, or you can just modify the field by using the same princple the permanent monster spawn do, by putting the coordinates manualy on how wide the NPC can create (if possible).

the idea of having an NPC on the center is great Skorm players can choose how long (in minutes) they wanted to afk, by paying an Item or Zeny and at the same time gaining points on how long they afked (per minute). And maybe they can resume playing anytime they want.

 

Edited by NexusXVI
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

 

I really don't know much about the @afk command I also don't know if the players can even be called while in that state 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( checkidle() ) {
			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;

			//Check for 3 hours consecutive
			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";
			}
		}
	}
	attachnpctimer();
	initnpctimer();
	end;

OnInit:
	getmapxy(.map$,.x,.y,1);
	set .cpoint_amt, 50; //Points gained for consecutive time online.
	set .point_amt, 10; //Normal points gained.
}

I'll test this right away skorm

================================================================

================================================================

 

Your script works /no1 /no1 /no1 !!

Just added a couple of corner signs so that the player can see where they can rest upon. /pat /pat

Questions :

1. Expanding the zone would make the rectangle larger from left to right or right to left??

 

2 . What does the highlighted number means?  ( prontera,100,100,5    script    hourlypoints    139,8,11, ) it's the npc sprite my god!! X.X

 

3. If you want the reward to be an item of a kind ill just change "set .cpoint_amt" to "getitem" ??

 

Complementations :

The script worked well and clean :D nice job  !

Super easy to modify !

Suggestions :

Add your signature on this script and make it officially yours.. I don't know if anyone had this or made this before.

 

screenShadowRO066_zps43f56bb0.jpg

Edited by NexusXVI
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

Questions :

1. Expanding the zone would make the rectangle larger from left to right or right to left??

 

3. If you want the reward to be an item of a kind ill just change "set .cpoint_amt" to "getitem" ??

 

Complementations :

The script worked well and clean :D nice job  !

Super easy to modify !

 

 

It's the distance in x and y from the npc so 8+ and - on the x axis and 11+ and - on the y axis... Also

 

Changing:

set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt;

To:

getitem(501,1);

Will work for items and Thank you.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

Thanks for the info again :D

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  02/21/14
  • Last Seen:  

How to make it for exp gain?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

How to make it for exp gain?

 

Same as the item change above but use...

getexp <base xp>,<job xp>;

Where <base xp> and <job xp> can be omitted for the respected values...

 

Ex:

getexp 1000,1000;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  02/21/14
  • Last Seen:  

Thank you, great script ^^

 

So if member use @afk still have bonus?

Edited by dungpt8782
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  117
  • Topics Per Day:  0.03
  • Content Count:  312
  • Reputation:   34
  • Joined:  10/15/12
  • Last Seen:  

can

 

 

I really don't know much about the @afk command I also don't know if the players can even be called while in that state 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( checkidle() ) {
			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;

			//Check for 3 hours consecutive
			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";
			}
		}
	}
	attachnpctimer();
	initnpctimer();
	end;

OnInit:
	getmapxy(.map$,.x,.y,1);
	set .cpoint_amt, 50; //Points gained for consecutive time online.
	set .point_amt, 10; //Normal points gained.
}

 

 

may i request for a dispbottom when the player leaves the AFK zone :D that would be better

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

can

 

may i request for a dispbottom when the player leaves the AFK zone :D that would be better

 

Yeah I modified the post above.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

Can you further modify the Script??

Add a menu for how long the player will afk and use the @autotrade command (@afk) and log out..

*They can choose how long and pay for a price.
*Still the AFK zone will be enabled for online afk but offline afk on the other hand will have a little less reward.
*After the time expires the character completely logs out

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

Can you further modify the Script??

Add a menu for how long the player will afk and use the @autotrade command (@afk) and log out..

*They can choose how long and pay for a price.

*Still the AFK zone will be enabled for online afk but offline afk on the other hand will have a little less reward.

*After the time expires the character completely logs out

 

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";
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

 

Can you further modify the Script??

Add a menu for how long the player will afk and use the @autotrade command (@afk) and log out..

*They can choose how long and pay for a price.

*Still the AFK zone will be enabled for online afk but offline afk on the other hand will have a little less reward.

*After the time expires the character completely logs out

 

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";

Where should I add it?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Where should I add it?

 

I recommend you add them after...

bindatcmd "afk","hourlypoints::OnAFK";

Like...

bindatcmd "autotrade","hourlypoints::OnAFK";

post-5984-0-68621000-1397905868_thumb.jpg           /no1

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

@Capuche

Lol ddn't understand that !!

@Skorm

Is it possible to restrict a certain map to use a specific @command since im only using it on 1 map i'll just restrict them from using @afk and @at(autotrade) in that map for certainty that they cannot abuse the script itself

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

 

Can you further modify the Script??

Add a menu for how long the player will afk and use the @autotrade command (@afk) and log out..

*They can choose how long and pay for a price.

*Still the AFK zone will be enabled for online afk but offline afk on the other hand will have a little less reward.

*After the time expires the character completely logs out

 

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";

I've read some topics and the wiki and found out that binatcmdam disables a certain atcommand but I've tested it and removed the @afk command on the group.conf and because of bindatcmd "afk","hourlypoints::OnAFK"; they can still use the command, as last resort I removed bindatcmd "afk","hourlypoints::OnAFK"; on the script and now they can't use @afk

But still im having a problem with @autotrade

I referred to this topic : http://rathena.org/board/topic/70006-disable-specific-commands-in-a-map/

 

and added this script 

 

-	script	nocommand	-1,{
OnInit:
	bindatcmd("autotrade","nocommand::OnAtcommand");
	end;
OnAtcommand:
    if( strcharinfo(3) == "louyang" ) end;
    atcommand "@autotrade";
    end;

but still they  can use the @autotrade command inside the afk zone.. can you further enlighten me :D.

I just want to disable the @autotrade on my main town which is louyang. :D

Edited by NexusXVI
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.01
  • Content Count:  227
  • Reputation:   6
  • Joined:  01/18/12
  • Last Seen:  

One last thing  :D

Can you re edit the script so that it'll use player timer not npctimer :D thnx!!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  02/21/14
  • Last Seen:  

How can i make this script to get random item (in array) per hour?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

How can i make this script to get random item (in array) per hour?

 

After OnInit:

Make an array with item ids like:

setarray .items, 501, 502, 503, 504, 506;

Then replace or add...

getitem(.items[rand(getarraysize(.items))],1);

After the script says...

set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...