• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Calculator script

Here's a demo:
PHP:
<?php
	$worlds = array("Aldora" => "blue", "Astera" => "green", "Dolera" => "red");
	$_ratios = array(
			"red" => array(
					"red" => (float) 0.7,
					"green" => (float) 1.0,
					"blue" => (float) 1.0
			),

			"green" => array(
					"red" => (float) 0.3,
					"green" => (float) 0.8,
					"blue" => (float) 0.5
			),

			"blue" => array(
					"red" => (float) 0.6,
					"green" => (float) 1.0,
					"blue" => (float) 0.8
			)
	);

	$current_world = (string) (array_key_exists(@$_POST["world"], $worlds) == TRUE ? @$_POST["world"] : "Aldora");
	$money = (int) @$_POST["num"];

	$result_str = (string) '';
	echo('Current world: '.$current_world.' - Cash: '.$money.'<br /><form method="post"><select name="world">');

	foreach($worlds as $key => $value)
	{
		echo('<option>'.$key.'</option>');
		$result_str .= '<font color="'.$value.'">'.$key.'</font> => '.floor($money*$_ratios[$worlds[$current_world]][$value]).'<br />';
	}

	echo('</select><input name="num" size="2" value="100" /><button type="submit">Calculate</button></form>'.$result_str);
?>

I'm pretty sure it can be done way easier, but I'm just too lazy to figure the numbers out.
 
Last edited:
Back
Top