Jump to content
  • 0

May i request auto item giver every hour !


Question

Posted (edited)

hello,

 

 

prontera,155,181,5	script	Sample	718,{
	set .Hour,24;
	if( #dailytimer < gettimetick(2) ) {
		mes "You have Gained a Daily Gift.";
		set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
		getitem 6101,1; //set the price here
	}else{
		set .@last,#dailytimer - gettimetick(2);
		set .@hour, .@last % ( 24 * 3600 ) / 3600;
		set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
		set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
		mes "You have to wait to get your next Daily Gift.";
		mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
	}
	close;
}

 

 
 
c'd you plz edit this script in such a way, Players receive an item every hour as a gift.....
 
 
/thx  a Billion in Advance....
Edited by Capuche
Script in [Code]

23 answers to this question

Recommended Posts

Posted


- script hourlygift -1,{

OnPCLoginEvent:

set .Hour,1;

if( #dailytimer < gettimetick(2) ) {

mes "You have Gained a Hourly Gift.";

set #dailytimer,gettimetick(2) + ( .Hour * 3600 );

getitem 6101,1; //set the price here

}else{

set .@last,#dailytimer - gettimetick(2);

set .@hour, .@last % ( 24 * 3600 ) / 3600;

set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;

set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;

mes "You have to wait to get your next Hourly Gift.";

mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";

}

close;

}

  • 0
Posted (edited)

Hi Anakid, 

 

Will this work to those people that are afk? If possible, I want to use your script but I need a little mod. I wish NOT to give any gift to the players that are on vending, chat, or afk. Is it possible?

Thanks!!!

Edited by geoffreypogi
  • 0
Posted
On 10/28/2013 at 7:50 AM, Patskie said:

Change : 


OnTimer60000:

to : 


OnTimer60000:
if ( checkidle() >= 5 ) end;

Hi Patskie,

 

where should I put this? I want to make sure that those IDLE people won't receive the gift. Thanks! 

Posted

Like this?;

-	script	dailygift	-1,{
set .Hour,24;

OnPCLoginEvent:
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Daily Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Daily Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}
Posted

@Anakid

In your script the player get a gift everyday and A c e S p a d e ask to give a gift every hour.

 

Players receive an item every hour as a gift.....

Automatically or the player must click on the NPC to get the gift ?

Posted

@Anakid

In your script the player get a gift everyday and A c e S p a d e ask to give a gift every hour.

 

Players receive an item every hour as a gift.....

Automatically or the player must click on the NPC to get the gift ?

Every hour automatically, when the player is online...

 

 

 

You can easily change the amount of hour in the script.

May i know how to do that ? Sry i am so noob at programming....Thanks a Billion in Advance...

Posted (edited)

You can only get the gift once every hour. If you relogged; it will only show the delay.

 

set .Hour,1;

dude, the script gives the item every time i login regardless of the timing interval, Plz help....Thanks

Edited by A c e S p a d e
Posted
-	script	hourlygift	-1,{
OnPCLoginEvent:
set .Hour,1;
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Hourly Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Hourly Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}

Perfect  /no1

Posted (edited)

ser can u help me.. because i use this script but not working..? can u help me please

//===== Hourly Points Script =========================================
//===== By: ==========================================================
//= nostafu
//===== Current Version: =============================================
//= 1.3
//===== Compatible With: =============================================
//= Any eAthena Version
//===== Description: =================================================
//= Get Points every successful hours of gameplay, you cannot get
//= the points even if you miss a second or a minute. A player will
//= get a very big bonus if they played 12 hours consecutively
//= or without logging out of the game. If the player is vending
//= the script will then stop.
//====================================================================
- 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 hourly 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 5 Minutes
if(@afk == 10) {
dispbottom "The hourly points event stopped because you were idle for 5 minutes. Please relog if you wish to start again.";
stopnpctimer;
end;
}
end;
OnTimer60000:
set @minute, @minute + 1;
dispbottom "You played "+@minute+" minutes.";
//Check for 1 Minute
if(@minute == 60){
   set @minute,0;
    set .@point_amt, 20; //Points to get every hour (default: 10)
    set #CASHPOINTS, #CASHPOINTS + .@point_amt;
    dispbottom "You received "+.@point_amt+" Cashpoints by staying ingame for 1 hour";
    dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";
set @consecutive_hour, @consecutive_hour + 1;
}
//Check for 12 hours consecutive
if(@consecutive_hour == 12) {
    set @consecutive_hour,0;
    set .@cpoint_amt, 100; //Points to get for 12 Consecutive hours (default: 50)
    set #CASHPOINTS, #CASHPOINTS + .@cpoint_amt;
    dispbottom "You receive "+.@cpoint_amt+" Cashpoints in playing for 12 consecutive hours";
    dispbottom "Current Balance = "+#CASHPOINTS+" Cashpoints";
}
stopnpctimer;
initnpctimer;
end;
}
//--End of the Script

 

 

Any one can edit this script?.. edit the cash point into TCG??? thanks a lot!

Edited by Emistry
changed to code bbcode.
Posted

thankyou so much :) soryy... im new here ^_^ btw thanks again!

@sir emistry

how can i put the amount of the TCG?.. like 1 hr = 100 tcg 

Set the amount :

set .@point_amt, 20; //Points to get every hour (default: 10)
Posted
-	script	hourlygift	-1,{
OnPCLoginEvent:
set .Hour,1;
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Hourly Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Hourly Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}

 

 

even youre afk you will receive the reward right?

Posted

 

-	script	hourlygift	-1,{
OnPCLoginEvent:
set .Hour,1;
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Hourly Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Hourly Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}

 

 

even youre afk you will receive the reward right?

 

it does not have idle check, so yeah.

Posted
-	script	hourlygift	-1,{
OnPCLoginEvent:
set .Hour,1;
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Hourly Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Hourly Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}

 

 

 
what if want to change the system of calculation becomes "how long they are online., if it is recorded in the database for 1hr him online., it will get the prize"

and apply multiples. eg 1hr got 605 items in increments of 1. then if they are online for 3 jam.maka will automatically receive 3item

This script will still run even if the character is not online time

Posted

 

Like this?;

-	script	dailygift	-1,{
set .Hour,24;

OnPCLoginEvent:
if( #dailytimer < gettimetick(2) ) {
mes "You have Gained a Daily Gift.";
set #dailytimer,gettimetick(2) + ( .Hour * 3600 );
getitem 6101,1; //set the price here
}else{
set .@last,#dailytimer - gettimetick(2);
set .@hour, .@last % ( 24 * 3600 ) / 3600;
set .@min, .@last % ( 24 * 3600 ) % 3600 / 60;
set .@sec, .@last % ( 24 * 3600 ) % 3600 % 60;
mes "You have to wait to get your next Daily Gift.";
mes "Time CountDown : ^FF0000"+.@hour+":"+.@min+":"+.@sec+"^000000";
}
close;
}

 

sir anakid, i want to use this script, but i need a little modification,

i want to gift a daily gift for vending character or with command @autotrade

 

can you help me sir..

 

Billion of thanks from newbie

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...