ah, thank you Jayna! So, Pixie's usage of the % symbol is doing the "operator modulo" (whatever, meh. I guess it's latin, but it sounds stupid, lol ~ so I don't like it, lol), the remainder functionality, and I presume this is using the javacript language, or are there multiple languages that use the % symbol as the modulo too?
the xml's usage had nothing to do with remainder functionality (operator modulo):
http://stackoverflow.com/questions/4414 ... ent-symbolit uses the % symbol for some variable usage or something, I think... (haven't really read up on this too much yet): %a
<string formatted="false">%a + %a == 2%a</string>
I think the basic command line prompt on computers (run -> cmd.exe), also uses the % symbol in this same way as the xml, with something to do with variables (I have been trying to learn this "language", cmd.exe, as I figured I'd start with one of the simpliest for trying to learn another language, lol. Though, it's a bit too simplistic~limited and thus a bit of effort to learn to do stuff with it, on top of trying to decipher what the commands and their switches do, along with the correct syntax ~ format, GRRR!, lol. Looking at other programming languages makes me appreciate Alex' quest coding, in how noob-friendly it is!
)
anyways, (was going off on a tangent, lol), thank you, as I now know it is indeed the modulo usage. Now, I just need to be able to follow how Pixie is using it in his~her Clock Library... it's used a bit more complex'ly... it'll take me awhile to get it... as I'm not that good with math stuff... heh.
I get it's math usage at the basic level (again thank you, for the very clear+concise explanations you give in your posts!):
days = hours / 24 (as an integer)
hour = hours % 24
starting_hours = 30
days = 1
hour = 6
it'll just take me a bit to understand the jump to how Pixie is using it... hehe. I wish I was better with math stuff... sighs.
-----------
and yes, this % symbol (operator modulo) will definately make the coding much cleaner, than my simplistic but large "if" script blocks, lol:
(I've just started on this stuff ~ before posting about how to use the % symbol... so this is very preliminary... below)
<library>
<!-- Libraries -->
<!-- Templates -->
<!-- Verbs -->
<!-- Commands -->
<!-- Functions -->
<!-- Turn Scripts -->
<turnscript name="global_events_turnscript"><![CDATA[
if (global_data_object.second_integer = 60) {
global_data_object.minute_integer = global_data_object.minute_integer + 1
global_data_object.second_integer = 0
}
if (global_data_object.minute_integer = 60) {
global_data_object.hour_integer = global_data_object.hour_integer + 1
global_data_object.minute_integer = 0
}
if (global_data_object.hour_integer = 24) {
global_data_object.day_integer = global_data_object.day_integer + 1
global_data_object.hour_integer = 0
}
if (global_data_object.day_integer >= 0 and global_data_object.day_integer < 7) {
global_data_object.week_integer = 0
} else if (global_data_object.day_integer >= 7 and global_data_object.day_integer < 14) {
global_data_object.week_integer = 1
} else if (global_data_object.day_integer >= 14 and global_data_object.day_integer < 21) {
global_data_object.week_integer = 2
} else if (global_data_object.day_integer >= 21 and global_data_object.day_integer < 28) {
global_data_object.week_integer = 3
}
switch (global_data_object.month_integer) {
case (0 or 2 or 4 or 6 or 7 or 9 or 11) {
if (global_data_object.day_integer = 31) {
global_data_object.month_integer = global_data_object.month_integer + 1
global_data_object.day_integer = 0
global_data_object.week_integer = 0
}
}
case (3 or 5 or 8 or 10) {
if (global_data_object.day_integer = 30) {
global_data_object.month_integer = global_data_object.month_integer + 1
global_data_object.day_integer = 0
global_data_object.week_integer = 0
}
}
case (1) {
if (global_data_object.day_integer = 28) {
global_data_object.month_integer = global_data_object.month_integer + 1
global_data_object.day_integer = 0
global_data_object.week_integer = 0
}
}
}
global_data_object.second_integer = global_data_object.second_integer + 1
global_data_object.global_turns = global_data_object.global_turns + 1
]]></turnscript>
<!-- Timers -->
<!-- Object Types -->
<!-- Attributes -->
<!-- Strings -->
<day_string type="string"></day_string>
<month_string type="string"></month_string>
<clock_time type="string">global_data_object.hour_integer + ":" + global_data_object.minute_integer + ":" + global_data_object.second_integer</clock_time>
<date_time type="string">global_data_object.month_integer + 1 + "/" + global_data_object.day_integer + 1 + "/" + global_data_object.year_integer</date_time>
<!-- Booleans -->
<!-- Integers -->
<global_turns type="int">0</global_turns>
<second_integer type="int">0</second_integer>
<minute_integer type="int">0</minute_integer>
<hour_integer type="int">0</hour_integer>
<day_integer type="int">0</day_integer>
<week_integer type="int">0</week_integer>
<month_integer type="int">0</month_integer>
<year_integer type="int">0</year_integer>
<!-- Doubles -->
<!-- Lists -->
<!-- String Lists -->
<months_of_the_year type="simplestringlist">january;february;march;april;may;june;july;august;september;october;november;december</months_of_the_year>
<days_of_the_week type="simplestringlist">monday;tuesday;wednesday;thursday;friday;saturday;sunday</days_of_the_week>
<!-- Object Lists -->
<!-- Dictionaries -->
<!-- String Dictionaries -->
<!-- Object Dictionaries -->
<!-- Script Dictionaries -->
<!-- Scripts -->
<!-- Inherited -->
<inherit name="editor_object" />
<!-- Objects -->
<!-- Objects -->
<!-- Data Objects -->
<object name="global_data_object">
<inherit name="editor_object" />
<global_turns type="int">0</global_turns>
<day_string type="string"></day_string>
<month_string type="string"></month_string>
<months_of_the_year type="simplestringlist">january;february;march;april;may;june;july;august;september;october;november;december</months_of_the_year>
<days_of_the_week type="simplestringlist">monday;tuesday;wednesday;thursday;friday;saturday;sunday</days_of_the_week>
<clock_time type="string">global_data_object.hour_integer + ":" + global_data_object.minute_integer + ":" + global_data_object.second_integer</clock_time>
<second_integer type="int">0</second_integer>
<minute_integer type="int">0</minute_integer>
<hour_integer type="int">0</hour_integer>
<date_time type="string">global_data_object.month_integer + 1 + "/" + global_data_object.day_integer + 1 + "/" + global_data_object.year_integer</date_time>
<day_integer type="int">0</day_integer>
<week_integer type="int">0</week_integer>
<month_integer type="int">0</month_integer>
<year_integer type="int">0</year_integer>
</object>
</library>
(and, now I can utilize the % symbol, or soon ~ it's still a bit complicated when you're trying to make a whole time+date system even while now understanding what is and how the % symbol works ~ anyways, hehe)
ya, see that big "if" turnscript script block? the % symbol is very much appreciated, lol
Hopefully with enough ingenuity from myself, I can make that big "if" turnscript script block dissapear, hehe