Please remove the link to my isNumber function.
function isNumber(%string){ if(%string <= 999999 && (%string >= -999999)) { // Fast solution return %string $= %string * 1; } else { // Slow solution %dot = 0; // Track if period present %sci = 0; // Track if scientific notation present for(%j = 0; %j < strLen(%string); %j++) { %c = getSubStr(%string, %j, 1); if(%c $= "-") { if(%sci == -1) { %sci = 1; // Negative powers } else if(%j != 0) { return false; // Negative not the first character } continue; } if(%c $= ".") { if(%dot || %j == 0) { return false; // Multiple periods or nothing before the period } else { %dot = 1; } continue; } if(%c $= "e") { if(%sci != 0) { return false; // Multiple Es present } else { %sci = -1; } continue; } if(%c $= "+") { if(%sci != -1) { return false; // + is not part of e+ scientific notation } else { %sci = 1; } continue; } if(%sci == -1 || strPos("0123456789", %c) == -1) { return false; // An E was present without a + or the current character is not a number } } if(%sci == -1) { return false; // Last character was an E. } return true; // Gamut has been run, nothing returned, ergo it is fine }}
Anyway, I found a sort function and scripted one for reorderChild(), here: (soon)
The link was there earlier. What happened?
Here's another two:http://forum.blockland.us/index.php?topic=248858.0http://forum.blockland.us/index.php?topic=248856.0
I can't...Too complicated...;-;
// --- List Support functions. Ask Mold, I don't know.// - Todo: Comment this. It's a very useful resource.// Originally by Mold// Modified by Lugnut//List functions found in Event_Minigamefunction addItemToList(%string, %item){ if(hasItemOnList(%string, %item)) return %string; if(%string $= "") return %item; else return %string SPC %item;}function hasItemOnList(%string, %item){ for(%i=0;%i<getWordCount(%string);%i++) { if(getWord(%string, %i) $= %item) return 1; } return 0;}function removeItemFromList(%string, %item){ if(!hasItemOnList(%string, %item)) return %string; for(%i=0;%i<getWordCount(%string);%i++) { if(getWord(%string, %i) $= %item) { if(%i $= 0) return getWords(%string, 1, getWordCount(%string)); else if(%i $= getWordCount(%string)-1) return getWords(%string, 0, %i-1); else return getWords(%string, 0, %i-1) SPC getWords(%string, %i+1, getWordCount(%string)); } }}function getRandomItemFromList(%string){ if(%string $= "") return false; %num = getRandom(0, getWordCount(%string)); return getWord(%string, %num);}
Could someone make a getWeekOfMonth() or getWeekOfYear() function for me please?
Day of month modulo 7?Day of year modulo 7?It's that simple... I think.
function getWeekOfMonth(){ return getWord(getCompileTimeString(), 1) % 7;}