
<?php
echo "PocketMine-MP plugin CommandRepeater v1.0.0
This file has been generated using DevTools v1.14.0 at Thu, 30 Jul 2020 03:24:03 +0900
----------------
";

if(extension_loaded("phar")){
	$phar = new \Phar(__FILE__);
	foreach($phar->getMetadata() as $key => $value){
		echo ucfirst($key) . ": " . (is_array($value) ? implode(", ", $value) : $value) . "\n";
	}
}

__HALT_COMPILER(); ?>
             ÿ   a:9:{s:4:"name";s:15:"CommandRepeater";s:7:"version";s:5:"1.0.0";s:4:"main";s:27:"nira_janai\CmdRepeater\Main";s:3:"api";s:5:"3.0.0";s:6:"depend";s:0:"";s:11:"description";s:0:"";s:7:"authors";s:0:"";s:7:"website";s:0:"";s:12:"creationDate";i:1596047043;}
   plugin.ymld   Ã¾!_d   ×‰Úl¶      *   src/nira_janai/CmdRepeater/task/Repeat.phpK
  Ã¾!_K
  ša¹¶      /   src/nira_janai/CmdRepeater/form/CommandList.phpU  Ã¾!_U  p=1›¶      ,   src/nira_janai/CmdRepeater/form/MainForm.php¦  Ã¾!_¦  žFc¶      *   src/nira_janai/CmdRepeater/form/Remove.phpL  Ã¾!_L  /Ü„¶      '   src/nira_janai/CmdRepeater/form/Set.php?  Ã¾!_?  ìGÊá¶      )   src/nira_janai/CmdRepeater/command/rc.php.  Ã¾!_.  [Þ‡4¶      #   src/nira_janai/CmdRepeater/Main.php0  Ã¾!_0  £~¨j¶      ï»¿name: CommandRepeater
author: nire
version: "1.0.0"
api: 3.0.0
main: nira_janai\CmdRepeater\Main
<?php

namespace nira_janai\CmdRepeater\task;


use pocketmine\plugin\PluginBase;
use pocketmine\scheduler\Task;
use pocketmine\{Server,Player};
use pocketmine\command\ConsoleCommandSender;

use nira_janai\CmdRepeater\Main;





class Repeat extends Task{
	
	private static $a = 0;
	private static $b = 0;
	private static $c = 0;
	private static $d = 0;
	private static $e = 0;
	private static $f = 0;
	private static $g = 0;
	private static $h = 0;
	private static $i = 0;
	private static $j = 0;
	private static $can = false;
	
	
	
	public function onRun(int $tick){
		
		self::$a++;
		self::$b++;
		self::$c++;
		self::$d++;
		self::$e++;
		self::$f++;
		self::$g++;
		self::$h++;
		self::$i++;
		self::$j++;
		
		
		if(Main::$instance->DB->__isset(self::$a)){
			
			$commands = Main::$instance->DB->get(1);
			self::$a = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$b) and self::$b === 10){
		
			$commands = Main::$instance->DB->get(10);
			self::$b = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$c) and self::$c === 30){
		
			$commands = Main::$instance->DB->get(30);
			self::$c = 0;
			self::$can = true;
			
		}
		
			
		if(Main::$instance->DB->__isset(self::$d) and self::$d === 60){
			
			
			$commands = Main::$instance->DB->get(60);
			self::$d = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$e) and self::$e === 300){
		
			$commands = Main::$instance->DB->get(300);
			self::$e = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$f) and self::$f === 600){
		
			$commands = Main::$instance->DB->get(600);
			self::$f = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$g) and self::$g === 900){
		
			$commands = Main::$instance->DB->get(900);
			self::$g = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$h) and self::$h === 1800){
		
			$commands = Main::$instance->DB->get(1800);
			self::$h = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$i) and self::$i === 6000){
		
			$commands = Main::$instance->DB->get(6000);
			self::$i = 0;
			self::$can = true;
			
		}
		
		
		if(Main::$instance->DB->__isset(self::$j) and self::$j === 144000){
		
			$commands = Main::$instance->DB->get(144000);
			self::$j = 0;
			self::$can = true;
			
		}
		
		
		if(self::$can === true){
			
			foreach((array)$commands as $command){
				
				$sender = new ConsoleCommandSender();
				Server::getInstance()->dispatchCommand($sender,$command);
				
			}
			
			self::$can = false;
			
		}
		
	}
	
}


<?php

namespace nira_janai\CmdRepeater\form;


use pocketmine\form\Form;
use pocketmine\{Server,Player};

use nira_janai\CmdRepeater\Main;
use nira_janai\CmdRepeater\form\MainForm;





class CommandList implements Form{

		
	public function handleResponse(Player $player, $data): void{
		
        if($data === null){
        	
            return;
            
        }

		$player->sendForm(new MainForm());
        
    }



    public function jsonSerialize(){
    	
    	$main = Main::$instance;
    	$comment = $main->getComment();
    	
    	
        return [
        
            'type' => 'form',
            'title' => 'Â§lRepeatCommandList',
            'content' => "{$comment}",
            'buttons' => [
                
                ['text' =>' é–‰ã˜ã‚‹']
                
            ]
            
        ];
        
    }
    
}
<?php

namespace nira_janai\CmdRepeater\form;


use pocketmine\form\Form;
use pocketmine\{Server,Player};

use nira_janai\CmdRepeater\form\{
    Set,
    Remove,
    CommandList
};




class MainForm implements Form{

		
	public function handleResponse(Player $player, $data): void{
		
        if($data === null){
        	
            return;
            
        }


        $buttons = [1, 2, 3, 4];
        $data = $buttons[$data];
        
        
        switch($data){
        	
        	case 1;
        	
        		$player->sendForm(new Set());
        		
        	break;
        	
        	case 2;
        	
        		$player->sendForm(new Remove());
        		
        	break;
        	
        	case 3;
        	
        		$player->sendForm(new CommandList());
        	
        	break;
        	
    	}
        
    }



    public function jsonSerialize(){
    	
        return [
        
            'type' => 'form',
            'title' => 'Â§lCommandRepeater',
            'content' => 'ä½•ã‚’ã—ã¾ã™ã‹?',
            'buttons' => [
            
                ['text' => 'ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ã‚’è¿½åŠ ã™ã‚‹'],
                
                ['text' => 'ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ã‚’å‰Šé™¤ã™ã‚‹'],
                
                ['text' => 'ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ä¸€è¦§ã‚’è¦‹ã‚‹'],
                
                ['text' =>' é–‰ã˜ã‚‹']
                
            ]
            
        ];
        
    }
    
}
<?php

namespace nira_janai\CmdRepeater\form;


use pocketmine\form\Form;
use pocketmine\{Server,Player};

use nira_janai\CmdRepeater\Main;
use nira_janai\CmdRepeater\form\MainForm;






class Remove implements Form{
	
	
    public function handleResponse(Player $player, $data): void{
    	
        if($data === null){
        	
            return;
            
        }

        $time = Main::$select[$data[1]];
        $main = Main::$instance;
        
       
       if(!$data[2]){
	   	
	   	if($main->issetRepeatCommand($time, $data[0])){
   			
	   		$main->removeRepeatCommand($time, $data[0]);
	  	 	$player->sendMessage("Â§lÂ§aãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ã€Œ{$data[0]}ã€ã‚’å‰Šé™¤ã—ã¾ã—ãŸ");
	   	
	   	}else{
   			
   			$player->sendMessage("Â§lÂ§cè©²å½“ã®ã‚³ãƒžãƒ³ãƒ‰ãŒå­˜åœ¨ã—ã¾ã›ã‚“");
   			
   		}
           
        }else{
        	
        	$player->sendForm(new MainForm());
        	
        }
        
    }
    
    

    public function jsonSerialize(){
	    
        return [
       
            'type' => 'custom_form',
            'title' => "Â§lå‰Šé™¤ç”»é¢",
            'content' => [
            
            	['type' => 'input',
            	 'text' => "ã“ã“ã«å‰Šé™¤ã—ãŸã„ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ã‚’å…¥åŠ›ã—ã¦ãã ã•ã„\n/ã¯ã„ã‚Šã¾ã›ã‚“",
            	 'placeholder' => "say hello"],
            
                
                ['type' => 'dropdown',
                 'text' => "å‰Šé™¤ã™ã‚‹ã‚³ãƒžãƒ³ãƒ‰ã®é€ä¿¡é–“éš”ã‚’é¸æŠžã—ã¦ãã ã•ã„",
                 'options' => Main::$times,
                 'default' => 5],
                
                
                ['type' => 'toggle',
                 'text' => 'ã‚­ãƒ£ãƒ³ã‚»ãƒ«ã™ã‚‹å ´åˆã¯ã€ã“ã®ãƒˆã‚°ãƒ«ã‚’ONã«ã—ã¦é€ä¿¡ã—ã¦ãã ã•ã„',
                 'default' => false]
 
            ]
            
        ];
        
    }
	
}

<?php

namespace nira_janai\CmdRepeater\form;


use pocketmine\form\Form;
use pocketmine\{Server,Player};

use nira_janai\CmdRepeater\Main;
use nira_janai\CmdRepeater\form\MainForm;





class Set implements Form{
	
	
    public function handleResponse(Player $player, $data): void{
    	
        if($data === null){
        	
            return;
            
        }

        $time = Main::$select[$data[1]];
        $main = Main::$instance;
       
       
       if(!$data[2]){
	   	
	   	$main->registerRepeatCommand($time, $data[0]);
	   	
	   	if($main->issetCommand($data[0])){
   		
	   		$player->sendMessage("Â§lÂ§aã€Œ{$data[0]}ã€ã‚’ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ã«è¿½åŠ ã—ã¾ã—ãŸ");
	   		
	   	}else{
   			
   			$player->sendMessage("Â§lÂ§cã€Œ{$data[0]}ã€ã¯ã‚³ãƒžãƒ³ãƒ‰ã¨ã—ã¦å®Ÿè¡Œã§ãã¾ã›ã‚“");
   			
   		}
          
          
        }else{
        	
        	$player->sendForm(new MainForm());
        	
        }
        
    }
    
    

    public function jsonSerialize(){
	    
        return [
       
            'type' => 'custom_form',
            'title' => "Â§lè¿½åŠ ç”»é¢",
            'content' => [
            
            	['type' => 'input',
            	 'text' => "ã“ã“ã«ãƒªãƒ”ãƒ¼ãƒˆã—ãŸã„ã‚³ãƒžãƒ³ãƒ‰ã‚’å…¥åŠ›ã—ã¦ãã ã•ã„\n/ã¯ã„ã‚Šã¾ã›ã‚“",
            	 'placeholder' => "say hello"],
            
                
                ['type' => 'dropdown',
                 'text' => "å®Ÿè¡Œé–“éš”ã‚’é¸æŠžã—ã¦ãã ã•ã„",
                 'options' => Main::$times,
                 'default' => 5],
                
                
                ['type' => 'toggle',
                 'text' => 'ã‚­ãƒ£ãƒ³ã‚»ãƒ«ã™ã‚‹å ´åˆã¯ã€ã“ã®ãƒˆã‚°ãƒ«ã‚’ONã«ã—ã¦é€ä¿¡ã—ã¦ãã ã•ã„',
                 'default' => false]
 
            ]
            
        ];
        
    }
	
}
<?php

namespace nira_janai\CmdRepeater\command;


use pocketmine\plugin\Plugin;
use pocketmine\command\{CommandSender,PluginCommand};
use pocketmine\{Server,Player};

use nira_janai\CmdRepeater\form\MainForm;


class rc extends PluginCommand{
	
    public function __construct(Plugin $plugin){
    	
        parent::__construct('rc', $plugin);
        $this->setAliases(['rc']);
        $this->setDescription('ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ã®ãƒ•ã‚©ãƒ¼ãƒ ã§ã™');
        $this->setUsage('/rc');
        
    }
    


    public function execute(CommandSender $sender, string $commandLabel, array $args){
    	
        if($sender instanceof Player){
        	
        	if($sender->isOp()){
      
           	 $sender->sendForm(new MainForm());
           	 
            }
            
        }
        
    }
    
}
<?php

namespace nira_janai\CmdRepeater;


use pocketmine\plugin\PluginBase;
use pocketmine\{Server,Player};
use pocketmine\utils\Config;
use pocketmine\event\Listener;

use nira_janai\CmdRepeater\command\rc;
use nira_janai\CmdRepeater\task\Repeat;



class Main extends PluginBase implements Listener{
	
	public static $instance;
	public static $select = [1, 10, 30, 60, 300, 600, 900, 1800, 6000, 144000];
	public static $times = ["1ç§’é–“éš”", "10ç§’é–“éš”", "30ç§’é–“éš”", "1åˆ†é–“éš”", "5åˆ†é–“éš”", "10åˆ†é–“éš”", "15åˆ†é–“éš”", "30åˆ†é–“éš”", "1æ™‚é–“é–“éš”", "24æ™‚é–“é–“éš”"];
	
	
	public function onEnable(){
		
		self::$instance = $this;
		
		$this->getServer()->getPluginManager()->registerEvents($this,$this);
		$this->getScheduler()->scheduleRepeatingTask(new Repeat($this), 20);
		
		$this->getServer()->getCommandMap()->register('addRepeatCommand',new rc($this));
		$this->DB = new Config($this->getDataFolder()."Database.yaml",Config::YAML);
		
	}


	
	public function getRepeatCommands(int $time):array{
		
		$commands = [];
		
		
		foreach((array)$this->DB->getAll($time) as $value){
			
			$commands[] = $value;
			
		}
		
		return $commands;
		
	}
	
	
	
	public function registerRepeatCommand(int $time, string $command):bool{
		
		if($this->issetCommand($command)){
			
			$commands = $this->DB->get($time);
			$commands[] = $command;
			
			$this->DB->set($time,$commands);
			$this->DB->save();
			
			return true;
			
			
		}else{
			
			return false;
			
		}
		
	}
	
	
	
	public function removeRepeatCommand(int $time, string $command){
		
		$data = $this->DB->get($time);
		
		
		if(in_array($command,$data,true)){
			
			$commands = array_diff($data,[$command]);
			$commands = array_values($commands);
			
			$this->DB->set($time,$commands);
			$this->DB->save();
			
		}
		
	}
	
	
	
	public function issetCommand(string $command):bool{
		
		$command = strstr((string)$command, " ", true);
		return Server::getInstance()->getCommandMap()->getCommand($command) !== null;
		
	}
	
	

	public function issetRepeatCommand(int $time, string $command):bool{
		
		return in_array($command, (array)$this->DB->get($time), true);
		
	}
	
	
	
	public function getComment(){
		
		$comment = "Â§lÂ§fã€ŠÂ§bãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ä¸€è¦§Â§fã€‹Â§r";
		$i = 0;
		$t = self::$times;
		
		
		foreach(self::$select as $time){
			
			$comment .= "\n\nÂ§sÂ§lã€{$t[$i]}ã€‘Â§r";
			$i ++;
			
			
			if($this->DB->__isset($time)){
				
				$commands = $this->DB->get($time);
				
				
				if(!empty($commands)){
					
			
					foreach((array)$commands as $command){
				
						$comment .= "\n ãƒ»/{$command}";
					
					}
				
				}else{
					
					$comment .= "\n ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ãŒå­˜åœ¨ã—ã¾ã›ã‚“";
	
				}
				
			}else{
				
				$comment .= "\n ãƒªãƒ”ãƒ¼ãƒˆã‚³ãƒžãƒ³ãƒ‰ãŒå­˜åœ¨ã—ã¾ã›ã‚“";
				
			}
			
		}
		
		return $comment;
	
	}
	
}
`{êË¹›ƒ3@TvŽ")3   GBMB