Ok, we can start here then.
I want to return a meat result directly from the bet page. It is much faster than going to the betarchive. I don't know about you, but it takes forever for me to load the archive. I also don't have meat coming in from anywhere else to change the values of this result, so we are safe that way.
If I have done this right, result should return a value of either hagnks or on hand. That is assuming I have understood the functions correctly.
I want to return a meat result directly from the bet page. It is much faster than going to the betarchive. I don't know about you, but it takes forever for me to load the archive. I also don't have meat coming in from anywhere else to change the values of this result, so we are safe that way.
Code:
int total() {
if usehagnksmeat = false {
string s = visit_url("bet.php");
s = substring(s,index_of(s,"You have"),index_of(s,"Meat on hand"));
int result = to_int(s);
}
else {
string s = visit_url("bet.php");
s = substring(s,index_of(s,"hand and"),index_of(s,"Meat in Hagnk's"));
int result = to_int(s);
}
print("Meat available: "+result);
return result;
}
If I have done this right, result should return a value of either hagnks or on hand. That is assuming I have understood the functions correctly.