Fun 1.0

Remember commands like !coke and !cookie? (Not Skript)

  1. Scorpion
    Warning!! This is not a Skript!

    Some of you know about Skript(i personally don't, the only thing i know about it is that its not exacly like Java), some of you heard of Java others of JavaScript and a few rare ever heard of MSL or MRL something down that line, here an example:

    Code (Text):
    on $*:text:/^[[email protected]](cola|cookie|koekje)/Si:#:{
      if (%funspam [ $+ [ $nick ] ]) { notice $nick Please dont spam. | halt }
      set %funspam $+ $nick true
      timerspam $+ $nick 1 5 unset %funspam $+ $nick
      if (cola !isin $1) {
        inc %cookies
        var %funmsg = $iif($left($1,1) == @,msg $chan,notice $nick)
        %funmsg Gives $nick a cookie! Cookies given %cookies
      else {
        inc %cola
        var %funmsg = $iif($left($1,1) == @,msg $chan,notice $nick)
        %funmsg Gives $nick a glass of coke! Glasses of cokes handed out: %cola

    /fun <command> *example: /fun coke*

    Permissions: none

    A small code to give a coke or a cookie. BUT some dont like Skript and i dont even know what the hell it is, so i thought i'd bring something like that thing above into Java


    The setup is simple as can be, You load up this plugin into your plugin folder like any other non Skript plugin as again, this is not Skript!

    After you loaded it up check for any errors as i only tested it on 1.8.7 but since it doesnt use much other then skull items and regular Materials it should work on all versions.

    The config is playable in which i mean u can add commands rather than me having to add new 1s when you want a chocolate bar instead of a cookie.
    Like so:

    Code (Text):
        total: 0
        skull: 'Yeah_1234'
        type: 'skull'
        total: 0
        skull: 'none'
        type: 'material'

    To create a new "command" you need to copy 1 of these default settings and adjust accordingly, there are 2 ways to do this: The coke is run via skulls which are names of people from various websites then the plugin translates that name into a uuid and does some magic with it and gives you a coke head.

    The cookie however is a minecraft item meaning it uses material. To define which does what you need to tell the config/plugin what type it is via "skull" or "material" at "type:" and it will sort itself out.

    When choosing skull do not forget to put a name in else it will just give a head or crash out cause it doesnt know what to do.

    Lets make a pancake with cyrup command:
    To do this you do the following.
    Same as coke type:
    Code (Text):
    After u done that u need to give it 3 things that it will use when you do /fun pancake
    Code (Text):
      total: 0
      skull: 'Weed_Pancakes'
      type: 'skull'
    After you done that save the config, a reload shouldn't be required as it matches the command with the config each time its used with a 24h timer so any command can only be used ones a day this to save from lagg/spammers etc.

    To test your newly created command type /fun pancakes and a msg saying [pancake] pancakes given: 1(as its only been used 1s) and a pancake skull should appear in your inventory.

    Got questions? idea's? let me know!

    - Make colors changeable.
    - Make msgs configurable.
    - Suggestions?

    Not a must as always nothing is but this helps and motivates me to improve the plugin alot more :)