Jump to content
  • 0

gettime() computation help


jawbreaker

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

Please help me with gettime() computation

 



prontera,143,98,3 script Holiday Event 58,{

if((gettime(6)==8 && (gettime(5)==17 || gettime(5)==18 || gettime(5)==19))==1) {
mes "[Event Manager]";
mes "August 17-19";
mes "Location: My Kitchen";
mes "Come and Join a Party at My Kitchen";
specialeffect EF_SANDMAN;
if (hol_pack==1) {
mes "[This holiday Event]";
mes "You already claimed your package.";
close;
}
set hol_pack,1;
rentitem 5451,86400; //how can i configure remaining time here when they claim at Aug 18, 13:00:00 and Event will end on Aug 19, 23:59:59?
close;
}
mes "[Event Manager]";
mes "No Special Events at the moment";
close;
}

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

So you want to make the rent item to be expired exactly at Aug 19, 23:59:59?

prontera,143,98,3	script	Holiday Event	58,{
if ((gettime(7)==2014 && gettime(6)==8 && (gettime(5)==17 || gettime(5)==18 || gettime(5)==19))==1) {
	mes "[Event Manager]";
	mes "August 17-19";
	mes "Location: My Kitchen";
	mes "Come and Join a Party at My Kitchen";
	specialeffect EF_SANDMAN;
	if (hol_pack==1) {
		mes "[This holiday Event]";
		mes "You already claimed your package.";
		close;
	}
	set hol_pack,1;
	set .@a,1408492799-gettimetick(2);
	rentitem 5451,.@a;
	close;
}
mes "[Event Manager]";
mes "No Special Events at the moment";
close;
} 

Next time, please use the code tag to make your code cleaner and prettier ;)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  68
  • Reputation:   1
  • Joined:  06/21/14
  • Last Seen:  

Thank you for your time helping, how were you able to get "1408492799". ?

set .@a,1408492799-gettimetick(2);
if ((gettime(7)==2014 && gettime(6)==8 && (gettime(5)==17 || gettime(5)==18 || gettime(5)==19))==1) { 

 can we do compute from based on last day of the event in gettime(5)==19?.  I was planning to put all possible event day in the script.


This is what i did, maybe you can help me refine more :D

//===== rAthena Script ======================================= 
//= Holiday Specials
//===== By: ================================================== 
//= tlacson7
//===== Current Version: ===================================== 
//= 1.0 Initial Release
//===== Compatible With: ===================================== 
//= rAthena Project
//===== Description: ========================================= 
//= Info : Give special Rental item with expiration during holidays
//= 2014/08/18: 1.0 Release and fully working. [tlacson7]
//============================================================

prontera,140,98,5	script	Event Organizer	540,{
	if((gettime(6)==8 && (gettime(5)==15 || gettime(5)==16 || gettime(5)==17))==1) {
		mes "[Raja Baguinda Festival]";
		mes "August 15-17";
		mes "Location: Jolo, Sulu";
		mes "A three-day cultural show and festivites commemorating the arrival of Rajah Baguinda who was responsible for the spread of Islam and reinforcing the Sultanate Government in the Sulu Archipelago.";
		specialeffect EF_SANDMAN;
		set .@end,17;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}

	if((gettime(6)==8 && (gettime(5)==22 || gettime(5)==23 || gettime(5)==24))==1) {

		mes "[Kadayawan sa Dabaw]";
		mes "August 22-24";
		mes "Location: Davao City";
		mes "A celebration of the bountiful harvests of fruits and orchids during the season. Activities include fruit and flower show, trade fair, tribal/civic/military parade, traditional sports activities, horsefight, Search for B'yaneng Kadayawan and street dancing.";
		specialeffect EF_SANDMAN;
		set .@end,24;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}

	if((gettime(6)==9 && (gettime(5)==16 || gettime(5)==17 || gettime(5)==18))==1) {
		mes "[T'Boli Tribal Festival]";
		mes "September 16-18";
		mes "Location: Lake Sebu, South Cotabato";
		mes "An annual authentic T'boli tribal festival staged at Lake Sebu. Features tribal rituals that start at early down amidst sounds of gongs and native music, culminating at the town plaza where cultural dances and ethic sports like horsefight are held.";
		specialeffect EF_SANDMAN;
		set .@end,18;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}

	if((gettime(6)==9 && (gettime(5)==19 || gettime(5)==20 || gettime(5)==21))==1) {
		mes "[Feast of Nuestra Senorra Penafrancia]";
		mes "September 19-21";
		mes "Location: Naga City, Camarines Sur";
		mes "A religious festival held in hornor of the Feast of Our Lady of Peñafrancia. Bicol's most revered patrones highlighted by the fluvial procession of the Lady's image down the Bicol river. The week-long-celebration includes civic-military parade, sportsfests, exhibits, cultural shows, beauty pageants and colorful competitions.";
		specialeffect EF_SANDMAN;
		set .@end,21;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}

	if((gettime(6)==10 && (gettime(5)==17 || gettime(5)==18 || gettime(5)==19))==1) {
		mes "[Maskara Festival]";
		mes "October 17-19";
		mes "Location: Bacolod City";
		mes "The biggest annual event that reflects the Bacoleños love for fun and gaiety. Coinciding with Bacolod City's charter day celebration, the festival features sports competitions, cultural programs, carnivals, beauty contest and a long Mardi grasstyle costumed and masked street dancers";
		specialeffect EF_SANDMAN;
		set .@end,19;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}
	if((gettime(6)==10 && (gettime(5)==19 || gettime(5)==20 || gettime(5)==21 || gettime(5)==22))==1) {
		mes "[Ibalong Festival]";
		mes "October 19-22";
		mes "Location: Legaspi City";
		mes "A celebration depicting Bicol's early beginnings as portrayed in the Ibalong epic that tells of super heroes Handiong, Batlog and Oryol and villains and wild animals that roamed in the ancient times. In music and dances, revelers parade on the main streets wearing masks of these heroes and villains. Festival activities include";
		mes "tours, trade fairs, exhibits and beauty pageants.";
		specialeffect EF_SANDMAN;
		set .@end,22;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}
	if((gettime(6)==11 && (gettime(5)==21 || gettime(5)==22 || gettime(5)==23))==1) {
		mes "[Feast of San Clemente/Higantes Festival]";
		mes "November 21-23";
		mes "Location: Angono, Rizal";
		mes "Angono's joyous fiesta in honor of San Clemente whose image, resplendent in papal vestment, is borne by male devotees during a procession accompanied by pahadores (devotees dressed in colorful local costumes, wooden shoes and carrying boat paddles) and higantes (giant paper mache effigies) The street event culminates in a fluvial procession in Laguna de Bay amidst revelry that continues until the image is brought back to its sanctuary.";
		specialeffect EF_SANDMAN;
		set .@end,23;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}

	if((gettime(6)==12 && (gettime(5)==8))==1) {
		mes "[Pagdidiwata]";
		mes "December 8";
		mes "Location: Puerto Princessa, Palawan";
		mes "A thanks giving celebration by the Tagbanua natives of Palawan in ritual dances and food offerings to their deities and souls of departed kin";
		specialeffect EF_SANDMAN;
		set .@end,8;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}
	if((gettime(6)==12 && (gettime(5)==28 || gettime(5)==29 || gettime(5)==30))==1) {
		mes "[Binirayan Festival]";
		mes "December 28-30";
		mes "Location: San Jose, Antique";
		mes "A festive commemoration of an episode in the history of the Filipino race through colorful pageants acted on the beaches of Maybato in San Jose and Malandog in Hamtik. Particularly interesting is the drama of the first Malay settlement at malandog which runs for several days and nights. Binirayan is also an occasion of reunion with families, relatives and friends of homecoming Antiqueno expatriates.";
		specialeffect EF_SANDMAN;
		set .@end,30;
		if (hol_pack==1) {
			close;
		}
		set .@i,((.@end-gettime(5))*60*60*24)+((23-gettime(3))*60*60)+((59-gettime(2))*60);
		set hol_pack,1;
		rentitem 5430,.@i;
		close;
	}
	set hol_pack,0;
	mes "[Event Manager]";
	mes "No Special Events at the moment";
	close;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

What do you mean with

can we do compute from based on last day of the event in gettime(5)==19?

 

Any example?

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...