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

Text won't show for chat

Comments in 'Plugin Development' started by Legomite, Feb 16, 2014.

  1. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    It has gotten to me that after testing the plugin I made when I use the if statements only 2 responses will be made.
    example:
    What is NOT suppose to happen.
    /siri hello (response
    /siri kill everybody (response
    /siri increase brightness (no response
    Every other one returns no response
    ( I cut out the arrays,don't worry! There still there!)

    What suppose to happen
    /siri hello (response
    /siri kill everybody (response
    /siri increase brightness (response
    everything else has a response.

    I'm sorry if this does not make sense. I'm pretty sure it don't make sense to most of you.

    POlease tell me if you find a sullotion.

    If you want the WHOLE code click here, https://github.com/Legomite/Siri

    PHP:

    if (strpos($subcmd'hi') !== false || strpos($subcmd'hey') !== false || strpos($subcmd'hello') !== false || strpos($subcmd'howdy') !== false || strpos($subcmd'greetings') !== false) {
                
    $issuer -> sendChat($hello[array_rand($hello)]);
            } elseif (
    strpos($subcmd'kill') !== false || strpos($subcmd'murder') !== false || strpos($subcmd'slaughter') !== false) {
                if (
    strpos($subcmd'everyone') !== false || strpos($subcmd'all') !== false || strpos($subcmd'every') !== false) {
                    
    $issuer -> sendChat($kill[array_rand($kill)]);
                    
    $this -> api -> console -> run("kill @a");
                } elseif (
    strpos($subcmd'day') !== false || strpos($subcmd'increase') !== false || strpos($subcmd'light') !== false || strpos($subcmd'up') !== false) {
                    
    $user strtolower($args[0]);
                    
    $issuer -> sendChat($brightincrease[array_rand($brightincrease)]);
                    
    $this -> api -> time -> day();
                } elseif (
    strpos($subcmd'night') !== false || strpos($subcmd'decrease') !== false || strpos($subcmd'dark') !== false || strpos($subcmd'down') !== false) {
                    
    $user strtolower($args[0]);
                    
    $issuer -> sendChat($brightdecrease[array_rand($brightdecrease)]);
                    
    $this -> api -> time -> night();
                } elseif (
    strpos($subcmd'weather') !== false || strpos($subcmd'forecast') !== false) {
                    
    $issuer -> sendChat($weather[array_rand($weather)]);
                } elseif (
    strpos($subcmd'what') !== false || strpos($subcmd'search') !== false) {
                    if (
    strpos($subcmd'minecraft') !== false) {
                        
    $user strtolower($args[0]);
                        
    $issuer -> sendChat($minecraft[array_rand($minecraft)]);
                        
    $issuer -> sendChat("Minecraft was made back in 2009");
                        
    $issuer -> sendChat("Minecraft was founded my Notch");
                        
    $issuer -> sendChat("Notch gave the lead development");
                        
    $issuer -> sendChat("of Minecraft to Jeb");
                        
    $issuer -> sendChat("for more info go to http://minecraft.gamepedia.com/");
    [
    PHP]
    Last edited: Feb 16, 2014
  2. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    41
    Minecraft User:
    ZexyZek
    Hey, My name is Joy Islam,

    And can you make it where you just chat siri <text> it sends you a message.

    Thanks,
    Joy Islam"
  3. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    What do you mean?
  4. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    41
    Minecraft User:
    ZexyZek
    An Example Plugin: NoobBlocker ;)
  5. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    41
    Minecraft User:
    ZexyZek
    Instead of /$cmd

    You just chat "siri (text/message)
  6. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    That is obviously off topic. Have you noticed my first problem?
  7. BeastBajan15
    Offline

    BeastBajan15 Active Member

    Joined:
    Feb 16, 2014
    Posts:
    41
    Minecraft User:
    ZexyZek
    I look into the code, Its kinda messy but nice job anyway,
    And thats a suggestion ;)
  8. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    It's been formatted. It looks horrible to me
  9. Legomite
    Offline

    Legomite Active Member Plugin Developer

    Joined:
    Sep 8, 2013
    Posts:
    470
    Plugins:
    2
    Minecraft User:
    Legomite
    Then you lose your freedom to say the word siri? I have no current plans.

Share This Page

Advertisement