More stuff for tools.cfg possibly :D
[SELECT ALL] Code:
// checkint & checkchar - Checks given arguments and determines if they are an integer or contains chars - by DES|Bukz
alias lowalphalist [a b c d e f g h i j k l m n o p q r s t u v w x y z]
alias higalphalist [A B C D E F G H I J K L M N O P Q R S T U V W Z Y Z]
alias symbollist [` ~ ! @ # $ % ^ & * - _ = + { } \ | ; : ' , < . > / ?]
alias checkint [
foundchars = 0
loop lowloop 26 [
if (strstr $arg1 (at $lowalphalist $lowloop)) [
foundchars = 1
] []
]
loop hiloop 26 [
if (strstr $arg1 (at $higalphalist $hiloop)) [
foundchars = 1
] []
]
loop syloop 26 [
if (strstr $arg1 (at $symbollist $syloop)) [
foundchars = 1
] []
]
if $foundchars [result 0] [result 1]
]
alias checkchar [
foundchars = 0
loop lowloop 26 [
if (strstr $arg1 (at $lowalphalist $lowloop)) [
foundchars = 1
] []
]
loop hiloop 26 [
if (strstr $arg1 (at $higalphalist $hiloop)) [
foundchars = 1
] []
]
loop syloop 26 [
if (strstr $arg1 (at $symbollist $syloop)) [
foundchars = 1
] []
]
if $foundchars [result 1] [result 0]
]
docsection [Check];
docident [checkint] [Checks a given argument and determines if it is an integer or not.];
docargument [The string to check.];
docexample [if (= (checkint 928593) 1) [echo 928593 is an integer] [echo 928593 is not an integer]] [Output: 928593 is an integer];
docexample [if (= (checkint CubeScript) 1) [echo CubeScript is an integer] [echo CubeScript is not an integer]] [Output: Cubescript is not an integer];
docremark [Returns 1 if the given argument is an integer, else returns 0.];
docident [checkchar] [Checks a given argument and determines if it contains non-numerical characters.];
docargument [The string to check.];
docexample [if (= (checkchar adsf) 1) [echo adsf contains chars] [echo adsf does not contain chars]] [Output: adsf contains chars];
docexample [if (= (checkchar 192) 1) [echo 192 contains chars] [echo 192 does not contain chars]] [Output: 192 does not contain chars];
docremark [Returns 1 if the given argument contains one or more chars, else returns 0.];