All pastes #114139 Raw Edit

Stuff

public text v1 · immutable
·published 2006-08-03 23:01 UTC
rendered paste body
	// Process the user's commands
	//
	function process_commands()
	{

		// Take this line of text and see if it is a command
		$tmp = explode(" ", $this->con['buffer']['text'], 2);
		$first_word = $tmp[0];
		$x = $identifier = ".";
		if ($first_word{0} == $x)
			{

				// A command could be ".time".
				// Ignoring the .
				$command = substr($first_word, 1);
			
				// $command is a command. DO IT!
				// u_ denotes a function that can be invoked by the User.
				$function = "u_".$command;
		
				// If the function exists, run it.
				if (method_exists($this, $function))
					{
						$this->$function($this->con['buffer']['text']);
					} else {

									if ($buffer['username'] == "Theme97" OR "CBG2" OR "n=Theme97" OR "n=CBG2") {
										$this->pm("STFU!");
									} else {

						$this->pm("Pardon?");

									}
					}

				//done
			} else {
				//wrong identifier, do nothing.
			}

	}