Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Prodigy;
- class BotExample extends BotBase implements InterfaceSteelCityAutomaton{
- public function on_rez(){
- $this->world->say(0, "Oh! Existance! How amusing!");
- }
- public function on_derez(){
- $this->world->say(0, "Good bye, cruel world!");
- }
- public function on_move(BotMovement $movement){
- if($movement->delta_motion > 0.1) {
- $this->world->say(0, "Oof! I moved " . number_format($movement->delta_motion, 2) . "!");
- $this->world->play("d11424ea-be2d-9d70-e039-e73278588686");
- }
- }
- /**
- * Handle a teleport Request.
- * @param BotAgent $agent
- * @param BotTeleportRequest $teleport_request
- */
- public function teleport_request(BotAgent $agent, BotTeleportRequest $teleport_request){
- if($agent->is_admin()){
- $agent->say("Yes sir.");
- //$this->move($x, $y, $sim);
- $teleport_request->accept();
- }else{
- $agent->say("Aww hell naw, I ain't moving to {$teleport_request->x},{$teleport_request->y} in {$teleport_request->sim}");
- }
- }
- /**
- * Not sure if keeping?
- * @param $command
- * @return bool|void
- */
- public function on_command($command){
- if($command == "shit self"){
- $this->world->say(0, "Aww hell naw");
- return false;
- }
- }
- /**
- * @param BotAgent $agent
- * @param $message
- */
- public function listen(BotAgent $agent, $message){
- #$this->world->say(0, "{$agent->get_name()} said {$message}");
- if($message == "die"){
- if($agent->get_name() == "Greyscale Eusebio"){
- exit;
- }else{
- $agent->say("heh, no.");
- }
- }
- }
- // Handle this script stopping. On stop, logout cleanly.
- public function __destruct(){
- $this->logout();
- }
- /**
- * @param $tick integer Number of ticks since begin
- */
- public function on_tick($tick){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement