S sven New member May 18, 2013 #1 I know you can iterate over preferences to find out how many insults you got so far but I think it's easier to just reuse the code thats already there in Java and export the functionality to ash. Attachments pirate_insults.patch pirate_insults.patch 1.4 KB · Views: 46 Last edited by a moderator: May 18, 2013
I know you can iterate over preferences to find out how many insults you got so far but I think it's easier to just reuse the code thats already there in Java and export the functionality to ash.
Bale Minion May 18, 2013 #2 Sure, it's easier, but unnecessary as you already pointed out. It's not even a very long or complicated function. PHP: int countInsults() { int total; for i from 1 to 8 if(get_property("lastPirateInsult"+i) == "true") total = total + 1; return total; }
Sure, it's easier, but unnecessary as you already pointed out. It's not even a very long or complicated function. PHP: int countInsults() { int total; for i from 1 to 8 if(get_property("lastPirateInsult"+i) == "true") total = total + 1; return total; }
roippi Developer May 19, 2013 #4 CLI users have the "insults" command for those unaware. ASH users can just use a small wrapper function like Bale's, I agree.
CLI users have the "insults" command for those unaware. ASH users can just use a small wrapper function like Bale's, I agree.