I'm writing a script to clear out the hidden city, and I've run into a problem.
I want to be able to figure out which spheres I have not yet identified, and to be able to count how many spheres I have identified.
For those who are unaware, mafia has a very useful feature where it automatically identifies a stone sphere for you when you use it, and marks it as such in its item database. For instance, if your cracked stone sphere is the water one, mafia will mark it as a 'cracked stone sphere of water' in your inventory and item dropdowns.
Here's the snippet I was hoping to use.
(is there a ++ feature?)
Now, at the time of testing, I have identified two of my spheres, the water and lightning ones.
So, when I verify this script, mafia tells me:
Item sphere of fire not found in database
and if I comment out the 'sphere of fire' bit, it tells me:
Item sphere of plants not found in database
Now, it seems to me this is where one would use try and catch blocks normally. Is there a way to 'try' a block of code, as such?
Alternatively, can anyone think of a way to figure out how many identified spheres I have, and which ones are still unidentified, in ASH?
I want to be able to figure out which spheres I have not yet identified, and to be able to count how many spheres I have identified.
For those who are unaware, mafia has a very useful feature where it automatically identifies a stone sphere for you when you use it, and marks it as such in its item database. For instance, if your cracked stone sphere is the water one, mafia will mark it as a 'cracked stone sphere of water' in your inventory and item dropdowns.
Here's the snippet I was hoping to use.
Code:
int identified_spheres() {
int ids = 0;
if(item_amount($item[sphere of water]) > 0) ids = ids + 1;
if(item_amount($item[sphere of fire]) > 0) ids = ids + 1;
if(item_amount($item[sphere of lightning]) > 0) ids = ids + 1;
if(item_amount($item[sphere of plants]) > 0) ids = ids + 1;
print("identified spheres : " + ids);
return ids;
}
Now, at the time of testing, I have identified two of my spheres, the water and lightning ones.
So, when I verify this script, mafia tells me:
Item sphere of fire not found in database
and if I comment out the 'sphere of fire' bit, it tells me:
Item sphere of plants not found in database
Now, it seems to me this is where one would use try and catch blocks normally. Is there a way to 'try' a block of code, as such?
Alternatively, can anyone think of a way to figure out how many identified spheres I have, and which ones are still unidentified, in ASH?