ironsphererpg/scripts/ruby.cs
Jusctsch5 a5143b67f7 T2RPG: Initial commit of ironsphererpg directory
Taking everything obtained from http://ironsphererpg2.webs.com/ and dumping it in a git repo
2015-01-18 21:06:06 -06:00

34 lines
837 B
C#

// KC:
// used to prevent arithmetic fail in T2
// because a number like 239203902 would be 2.39204e+08
function epochTime()
{
RubyEval("tsEval '$temp=\x22' + Time.now.to_i.to_s + '\x22;'");
return $temp;
}
function ruby_greaterThan(%a, %b)
{
// a greater than b
RubyEval("tsEval '$temp=\x22' + ("@%a@" > "@%b@").to_s + '\x22;'");
return $temp $= "true";
}
function ruby_lessThan(%a, %b)
{
// a less than b
RubyEval("tsEval '$temp=\x22' + ("@%a@" > "@%b@").to_s + '\x22;'");
return $temp $= "true";
}
function ruby_add(%a, %b)
{
// a add b
RubyEval("tsEval '$temp=\x22' + ("@%a@" + "@%b@").to_s + '\x22;'");
return $temp;
}
function ruby_sub(%a, %b)
{
// a sub b
RubyEval("tsEval '$temp=\x22' + ("@%a@" - "@%b@").to_s + '\x22;'");
return $temp;
}