Detect holidays in ASH?

Azrane

New member
I've tried searching for a way to do this but haven't been able to find anything.

I would like to alter my scripts to detect whether it's a holiday so I can do specific things during said holiday, but I don't know if there's a way to do so. Is there a certain function I could call on? If not, would using visit_url(main.php) and contains_text() work?
 

DerDrongo

Member
I dont think there is a holiday function (there is a stat day function) so i just use visit_url
Code:
	string html = visit_url("main.php");
	if (contains_text(html, "Festival of Jarlsberg")) {
		cli_execute("holiday Festival of Jarlsberg");
	}
	if (contains_text(html, "Feast of Boris")) {
		cli_execute("holiday Feast of Boris");
	}
	if (contains_text(html, "Oyster Egg Day")) {
		if (available_amount($item[oyster basket]) == 0) {
			cli_execute("buy 1 oyster basket");
		}
	}
the cli command holiday is used to force holiday detection it cant be used to find out what holidays are today
 

matt.chugg

Moderator
is there a way for ash to get the output of a cli command? I don't think there is :(

the cli command 'moon' gives you the information, but I can't figure out a way to get this information to ash
 

matt.chugg

Moderator
hmm somewhat oddly, mafia's moon function says June 29, 2009 - Martinus 4

however the wiki says, martinus 5, as does the no calendar, as does kol itself, wonder why its a day out!
 

Bale

Minion
Sometimes that happens if you log on just after rollover. It should fix itself if you log out, then back in again.
 
Top