Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Scoller Popup

Comments in 'Plugin Development' started by GamesLoad, May 31, 2015.

  1. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    hello how do I make an infinite scroll popup I saw one on a server
  2. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    Use schedulerDelayedRepeatTask.
    mamayadesu and Jon like this.
  3. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    $event->getPlayer()->sendPopup($popup);
  4. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    in this case, how should I do?
  5. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    You need make other function with you Popup and repeat it in join function.
  6. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    class Main extends PluginBase implements Listener{
    public function onEnable() {
    parent::eek:nEnable();
    $this->getServer()->getScheduler()->scheduleDelayedTask(new Task($this, $player), 40);
    }

    public function onRun($tick){
    switch($tick){
    case 1:
    $this->player->sendPopup(TextFormat::RED . "Welcome to BudinoCraft!");
    case 2:
    $this->player->sendPopup(TextFormat::GOLD . "elcome to BudinoCraft! W");
    case 3:
    $this->player->sendPopup(TextFormat::YELLOW . "lcome to BudinoCraft! We");
    case 4:
    $this->player->sendPopup(TextFormat::GREEN . "come to BudinoCraft! Wel");
    case 5:
    $this->player->sendPopup(TextFormat::BLUE . "ome to BudinoCraft! Welc");
    case 6:
    $this->player->sendPopup(TextFormat::LIGHT_PURPLE . "me to BudinoCraft! Welco");
    case 7:
    $this->player->sendPopup(TextFormat::RED . "e to BudinoCraft! Welcom");
    case 8:
    $this->player->sendPopup(TextFormat::GOLD . "to BudinoCraft! Welcome");
    case 9:
    $this->player->sendPopup(TextFormat::YELLOW . "o BudinoCraft! Welcome t");
    case 10:
    $this->player->sendPopup(TextFormat::GREEN . " BudinoCraft! Welcome to");
    case 11:
    $this->player->sendPopup(TextFormat::BLUE . "BudinoCraft! Welcome to ");
    case 12:
    $this->player->sendPopup(TextFormat::LIGHT_PURPLE . "udinoCraft! Welcome to B");
    case 13:
    $this->player->sendPopup(TextFormat::RED . "dinoCraft! Welcome to Bu");
    case 14:
    $this->player->sendPopup(TextFormat::GOLD . "inoCraft! Welcome to Bud");
    case 15:
    $this->player->sendPopup(TextFormat::YELLOW . "noCraft! Welcome to Budi");
    case 16:
    $this->player->sendPopup(TextFormat::GREEN . " oCraft! Welcome to Budin");
    case 17:
    $this->player->sendPopup(TextFormat::GOLD . "Craft! Welcome to Budino");
    case 18:
    $this->player->sendPopup(TextFormat::YELLOW . "raft! Welcome to BudinoC");
    case 19:
    $this->player->sendPopup(TextFormat::RED . "aft! Welcome to BudinoCr");
    case 20:
    $this->player->sendPopup(TextFormat::GOLD . "ft! Welcome to BudinoCra");
    case 21:
    $this->player->sendPopup(TextFormat::YELLOW . "t! Welcome to BudinoCraf");
    case 22:
    $this->player->sendPopup(TextFormat::GREEN . "! Welcome to BudinoCraft");
    case 23:
    $this->player->sendPopup(TextFormat::BLUE . "Welcome to BudinoCraft!");

    }
    }
    }
  7. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    502
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    I think PocketMine cannot handle so many actions each tick
  8. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    Do you have any solution?
  9. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I think you can send it like after 8 ticks, so 1, 8, 16, ... Also, the 23 isn't needed, just do $tick = 1; in 22.
  10. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    What's the matter
    PHP:
    <?php

    namespace ScrollerPopup\robozeri;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\utils\TextFormat;
    use 
    ScrollerPopup\robozeri\Task;


    class 
    Main extends PluginBase implements Listener{
        public function 
    onEnable() {
            
    parent::eek:nEnable();
             
    $this->getServer()->getScheduler()->scheduleDelayedTask(new Task($this$player), 40);
            
        }

      
    }
    other class
    PHP:
    <?php

    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */

    use pocketmine\scheduler\PluginTask;
    class 
    Task extends PluginTask {
       public function 
    onRun($tick){
      switch(
    $tick){
        case 
    1:
          
    $this->player->sendPopup(TextFormat::RED "Welcome to BudinoCraft!");
        case 
    2:
          
    $this->player->sendPopup(TextFormat::GOLD "elcome to BudinoCraft! W");
        case 
    3:
          
    $this->player->sendPopup(TextFormat::YELLOW "lcome to BudinoCraft! We");
        case 
    4:
          
    $this->player->sendPopup(TextFormat::GREEN "come to BudinoCraft! Wel");
        case 
    5:
          
    $this->player->sendPopup(TextFormat::BLUE "ome to BudinoCraft! Welc");
        case 
    6:
          
    $this->player->sendPopup(TextFormat::LIGHT_PURPLE "me to BudinoCraft! Welco");
        case 
    7:
          
    $this->player->sendPopup(TextFormat::RED "e to BudinoCraft! Welcom");
        case 
    8:
          
    $this->player->sendPopup(TextFormat::GOLD "to BudinoCraft! Welcome");
        case 
    9:
          
    $this->player->sendPopup(TextFormat::YELLOW "o BudinoCraft! Welcome t");
        case 
    10:
          
    $this->player->sendPopup(TextFormat::GREEN " BudinoCraft! Welcome to");
        case 
    11:
          
    $this->player->sendPopup(TextFormat::BLUE "BudinoCraft! Welcome to ");
        case 
    12:
          
    $this->player->sendPopup(TextFormat::LIGHT_PURPLE "udinoCraft! Welcome to B");
        case 
    13:
          
    $this->player->sendPopup(TextFormat::RED "dinoCraft! Welcome to Bu");
        case 
    14:
          
    $this->player->sendPopup(TextFormat::GOLD "inoCraft! Welcome to Bud");
        case 
    15:
          
    $this->player->sendPopup(TextFormat::YELLOW "noCraft! Welcome to Budi");
        case 
    16:
          
    $this->player->sendPopup(TextFormat::GREEN " oCraft! Welcome to Budin");
        case 
    17:
          
    $this->player->sendPopup(TextFormat::GOLD "Craft! Welcome to Budino");
        case 
    18:
          
    $this->player->sendPopup(TextFormat::YELLOW "raft! Welcome to BudinoC");
        case 
    19:
          
    $this->player->sendPopup(TextFormat::RED "aft! Welcome to BudinoCr");
        case 
    20:
          
    $this->player->sendPopup(TextFormat::GOLD "ft! Welcome to BudinoCra");
        case 
    21:
          
    $this->player->sendPopup(TextFormat::YELLOW "t! Welcome to BudinoCraf");
        case 
    22:
          
    $this->player->sendPopup(TextFormat::GREEN "! Welcome to BudinoCraft");
        case 
    23:
          
    $this->player->sendPopup(TextFormat::BLUE "Welcome to BudinoCraft!");
        case 
    24:
          
    $this->player->sendPopup(TextFormat::RED "Buy vip on new web site ");

      }
    }
    }
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,306
    Plugins:
    11
    Minecraft User:
    PEMapModder
    It does not do any actions.
    The problem is, the switch is pointless.
    Moreover, $tick is the server tick and is useless to you.
  12. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Inatead of $tick, use a variable.
  13. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    Could you provide me with a solution thank you very much
  14. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Andrey Nazarchuk likes this.
  15. GamesLoad
    Offline

    GamesLoad Active Member

    Joined:
    Jun 28, 2014
    Posts:
    106
    Minecraft User:
    GamesLoad
    $tick = 1?
  16. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    You should be able to change this code, instead of using $tick, use $current
    PHP:
    public function __construct(Main $plugin$message$duration){
            
    parent::__construct($plugin);
            
    $this->plugin $plugin;
            
    $this->message $message;
            
    $this->duration $duration;
            
    $this->current 0;
        }
       
        public function 
    onRun($tick){
            
    $this->plugin $this->getOwner();
            if(
    $this->current <= $this->duration){
                foreach(
    $this->plugin->getServer()->getOnlinePlayers() as $players){
                    
    $players->sendPopup($this->message);
                }
            }else{
                
    $this->plugin->getServer()->getScheduler()->cancelTask($this->getTaskId());
            }
            
    $this->current += 1;
        }
  17. TruDan
    Offline

    TruDan New Member

    Joined:
    Oct 24, 2014
    Posts:
    8
    Minecraft User:
    TruDan
    Use this, written by Shoghicp :)



    Code:
    $task = new MarqueeTask($plugin, $player, "Welcome to BudinoCraft!");
    $server->getScheduler()->scheduleTask($task);
    However this wouldn't give exactly the results you are after, but it will do a marquee, so it would have to be adapted slightly to do what you want it to.

    I have forked that gist and edited it, I haven't tested it, but I think it will work.


    with:


    Code:
    $task = new MarqueeTask($plugin, $player, "Welcome to BudinoCraft!", null, "", true);
    $server->getScheduler()->scheduleTask($task);
    iJoshuaHD, TonyDroide and PEMapModder like this.
  18. BorbingoBoy
    Offline

    BorbingoBoy New Member

    Joined:
    Apr 10, 2015
    Posts:
    5
    Minecraft User:
    BorbingoBoy
    Can you make me a plugin that does that fast scroll transitions with including text: "Welcome to Minin' Some Fire Creative Server!" three+ times ASAP? Thank you so much
  19. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    lol from my skywars server :p

    heres the source:

    PHP:

    public function onEnable(){
           
            
    $this->pmsg " You are Playing on SamCraft SkyWars Beta! Tap a Sign to join a Match! ";
           
            
    $this->pmc 0;

            
    $this->getServer()->getScheduler()->scheduleRepeatingTask(new CallbackTask(array($this"popup")),3); //Callbacktask still works lol

    }

    public function 
    popup(){
           
            
    //$tn = substr($this->pmsg,(strlen($this->pmsg)-1)); //Other way
            //$tc = substr($this->pmsg,0,(strlen($this->pmsg)-1));
           
            
    $tn substr($this->pmsg,1);
            
    $tc substr($this->pmsg,1,1);
           
            
    $this->pmsg $tn.$tc;
           
            foreach(
    Server::getInstance()->getOnlinePlayers() as $ppp){
               
                if(
    $ppp->getLevel() == $this->lobby){
               
                    
    $ppp->sendPopup(str_repeat("§4#",25) . "\n§e   " substr($this->pmsg,0,25));
               
                }
            }
           
            
    $this->pmc++;
           
        }
  20. Samueljh1
    Offline

    Samueljh1 Active Member Plugin Developer

    Joined:
    Jan 9, 2015
    Posts:
    316
    Plugins:
    5
    Minecraft User:
    Samueljh1_
    Screenshot ages ago lol ^7527AB03DD6662D328884692095AD9A3076A096FCE6140E4DE^pimgpsh_fullsize_distr.jpg

Share This Page

Advertisement