[ADMN/MISC] ButtonControl v3.0 - Control the weather/time with buttons [Vault] [1531]

Discussion in 'Inactive/Unsupported Plugins' started by Johni0702, May 27, 2011.

  1. Offline

    Johni0702

    ButtonControl
    v3.0
    BukkitDev (download here)



    As of the fact i recoded the whole datastructure of the plugin, all configfiles before 3.0 are NOT compatible with newer versions!


    A simple plugin to control the weather or time with buttons. Your servervisitors can switch the weather and time for free or for items (Vault economy is supported too). You can use Buttons or Pressure Plates. I´ll include new things too, simple write it in the comments.

    Features:
    • Control weather or time using buttons
    • Control weather or time can cost something
    • You can use (Stone) Pressure Plates too
    • All messages can be modified
    • Vault economy support
    • MultiWorld
    • BukkitPermissions support
    • Cooldown
    How to set buttons:

    The command depends on wheather Vault is installed or not.
    With Vault (open)

    1.type (buttoncontrol.set Permission needed)
    "/buttoncontrol <sunny/rain/thunder/day/night> <Money> <Receiver>"
    or
    "/bc <sunny/rain/thunder/day/night> <Money> <Receiver>"

    <Receiver> is the person who gets the money whenever some uses the button/pressureplate

    Without Vault (open)


    1.type (buttoncontrol.set Permission needed)
    "/buttoncontrol [sunny/rain/thunder/day/night] <amount> <item>"
    or
    "/bc [sunny/rain/thunder/day/night] <amount> <item>"


    2.You´ll get a message "Press a button!"
    3.Do what the message says.
    Press the button/pressure plate which should become the rain/thunder/stop/day/night button.
    4.If you get an other message, the creation was succesfull

    How to remove buttons:
    Destroy them ingame and they´r gone. (if you have permission to do so)

    How to use buttons:
    1(only without Vault).Take the required items in your inventory.
    2.Click the button./Walk on the pressure plate.
    3.You get a message and your "money" was take away
    4.Look at the sky -> the weather/time changed

    Permissions:
    To set Buttons: buttoncontrol.set
    To destroy Buttons : buttoncontrol.destroy
    To use buttons:
    -day: buttoncontrol.time.day
    -night: buttoncontrol.time.night
    -sunny: buttoncontrol.weather.sunny
    -rain: buttoncontrol.weather.rain
    -thunder: buttoncontrol.weather.thunder

    Configuration:
    Default conig file:
    Code:
    Cooldown: 0 //time in sec you have to wait befor an button can be pressed again
    Buttons: []          //DO NOT CHANGE ANYTHING HERE (exept you know what you do)
    Duration:              //how long the changed weather MUST be in secounds(if not changed again)
        thunder: 10
        rain: 10
        sun: 10
    messages:  //a lot of configurable messages
        ...
        ...
    
    Github

    Todo:
    • Add iConomy support(Vault)
    • Add permissions support
    • Add Essentials support(Vault)
    • Add MultiWorld support
    • Search bugs
    • Fix bugs
    • Add BOSEconomy support(Vault)
    • You can set the money for every button different
    • add an account that earns money when a player pushs an button
    • add an cooldown
    Changelog:

    v 3.0:
    • Recoded the inner data structure of the plugin
    • Updated to new Listener API
    • Updated to BukkitPermissions
    • Added Vault support instead of only iConomy
    v 2.3:
    • Added an Cooldown
    • Added an account that earns money if an player pushs an button
    • fixed "No Permissions" message
    Older Changes (open)

    v 2.2:
    • Addded Permissions support (thx to flames)
    • Fixed: If a button is free , now you can hold anything in your hand
    • Fixed: All the time MultiWorld didn´t work
    v 2.1.1:
    • Fixed Bug: iConomy takes one prize even if the buttons have all different
    v 2.1:
    • All buttons can cost different
    v 2.0:
    • Renamed the plugin from "ButtonWeather" to "ButtonControl"
    • Added: control time by buttons/pressure plates
    • fixed one very little bug
    v 1.5.2:
    • fixed bug again: changed messages didn´t load from the config
    v 1.5.1:
    • fixed bug: changed messages didn´t load from the config
    v 1.5:
    • fixed bug: if you hold the exact amount of money it won´t disapear
    • added Pressure Plates support
    • fixed bug: if you break an button and anyone (without he´s OP) place it again, the button works
    v 1.4:
    • all messages can be changed in the config now
    v 1.3:
    • now you haven´t to take the EXACT amount of money in your hand
    v 1.2.3:
    • fixed error if klick in the air
    v 1.2.2:
    • fixed an bug in the savesystem that saved the count of the stop/thunder buttons wrong
    v 1.2.1:
    • fixed an bug on the stormbutton
    • fixed an bug in the savesystem
    v 1.2:
    • added MultiWorld support
    • fix a lot of bugs
    • now unlimited buttons can be set
    • changed weather is now longer (configurable)
    v 1.1:
    • added iConomy support
    v 1.0:
    • Main plugin
     
    nicoxxl, vrox and Lolmewn like this.
  2. Offline

    tytytoy

    hey when are you going to add Essentials support because i use essentials but it wont work with it yet plz tell and add essentials support (hopefuly soon)
     
  3. Offline

    SphereCat1

    Awesome idea! Would it be possible to add lever support, so you could use a lever to lock each option as on or disabled? When the lever is on, it would force the option to happen, and when it's off, it would let the normal behavior happen. So for example you could configure a lever to make it always day when on, and do the normal cycle when off. Or, a lever to disable rain when on, and rain randomly as usual when off.

    Thanks!
    SphereCat1

    EDIT: I also noticed that wooden pressure plates don't work, only stone. Not critical, just moderately annoying.
     
  4. Offline

    Johni0702

    i think i´ll add lever.
    oh damm. i didn´t noticed that wooden and stone pressure plates have different numbers
     
  5. Offline

    Victor S.S

    i really like this plugin but when i change in the cong file UseIconomy to true i get this error :

    19:13:56 [GRAVE] Error occurred while enabling ButtonControl v2.2 (Is it up to d
    ate?): null; mapping values are not allowed here
    mapping values are not allowed here
    in "<reader>", line 27, column 32:
    useiConomy: true account:
    ^
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:74
    5)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.ja
    va:307)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:18
    3)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Par
    serImpl.java:564)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :228)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java
    :230)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:12
    2)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseCons
    tructor.java:124)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
    at org.bukkit.util.config.Configuration.load(Configuration.java:82)
    at me.johni0702.ButtonControl.ButtonControl.loadFile(ButtonControl.java:
    145)
    at me.johni0702.ButtonControl.ButtonControl.onEnable(ButtonControl.java:
    125)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:878)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:272)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:162)
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:146
    )
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
    at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  6. Offline

    Johni0702

    please show me your config.
     
  7. Offline

    Victor S.S

    there it is ^^
    Cost:
    Item: 331
    Messages:
    day_set: The day-button has been set.
    day_comes: Good morning!
    night_set: The night-button has been set.
    thunder_set: The thunder-button has been set.
    rain_set: The rain-button has been set.
    sunny_set: The sunny-button has been set.
    rain_comes: Let it rain
    not_use: You don't have permission to use button controls
    sun_comes: The sun comes out.
    night_comes: It's late, go home.
    not_enough_money: You don't have enough money
    not_permissions: You have no permissions to set button controls.
    push_a_button: Push a Button!
    thunder_comes: GO! A STORM IS COMING!
    Buttons:
    RainAnzahl: 0
    SunnyAnzahl: 0
    ThunderAnzahl: 0
    Duration:
    thunder: 10
    rain: 10
    sun: 10
    iConomy:
    useiConomy: true account:
    Cooldown: 0
     
  8. Offline

    Johni0702

    you haven´t set an account. so it should work (the red thing is new):
    Show Spoiler

    Cost:
    Item: 331
    Messages:
    day_set: The day-button has been set.
    day_comes: Good morning!
    night_set: The night-button has been set.
    thunder_set: The thunder-button has been set.
    rain_set: The rain-button has been set.
    sunny_set: The sunny-button has been set.
    rain_comes: Let it rain
    not_use: You don't have permission to use button controls
    sun_comes: The sun comes out.
    night_comes: It's late, go home.
    not_enough_money: You don't have enough money
    not_permissions: You have no permissions to set button controls.
    push_a_button: Push a Button!
    thunder_comes: GO! A STORM IS COMING!
    Buttons:
    RainAnzahl: 0
    SunnyAnzahl: 0
    ThunderAnzahl: 0
    Duration:
    thunder: 10
    rain: 10
    sun: 10
    iConomy:
    useiConomy: true account: NONE
    Cooldown: 0


    Edit: you can put configs,consoleoutput,etc. in a spoiler:
    simple use
    Code:
    [SPOILER]here comes the config[/SPOILER]
     
  9. Offline

    Victor S.S

    Thanks its now working !!:D
     
  10. Offline

    Deathnite

    Idk if this is my fault or if its script, but when i push the button i get charged 2 times.
    once for when i press the button and once when i release.
    AND
    everytime i relog the code on the button disapears...

    my script:
    Code:
    Cost:
        Item: 331
        Amount: 2
    Messages:
        day_set: The day-button has been set.
        day_comes: Good morning!
        night_set: The night-button has been set.
        thunder_set: The thunder-button has been set.
        rain_set: The rain-button has been set.
        sunny_set: The sunny-button has been set.
        rain_comes: Let it rain
        not_use: You don't have permission to use button controls
        sun_comes: The sun comes out.
        night_comes: It's late, go home.
        not_enough_money: You don't have enough money
        not_permissions: You have no permissions to set button controls.
        push_a_button: Push a Button!
        thunder_comes: GO! A STORM IS COMING!
    Buttons:
        RainAnzahl: 0
        SunnyAnzahl: 5
        ThunderAnzahl: 0
        DayAnzahl: 5
        NightAnzahl: 0
        Sunny:
            Y:
                '0': 67
                '1': 67
                '2': 67
                '3': 67
                '4': 67
            cost:
                '0': 0
                '1': 0
                '2': 5
                '3': 5
                '4': 5
            X:
                '0': 50
                '1': 50
                '2': 50
                '3': 50
                '4': 50
            world:
                '0': DevilTrigger Craft
                '1': DevilTrigger Craft
                '2': DevilTrigger Craft
                '3': DevilTrigger Craft
                '4': DevilTrigger Craft
            Z:
                '0': 202
                '1': 202
                '2': 202
                '3': 202
                '4': 202
        day:
            Y:
                '0': 67
                '1': 67
                '2': 67
                '3': 67
                '4': 67
            cost:
                '0': 0
                '1': 0
                '2': 5
                '3': 5
                '4': 5
            X:
                '0': 50
                '1': 50
                '2': 50
                '3': 50
                '4': 50
            world:
                '0': DevilTrigger Craft
                '1': DevilTrigger Craft
                '2': DevilTrigger Craft
                '3': DevilTrigger Craft
                '4': DevilTrigger Craft
            Z:
                '0': 204
                '1': 204
                '2': 204
                '3': 204
                '4': 204
    Duration:
        thunder: 10
        rain: 10
        sun: 10
    iConomy:
        useiConomy: false
        account:
    Cooldown: 0
    
     
  11. Offline

    Johni0702

    you have set every button 5 times:
    Code:
    world:
                '0': DevilTrigger Craft
                '1': DevilTrigger Craft
                '2': DevilTrigger Craft
                '3': DevilTrigger Craft
                '4': DevilTrigger Craft
     
  12. Offline

    Deathnite

    thats correct, but everytime i restart the server, the buttons code disapear. so when i click it nothing happens. (it works be4 the restart)
     
  13. Offline

    Henker355

    Hello There!
    I have install your Plugin v2.3. On my Server runs SuperPerms and Superperm Bridge.
    CraftBukkit 1060 runs on the Server too. After Restart no Failure Notice! But it dosen`t create a "config.yml". I have write the config self. Your Example was my assistance.
    Code:
    Cooldown: 0 //time in sec you have to wait befor an button can be pressed again
    
    Cost:
      Item: 331      //what item weatherchanging costs (set to 0 for free change)
    iConomy:
      useiConomy: true     //set to "true" if you want to use iConomy
      account: buttonmoney //the account that earns money if somebody pushs an button
    Buttons:            //DO NOT CHANGE ANYTHING HERE
        StormAnzahl 0
        RainAnzahl 0
        StopAnzahl 0
        DayAnzahl 0
        NightAnzahl 0
    Duration:              //how long the changed weather MUST be in minutes(if not changed again)
        thunder 10
        rain 10
        sun 10
    messages:   //a lot of configurable messages
        ...
        ...
    I can set an bind the Button`s. But if i use the Button.. i become the Notice:
    "You don`t have enough money".
    I have 3000 Money.
    Can you help me please? Where is my Failure?
    I can`t found him.
     
  14. Offline

    DQuaN

    Any plans to update this? Mine has stopped working with the latest build.
     
  15. Offline

    Jay101

    i would like to see an update too :)
     
  16. Offline

    JustT0by

    Da wir beide aus Deutschland sind schreibe ich es mal auf Deustch ;)
    Einen Button erstellen klappt wunderbar, nur wenn ich den dann drücke (als OP oder Admin oder sogar als User)
    passiert rein gar nichts. Die Console spuckt auch nichts aus.
     
  17. Offline

    Caedes

    I have this plugin and it doesn't work. I can create a thunder button but I can't use it. It don't get any message or error. Doe anyone know what is this bug? I use last recommanded version of server.
     
  18. Offline

    Inf

    Would someone pick this up? I couldnt find any plugin that has the same features :(
     

Share This Page