CommandLimiter - Limit the commands on your server![CodeEx]
=== NOTE: For all intents and purposes this plugin is inactive, though for the life of me I can't figure out how to manually set it as an inactive project, so I have put this notice here for all to read. Sorry about this! Maybe eventually I will come back to it but for now I simply do not have the time. ===
CommandLimiter is the first plugin made by CodeEx team. We were looking around on Bukkit Dev and asking other server owners about what kind of plugin they wanted/needed. After extensive research we believe(hope :P) this may be the first command limiting plugin of its kind released publicly.
Description:
CommandLimiter allows server owners to define a command and how many times it may be used by players on the server. It is very simple to use and very basic even if its your first time working with a properties file or running your bukkit server. Simply place the plugin in the plugins folder and start your server!
NOTE: If you wish to use the command cost function you MUST have vault installed on your server. Get it here: Vault BukkitDev
Features:
- Very easy to configure
- Very easy to set-up and install
- Lightweight data storage, no databases needed
- Configurable messages such as error message, used once message, and no more uses message
- Can set the amount of times each command can be used in the properties
- ANY command can be limited! Even commands with arguments! (Such as /cl reload, etc)
- In-game commands for easily reloading the plugin or purging(resetting) a users data
- Supports permissions! (Tested with BukkitPermissions, should work with all though)
- Allows individual edits to the data via commands! (/cl setlimit)
- NOW WITH v2.4 you can make commands cost money as well! (Uses Vault)
- NOW WITH v2.4 you can set individual cooldown for commands!!
Commands and Permissions:
Permissions
- cl.* description: gives access to all CommandLimiter commands(NOT INCLUDING cl.ignore!)
- cl.reload description: gives access to reload command.
- cl.purge description: gives access to purge command.
- cl.setlimit description: gives access to set command.
- cl.info description: gives access to info command.
- cl.ignore description: plugin completely ignores the group/player with this permission.
Commands
/cl reload - reloads the plugin. You can make any changes to properties file such as adding new commands and use this command to reload everything without having to delete the data file.
/cl purge [name] - RESETS the player's data to the defaults defined in the properties file. Purge might not have been the best name for this command as it is somewhat misleading.
/cl info [name] - shows the number of uses the player has left for every command.
/cl setlimit [name] [command] [limit] - sets the limit for a certain command for a player.
KEEP IN MIND THAT IF YOU ARE OP YOU CAN USE THESE COMMANDS WITHOUT THE NODES LIKE ANY OTHER PLUGIN.
If you are upgrading from v2.1 or lower to v2.4 you MUST delete your entire CommandLimiter folder with database inside for it to function properly!! This is due to the changes made to the structure of the database.
Properties file explained:
Visit: This link
Current bugs:
No bugs have yet been reported :D
To-Do list:
- Look into adding more customizability to messages
- add per group limiting
- add option to have some commands unlimited use and some limited
Changelog:
Version 2.4.2 - Released by JazzKr
- Updated to new event listening system, hopefully will keep it compatible for R5.. if not expect another update soon.
- Note: Overhaul is planned soon.. just as soon as I get some time!
Version 2.4.1 - Released by JazzKr
- Added feature where you can pay once to use a command forever (note: if you delete CL.data this will reset and you will have to pay again!)
- General bug fixes
Version 2.4 - Released by lookatmego and JazzKr
- ADDED cooldown support!
- ADDED economy support! (via vault, so it is now a softdepend)
- Modified entire data storage system to accommodate new features introduced
- Reconstructed many commands to support changes to storage system
- More configurable properties added!
- Changed /cl set to /cl setlimit so other commands for setting cooldown and cost can be added later
- Fixed command handling bug
- General bug fixes
Version 2.1.1 - Release by JazzKr
- Fixed stupid mistake I made with purge command, thanks to lookatmego for catching it!!
Version 2.1 - Release by JazzKr
- Rewrote the way it refreshes the data, now it will also 'trim' so commands that were previously in use are removed from data
- Improved the way it recognizes commands, now if a 'base' command is blocked such as /cl then it will block all commands in that tree (/cl set, /cl purge, etc, any commands that start with /cl)
- Commands with arguments can now be blocked, added a note in properties file that explains how to do this, basically spaces in properties file must have a preceding backslash to them
- Fixed a few issues with the text colouring not showing up the way it should be (if anyone sees any instances of this please leave a comment, didn't have time to go through all colour entries, assuming they are correct until proven wrong)
- Works with CraftBukkit 1.1-R1 as of January 14th, 2012
Version 2.0 - Release by lookatmego
- Added custom messages and colors to properties
- Added commands and permissions and super node
- Added ability to set, purge, and view a player's info
- Added ability to reload plugin
- Redefined way properties file is created
- Cleaned up code and in-game messages
- Cleaned up various debug console messages
Version 1.0 - Release by Jazzkr
- Pre-release of plugin
- Early testing
- Added the properties file
@Robert107
@Crayder
added to the to-do list
@lookatmego
I got the same need that Crayder.
Can you add an option to make -1 the "infinite use" opt? So we can have some commands limited and others ulimited but with cooldown or cost.
@lookatmego
I understand that, but I use a cooldown and limit on some commands and I'm trying to understand how to properly "omit" one of them on a command.
@Crayder
just put /tp as the command and it will take in as the /tp [player] and if you only want cooldown you simple put use-cooldown=true in the config file and put use-cost and use-limit as false. Then put the command as /tp=10 and that will make it a 10 second cooldown
If I was trying to use this with a teleport command like "/ptp" or "/tp", would I set the line to just:
I ask because obviously the real command is "/tp [player]" and I noticed the line about commands with spaces in them so I'm a little confused on how to leverage that.
Also, by omitting limits that we don't want to use in certain commands, how would that be done?
or
@elitefroggy
Added that with 2.4.1, will be up on BukkitDev shortly :)
@lookatmego I mean no offense :-). Just to let you know. :-P
@LordBoos
we can assure you its not a copy and if need be we can provide you with some of our source to prove that. We were originally not adding cooldown and price but only limit since i needed it and your plugin didnt seem to provide that. After people asked for it we ended up adding it in.
Hmm this plugin is very similar to my plugin boosCooldowns :-D. Only difference is that your has limit/price/cooldown, and my has warmup/cooldown/price. And huh, your plugin is not open source?
Just updated the config file explained page. It can be found here: CLick me!
@elitefroggy
Im afraid that is not yet possible we will see if we can make it like that however
can you set a command so that you pay once to use a command forever???
@lookatmego
If you are using system.currentTimeMillis() it is fine. Of course its not the plugins fault, its timing based on bukkit methods that is at fault. Every server out there will see tick degradation from 60 or so players onward.
Alot of plugins take the easy route and scheduleAsyncDelayedTask() (looking at you MyHome).
Using java methods off the main thread, the timer should never be more than a milli or two off. If an async delayed task is used and a delay of 100 ticks is used those 100 ticks have absolutely no real world time attached to them. So when (in myhome) you type /home and it tells you "warming up for 5 seconds" if you arent running at 20/20....well it just looks bad when you finally go home 9 seconds later.
@MonsterTKE
We use System.currentTimeMillis() in order to keep track of time for cool downs. With our calculations and testing it is exact timing everytime so 30 seconds is indeed 30 seconds. You may also notice it MAY be milliseconds off which is not the fault of the plugin or how it was coded, in fact its due to the console which the server is ran on lagging or not being able to keep up.
@CodeEx
Are the cooldowns using bukkit methods based on ticks? Or java.util.timer?
30 second cooldown using bukkit methods is pretty non-deterministic. Using java.util.timer on a separate thread ensures that that the time specified is actually the time elapsed.
If its based on ticks, and if the plugin says "wait 30 seconds" when it really means wait 600 ticks, 600 ticks != 30 seconds.
@nurwin22
We just released latest version with the features you wanted!Enjoy!
@nurwin22
we've already started working on it,however due to school and exams it may take a bit longer than expected so please be patient and stick with us:)
Okie dokie, for sure...
thanks lookatmego =D
i will be patiently waiting for those next releases
@nurwin22
we will look into adding iconomy support,havnt done it before so gotto read up a bit on it. And yes this works with permissions if the admin has cl.ignore permission then they can use every command infinitely but if you do have that permission so for example builders they will only get to use the command as many times as you set it to in the properties. We have not yet added per group support sorrybut will look into it:)
This looks awesome guys...
Could ya'll add iConomy support as well?
You say it works with permissions... Does that mean an Admin can use /tp infinently at no cost, a Regular can use /tp infinently at a lower cost, a Member can use /tp only 10 times at a cost, a Guest can't use /tp... etc.