This repository was archived by the owner on Feb 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path[proc,script1880].cs2
52 lines (52 loc) · 1.87 KB
/
[proc,script1880].cs2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// 1880
[proc,script1880](int $int0)(string, string)
def_string $string0 = "";
def_string $string1 = "";
def_int $int1 = 30;
def_int $int2 = calc($int0 / 60);
def_int $int3 = calc($int2 / 24);
def_int $int4 = calc($int3 / $int1);
if ($int0 <= 0) {
return($string0, $string1);
}
def_int $int5 = $int4;
def_int $int6 = calc($int3 - $int4 * $int1);
def_int $int7 = calc($int2 - $int3 * 24);
def_int $int8 = calc($int0 - $int2 * 60);
if ($int5 > 0) {
if ($int6 > 0) {
$string0 = "<tostring($int5)> <~text_plural($int5, "month", "months")> <tostring($int6)> <~text_plural($int6, "day", "days")>";
} else {
$string0 = "<tostring($int5)> <~text_plural($int5, "month", "months")>";
}
$string1 = $string0;
} else if ($int6 > 0) {
if ($int7 > 0) {
$string0 = "<tostring($int6)> <~text_plural($int6, "day", "days")> <tostring($int7)> <~text_plural($int7, "hr", "hrs")>";
} else {
$string0 = "<tostring($int6)> <~text_plural($int6, "day", "days")>";
}
if ($int7 > 0) {
$string1 = "<tostring($int6)> <~text_plural($int6, "day", "days")> <tostring($int7)> <~text_plural($int7, "hour", "hours")>";
} else {
$string1 = "<tostring($int6)> <~text_plural($int6, "day", "days")>";
}
} else {
$int8 = calc($int0 - $int2 * 60);
if ($int7 > 0) {
if ($int8 > 0) {
$string0 = "<tostring($int7)> <~text_plural($int7, "hr", "hrs")> <tostring($int8)> <~text_plural($int8, "min", "mins")>";
} else {
$string0 = "<tostring($int7)> <~text_plural($int7, "hr", "hrs")>";
}
if ($int8 > 0) {
$string1 = "<tostring($int7)> <~text_plural($int7, "hour", "hours")> <tostring($int8)> <~text_plural($int8, "minute", "minutes")>";
} else {
$string1 = "<tostring($int7)> <~text_plural($int7, "hour", "hours")>";
}
} else {
$string0 = "<tostring($int8)> <~text_plural($int8, "min", "mins")>";
$string1 = "<tostring($int8)> <~text_plural($int8, "minute", "minutes")>";
}
}
return($string0, $string1);