As part of my daily breakfast routine, I have a snippet that doesn't seem to work the way I had intended. I wrote it without any of my characters in Ronin, and because it checks Ronin status, I had no way of testing it for several months.
When I was able to test it, it didn't quite work the way I had hoped. Here's the snippet:
I remember I was referencing the Ash Wiki while writing this, and found the truncate() function to do exactly what I needed, split whatever adventures I have remaining three ways and pump up each stat equally.
However, when I run the script, it prints, "...you will be working out for 0 adventures...", despite having 200 adventures at the moment. I was under the impression that it would take remaining adventures and divide by three (200/3=66.6666) then just drop the decimal and adventure for 66 turns for each stat. Some how, though, it's getting zero and adventuring for zero turns each stat. Am I just misunderstanding the use of truncate()?
When I was able to test it, it didn't quite work the way I had hoped. Here's the snippet:
Code:
if (my_turncount() <= 1000) {
int pumps = my_adventures();
int pumpseach = truncate( pumps / 3 );
print("Because you are still in Ronin, you will be working out for " + pumpseach + " adventures for each stat.");
cli_execute("adventure " + pumpseach + " pump up moxie");
cli_execute("adventure " + pumpseach + " pump up mysticality");
cli_execute("adventure " + pumpseach + " pump up muscle");
}
I remember I was referencing the Ash Wiki while writing this, and found the truncate() function to do exactly what I needed, split whatever adventures I have remaining three ways and pump up each stat equally.
However, when I run the script, it prints, "...you will be working out for 0 adventures...", despite having 200 adventures at the moment. I was under the impression that it would take remaining adventures and divide by three (200/3=66.6666) then just drop the decimal and adventure for 66 turns for each stat. Some how, though, it's getting zero and adventuring for zero turns each stat. Am I just misunderstanding the use of truncate()?