Access to TNP

dalgar

New member
I wanted to know if there was a way to put tnp (ie. To Next Point of stat) into a variable so that I could use it in a script.

I want to know if eating/drinking will bring me up to the next stat point.

I know that "conditions add x moxie" will show the variable I am looking for, but don't know how to access it.

Any help is appreciated.

Thanks.

Dalgar.
 
Up till now the info wasn't available. Since Holatuwol allowed scripting of stat days, my reasons for not releasing the code for public view is no longer valid. I had to re-write it because I lost all my scripts in a hard drive crash, but I've been using a script like this for a while now to log info about my character.

Code:
int substats_needed_to_level()
{
string html = visit_url("charpane.php");
int start = index_of(html, "table title=") + 13;
int end = index_of(html, " cellpadding=0") -1;
if(start == 12 || index_of(html, "Muscle") <= start)
  {
  cli_execute("abort You must have The Level Progress bar enabled on your account menu to use this script.");
  }
string test = substring(html, start, end);
end = index_of(test, " / ");
return string_to_int(substring(test, 0, end));
}

int tnp(stat query)
{
string html = visit_url("charpane.php");
html = substring(html, index_of(html, query), length(html));

int start = index_of(html, "table title=") + 13;
int end = index_of(html, " cellpadding=0") -1;
string test = substring(html, start, end);

end = index_of(test, " / ");
int a = string_to_int(substring(test, 0, end));
int b = string_to_int(substring(test, end + 3, length(test)));

return b - a;
}

void main()
{
print("Primary substats needed for next level: " + substats_needed_to_level());
print("muscle substats needed for next point: " + tnp($Stat[muscle]));
print("mysticality substats needed for next point: " + tnp($Stat[mysticality]));
print("moxie substats needed for next point: " + tnp($Stat[moxie]));
}

import the script into yours, and you will have access to the following functions:
int tnp(stat query)
int substats_needed_to_level()


When I run the script it prints:
Primary substats needed for next level: 8082
muscle substats needed for next point: 121
mysticality substats needed for next point: 510
moxie substats needed for next point: 26
Script succeeded!

This script requires that the level, muscle, Mysticality, and moxie progress bars be enabled in your account options on the kingdom. Results may be very weird if they are not.
 

Attachments

  • StatTest.ash
    1.2 KB · Views: 53
Top