Questions about mafia info tracking

StDoodle

Minion
Hi, me again, bugging those in the know! ;)

I'm looking to find out if there are ways in mafia to get answers to the following questions, short of using "visit_url()."

1) Daily uses of the zap wand. I can see whether or not it's been obtained this ascension, but can't find any info on # of zaps.

2) PvP. I don't PvP at all, so I know nothing of the subject. Is there a way to determine fights use for the day? Hard to search for, as "PvP" is too short for the forum's built-in search, google returns data overload, and I don't know the terminology well enough to search for any user_pref (searching "pvp" found nothing).

Also, it'd be really neat to have access to the info from the modifier maximizer in ash, though I totally don't expect to see that soon. Huge project and all (and appreciated). Just asking for the sake of others who have requested an add to my customdaily script.

Thanks everyone!
 

Bale

Minion
1) For the wand, I use something like this:
Code:
void daily_zap() {
	boolean zappp(item whatsit) {
		if (item_amount(whatsit) == 0) return false;
		cli_execute("zap 1 "+whatsit);
		return true;
	}

	print("Looking to zap...");
	int whichwand = 0;
	for i from 1268 to 1272
		if(item_amount(to_item(i)) > 0) whichwand = i;
	switch {
	case whichwand == 0:
		print("You don't have a wand.", "olive");
		break;
	case contains_text(visit_url("wand.php?whichwand="+whichwand),"feels warm"):
		print("Already zapped today. Afraid of Kabloo-ey!", "red");
		break;
	case zappp($item[green-frosted astral cupcake]):
	case zappp($item[orange-frosted astral cupcake]):
	case zappp($item[purple-frosted astral cupcake]):
	case zappp($item[33398 scroll]):
	case zappp($item[ring of aggravate]):
		break;
	default:
		print("You have nothing more to zap.", "olive");
	}
}
Feel free to scavenge as much of that as you like. I stole a good bit of it from zarqon.

2) Sorry, but I answer anything about PvP, although I know Veracity just added a lot of PvP commands for CLI. Sadly there don't seem to be any ash commands for that.
 

lostcalpolydude

Developer
Staff member
I just read through the PvpRequest.java code, and played with the Flower Hunter window on a throwaway character (people pvp for real?), and it looks like mafia has to load the page every time to see how many fights you have left (even if you just close and reopen the window). If mafia has to hit the server every time, then you'll have to hit the server.

To maybe save you some effort, mafia uses "You may participate in (\\d+) more player fights today" to find the value.
 

StDoodle

Minion
1) For the wand, I use something like this:
[codehere]
Feel free to scavenge as much of that as you like. I stole a good bit of it from zarqon.

Thanks, that should save a decent amount of time. It's pretty much exactly what I planned to do, myself, but thought it would be worth checking just in case. (I like to avoid using visit_url() if possible; is this crazy, or good practice?)

I just read through the PvpRequest.java code...
To maybe save you some effort, mafia uses "You may participate in (\\d+) more player fights today" to find the value.

Feeling bold, I checked the results of visit_url("pvp.php") with my character; my hippy stone is still intact! (I was more worried about what KoL might do than what mafia would do, TBH.)

Seeing as testing won't put my oh-so-sensitive character in jeopardy, that information helps immensely, thanks!

However, I'm still saying "NO" to the request to check all available equipment to see if you've got your max +rollover adv. gear on; that just seems like WAY too much work, without access to the maximizer via ash. (Which, again, I don't expect to see for a while.)
 

StDoodle

Minion
Actually, I've decided to write a completely separate logout script designed for the same people who posted the original "Daily Deeds - like" request that should take care of things (and includes cli_execute("maximize adv -familiar"), so thanks for that (I'd missed the "-familiar" parameter).
 
Top