I solved that last problem. Here is the solution.
int total() {
string s = visit_url("bet.php");
string t=visit_url("storage.php");
if (!usehagnksmeat)
s = substring(s,index_of(s,"Add a Bet:"),index_of(s,"Meat on hand"));
else
s = substring(t,index_of(t,"You...