my_closetmeat()

martialis

New member
I saw this function on the wiki, but I can't make it work. What am I doing wrong? Does it actually exist?
Is there a way to get meat in hagnks?
 

lostcalpolydude

Developer
Staff member
Does it actually exist?

The way you check for this is to use the ashref command on the CLI ("ashref closet" shows a few results, and this is not one of them), which indicates that it does not exist in this case.

I think you have to use the browser to get meat out of hagnk's.
 

matt.chugg

Moderator
The function is still listed in the wiki nonetheless and I can't get it to work either.

You can use visit_url to read your closet and parse out the meat unless one of the devs or one of the more experiences scripters suggests otherwise you can use this: note this causes a server hit to check, so you should store the result unless you specifically need to refresh it etc etc

I'm not in ronin so can't check hagnks but the procedure is basically the same as below.

Code:
int my_closet_meat() {
	string closet = visit_url('closet.php');
	string closetmeat = substring(closet, index_of(closet,"contains "), index_of(closet," meat"));
	return to_int(closetmeat);
}

print("my_meat --> " + my_meat());
print("my_closet_meat --> " + my_closet_meat());
 
Top