Thread: [APOLLO] Yell Command

Results 1 to 10 of 10
  1. #1 [APOLLO] Yell Command 
    Donator

    6ix9ine's Avatar
    Join Date
    Oct 2012
    Posts
    626
    Thanks given
    514
    Thanks received
    112
    Rep Power
    582
    So I decided to start working with Apollo, and this is my first contribution to it. You can add colors if your client supports it.

    Credits
    Major - Helped me start learning Ruby and a bug I found
    Graham - For releasing Apollo and helping me with another bug

    You can download the folder [Only registered and activated users can see links. ], extract it to your .\data\plugins folder.

    Or you can just add the code yourself.

    Here is the code

    yell.rb
    Code:
    require 'java' 
    java_import 'org.apollo.game.model.Player'
    java_import 'org.apollo.game.model.Character'
    
    on :command, :yell do |player, command| 
      msg = command.arguments.to_a.join(" ")
      name = player.getName
    
     
      
      World.world.player_repository.each do |player|
        
        if player.privilegeLevel == RIGHTS_ADMIN
          
          player.send_message "[Admin] #{name.capitalize}: #{msg.capitalize}" 
          
        elsif player.privilegeLevel == RIGHTS_MOD
              
         player.send_message "[Moderator] #{name.capitalize}: @[email protected]#{msg.capitalize}"
        
        else
          
          player.send_message "[Player] #{name.capitalize}: @[email protected]#{msg.capitalize}"
      end
      
      end
    end
    plugin.xml
    Code:
    <?xml version="1.0"?>
    <plugin>
      <id>yell</id>
      <version>1</version>
      <name>Yell</name>
      <description>Yells the player input.</description>
      <authors>
        <author>Minor</author>
        <author>Graham</author>
        <author>Major</author>
      </authors>
      <scripts>
        <script>yell.rb</script>
      </scripts>
      <dependencies />
    </plugin>
    Quote Originally Posted by Huey View Post
    Because of all the nub syipkpkers nulls that runs in no way to stop them ***gots. There runing everything yyou can't even enjoy an fucking server with out an asshole with his head stuck up his *** crashing an server. Every fucking 10 minutes an asshole always log on server crashing it because of the ***got who made it... So how the hell do yall stand these ***gots that's crashing server. Damn people just move on do something else play warock or something that's what im about to start playing... if you would like to add me its [Only registered and activated users can see links. ] it was nice knowing ya rune-server and burn in hell server crashers
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jul 2009
    Posts
    4,003
    Thanks given
    1,003
    Thanks received
    1,029
    Rep Power
    0
    goodjob, although I don't use Apollo I ain't even a coder
    Reply With Quote  
     

  3. #3  
    Donator

    6ix9ine's Avatar
    Join Date
    Oct 2012
    Posts
    626
    Thanks given
    514
    Thanks received
    112
    Rep Power
    582
    Quote Originally Posted by Melody View Post
    goodjob, although I don't use Apollo I ain't even a coder
    Thanks Apollo is fun
    Quote Originally Posted by Huey View Post
    Because of all the nub syipkpkers nulls that runs in no way to stop them ***gots. There runing everything yyou can't even enjoy an fucking server with out an asshole with his head stuck up his *** crashing an server. Every fucking 10 minutes an asshole always log on server crashing it because of the ***got who made it... So how the hell do yall stand these ***gots that's crashing server. Damn people just move on do something else play warock or something that's what im about to start playing... if you would like to add me its [Only registered and activated users can see links. ] it was nice knowing ya rune-server and burn in hell server crashers
    Reply With Quote  
     

  4. #4  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    27
    Posts
    16,200
    Thanks given
    7,190
    Thanks received
    12,174
    Discord
    View profile
    Rep Power
    5000
    name = player.getName

    can be player.name




    player.privilegeLevel

    can be player.privilege_level



    the 'end' on line 24 should be aligned with the loop statement

    remove the random white space after each if/else statement lol





    apart from that gj

    [Only registered and activated users can see links. ]



    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Donator

    6ix9ine's Avatar
    Join Date
    Oct 2012
    Posts
    626
    Thanks given
    514
    Thanks received
    112
    Rep Power
    582
    Quote Originally Posted by Scu11 View Post
    name = player.getName

    can be player.name




    player.privilegeLevel

    can be player.privilege_level



    the 'end' on line 24 should be aligned with the loop statement

    remove the random white space after each if/else statement lol





    apart from that gj
    Haha thanks for the points, I just thought the white space would look cleaner but I guess not. I will remember that for the future
    Quote Originally Posted by Huey View Post
    Because of all the nub syipkpkers nulls that runs in no way to stop them ***gots. There runing everything yyou can't even enjoy an fucking server with out an asshole with his head stuck up his *** crashing an server. Every fucking 10 minutes an asshole always log on server crashing it because of the ***got who made it... So how the hell do yall stand these ***gots that's crashing server. Damn people just move on do something else play warock or something that's what im about to start playing... if you would like to add me its [Only registered and activated users can see links. ] it was nice knowing ya rune-server and burn in hell server crashers
    Reply With Quote  
     

  7. #6  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    27
    Posts
    16,200
    Thanks given
    7,190
    Thanks received
    12,174
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Minor View Post
    Haha thanks for the points, I just thought the white space would look cleaner but I guess not. I will remember that for the future
    makes it harder to read if anything, have to search for what is corresponding to what as opposed to looking directly below etc

    [Only registered and activated users can see links. ]



    Reply With Quote  
     

  8. #7  
    Registered Member

    Join Date
    Feb 2012
    Posts
    901
    Thanks given
    96
    Thanks received
    480
    Rep Power
    654
    Nice to see the start of a new plugin developer. When taking into account the tips Scu11 gave you, you did a good job.

    Keep up the good work, and never stop learning.
    Chris Fletcher
    Economist & Hobbyist Developer
    Reply With Quote  
     

  9. #8  
    Donator

    6ix9ine's Avatar
    Join Date
    Oct 2012
    Posts
    626
    Thanks given
    514
    Thanks received
    112
    Rep Power
    582
    Quote Originally Posted by Chris Fletcher View Post
    Nice to see the start of a new plugin developer. When taking into account the tips Major gave you, you did a good job.

    Keep up the good work, and never stop learning.
    Thanks, coming from an experienced Apollo developer that means a lot
    Quote Originally Posted by Huey View Post
    Because of all the nub syipkpkers nulls that runs in no way to stop them ***gots. There runing everything yyou can't even enjoy an fucking server with out an asshole with his head stuck up his *** crashing an server. Every fucking 10 minutes an asshole always log on server crashing it because of the ***got who made it... So how the hell do yall stand these ***gots that's crashing server. Damn people just move on do something else play warock or something that's what im about to start playing... if you would like to add me its [Only registered and activated users can see links. ] it was nice knowing ya rune-server and burn in hell server crashers
    Reply With Quote  
     

  10. #9  
    REGISTERED MEMBER RAT DONOR MORE COMING

    Major's Avatar
    Join Date
    Jan 2011
    Posts
    3,002
    Thanks given
    1,295
    Thanks received
    3,549
    Rep Power
    5000
    'player.getName' can be written as 'player.name', same with the privilege level variable.

    Edit: Scu beat me to it. Change this!

    Nice work!

    Quote Originally Posted by Chris Fletcher View Post
    When taking into account the tips Major gave you, you did a good job.
    What's this supposed to mean ??
    Reply With Quote  
     

  11. #10  
    Registered Member

    Join Date
    Feb 2012
    Posts
    901
    Thanks given
    96
    Thanks received
    480
    Rep Power
    654
    Quote Originally Posted by Major View Post
    What's this supposed to mean ??
    Sorry, confused you two. Changed it.
    Chris Fletcher
    Economist & Hobbyist Developer
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 50
    Last Post: 04-17-2014, 02:19 PM
  2. [Apollo] The 'giveRights' command, done right.
    By Chris Fletcher in forum Tutorials
    Replies: 16
    Last Post: 10-13-2012, 12:43 AM
  3. Yell Command Help
    By Sup Nig in forum Help
    Replies: 2
    Last Post: 09-08-2012, 11:40 PM
  4. [PI] A better yell command.
    By phl0w in forum Snippets
    Replies: 15
    Last Post: 03-22-2012, 12:44 PM
  5. Yell Command
    By Kamiel in forum Snippets
    Replies: 4
    Last Post: 11-06-2011, 10:04 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •