cmdBook
cmdBook
About:
cmdBook is a plugin that allows you to execute and store multiple commands. You just have to put the commands (or chat text) in a book, and use a command to make it a cmdbook. Whenever you left click with that book, your commands will be executed. You can specify variables so that you can replace them with (F.ex : your player name , the player you are looking at,..) and you can add javascript to it
Version Information
Latest Version: 1.4.5
Release date: 15/12/2013
Upcomming Features
- Basic Logic (If statements , for loops , custom variables)
- Devide this page into other pages (permissions, configuration , examples ,..) (planned 1.4.0)
- Compatibility with Skript and CmdHelper to use WITH a book
- A youtube tutorial (planned 1.4.x)
- Config editor ingame (planned 1.5.0)
Compatibility
cmdBook works with most book related plugins.
Contribute
Do you like cmdBook ant you want to help me expand it even further? Any donation will be welcome (Even if it is just enough so I can buy a cup of coffee while programming) The Source code is also available if you have remarks about the code. NOTE: You may not copy any of the code without asking me
Commands
# NOTE: /cb OR /cbook can be used # Create a cmdBook with the written book in your hand /cb create # Edit/Add commands in a cmdBook (Other books are blocked) /cb edit # List the commands inside a cmdBook /cb info # Show plugin information /cb about # Make a normal book private /cb private # Make a normal book public /cb public # Reload the configuration /cb reload # Convert deprecated variables /cb convert # Show ingame variables and info /cb variables
Permissions
cmdBook uses permissions to define who may create/use a cmdbook.
Create a cmdBook
Ok, to create a cmdBook you need a few things:
- You have to get the rights to make one
- You have to get the rights to use on (not necessarily if you only intend to make it)
- You need a Writable book
- Start you book with: [cmdbook]
- Create a new line and you can type your first command F.ex /broadcast Hello World!
- Split your commands with the character: | OR split commands by starting a new page
- Create a second command , third ,....
- Sign your book
- Type the command /cb create while holding the book in your hand
- Now left click the book to perform the commands
Variables
You can define several variables to replace
# Run every command as console: @runconsole # TIP: You might want to use $chat[..] if you want to let the player use a command without op perm. # Hide all cmdBook messages # This will hide thinigs like " Command performed" or " waiting.." @hidemessages # This will be replaced with the name of the player that uses the book $player # This will be replaced with the player you are clicking on $targetplayer # This will give you an integer with your health $health # This will give you a decimal with your xp $xp # This will give you a decimal with your target's xp $targetxp # This will give you an integer with your level $lvl # This will give you an decimal with your target's level $targetlvl # This allows you to see your hunger as integer (0-10) $hunger # This allows you to see your target's hunger as integer (0-10) $targethunger # This will give you your killers name $killer # This will give you the name of your target's killer $targetkiller # This will give your X position $xpos # This will give your Y position $ypos # This will give the xpos of the block you look at $losx # This will give the ypos of the block you look at $losy # This will give the zpos of the block you look at $losz # Input - A very handy variable: # The input variable will prompt the player before all commands are executed # The data the player enters in chat after getting prompted (without any use of commands, just plain text) # will replace the input variable $input -> When using it in this format , it will just ask for an input $input[Question here] -> put [text] to customize your question # When using @input instead of $input, it will input the user at the beginning of the book # the $input will only input right before the command will be executed # Delay - variable is $wait[int] replace int with a number # This will cause the command execution to Pause (in ms) $wait[int] # Execute javascript, create a variable 'output' this variable will replace the script[**] $script[javascript here] $script[var dNow = new Date();var output = 'Today is ' + dNow.getDate();] # Make a simple calculation $calc[1+2] $calc[$losy+1] # Send a private message to the player $msg[messagehere] # Broadcast a message $broadcast[HEllo There!] # Send player chat $chat[..] # Only required when using @runconsole # MAKE SURE TO USE /cb variables for all **40** variables
Examples
Ex1:
[cmdbook] /give $player cookie 1| I got a cookie :D|
Ex2:
[cmdbook] $targetplayer You have been caught griefing!| /ban $targetplayer Griefing Visual proof| /resident delete $targetplayer|
Ex3:
[cmdbook] /lb lookup player $targetplayer block 56 area 100 time 30 minutes|
Ex4:
PAGE1: [cmdbook] This is my first page| HELLOOWW PAGE2: This is my second command| /give $player cookie 10| :D PAGE3: The End
Ex5:
[cmdbook] /ban $targetplayer $input[Why ban him?]| /lb rollback player $targetplayer time $input[How many days you want to rollback him?] days| $wait[2000]| /yes| $wait[10000]| /no
Ex6:
# permissions needed: - cmdbook.variable.runconsole - cmdbook.use [cmdbook] @runconsole /give $player cookie 1
Ex7:
Will act like WorldEdit compass the calc adds 1 block to the y axis, so you dont teleport IN the block [cmdbook] /teleport $losx calc($losy+1) $losz
Updating
This plugin utilizes an external version checking system, which means that the plugin makes a connection to curseforge.com and the following may occur:
The plugins version checked against approved files Downloading of the plugin files Launching of the plugin files downloaded You can disable the check and/or automated download via the configuration of this plugin.
Metrics
This plugin utilizes Hidendra's plugin metrics system, which means that the following information is collected and sent to mcstats.org:
A unique identifier The server's version of Java Whether the server is in offline or online mode The plugin's version The server's version The OS version/name and architecture The core count for the CPU The number of players online The Metrics version You can disable the stat collection via /plugins/PluginMetrics/config.yml if you wish.
Changes
Version 1.4.5
Status: Optional
- Moved /cb to an alias command of /cbook. You can now use /cb OR /cbook but /cb will be overridden by other plugins
- Fixed some small bugs
Version 1.4.3
Status: Higly Recommended
- Added @name[namehere] (put anywhere in your book) to name books
- Added permissions based on name "cmdbook.book.namehere" for individual permissions per book
- Fixed several bugs with "You do not have permissions!" messages
- Updated to 1.6.4
Click here to see all version changes
The Advantages of creating TeleportPads with cmdBook
Version 1.3.6 has been uploaded Please note: The functions @uses[..] @destroywhenused and @pay[] have not been tested in pressureplate cmdBooks yet
Version 1.3.6
Status: Minor + Bugfixes
STATUS UPDATE 18:41 (GMT+1)
I can normally start working on it in the week-end, it shouldn't take more than a few hours to make that.
When updates are you going to do? about @uses[1] @price[100] .. etc..
It`s important :(
hurry hurry! you can do it !!! :)
Or
Can we put the cooldown? now?
ATTENTION
THERE IS A BUG: In 1.3.4 and 1.3.2 the autoUpdater will downgrade your version to 1.3.0. Please set the autoupdater to off!!
PS: cmdBook 1.3.5 should also work on 1.4.6
Metrics
The Metrics graph for cmdBook usages is finally working for servers using 1.3.2 <
http://metrics.griefcraft.com/plugin/cmdBook
@boozaa
Well it is one of the upcoming features. But is not yet available.
Hello, i read for the very first time the docs of your plugin.
I would like to know if it is able to do command first time using and disappear ?
I continue reading...
Ok so I've uploaded two more versions with several fixes, the 1.3.2 is already available for download
Version 1.3.3
Status: Release - Minor But recommended
Version 1.3.2
Status: Release - Minor
It looks like you spent a lot of time on this. Great job :D
I've uploaded a version for Bukkit 1.4.7. NOTE: It does not work on 1.4.6!!!
Version 1.3.1
Status: Release - Mayor
Sry for the delay, but I want to change some of the permissions, without servers having to change all the permission nodes again.
Also wanted to test something:
[cmdbook]
@runconsole
@hidemessages
$msg[&6* &eWelcome to MyServer!]|
$wait[1000]|
$msg[&6* &eBefore you may build, you have to do a little exam!]|
$wait[1000]|
$msg[&6* &eOk, here comes the question...]|
/kick $script[if ("$input[I am allowed to grief and steal (true/false)]"=="true"){ var output="$player"}] Wrong answer!|
$msg[&6* Congrats! You finished the exam!!!!]|
$msg[&6Type this in chat "secretpass"]
This line:
/kick $script[if ("$input[I am allowed to grief and steal (true/false)]"=="true"){ var output="$player"}] Wrong answer!|
is special
So what happens: first the $player and $input[...] gets replaced, lets say he said "true"
/kick $script[if ("true"=="true"){ var output="Maximvdw"}] Wrong answer!|
The the script gets parsed, and because it is true that "true"=="true" Variable output gets defined "Maximvdw"
so it will give:
/kick Maximvdw Wrong answer!|
causing the player to get kicked, and the book stops sending to the player
When he answers false: it will be
/kick null Wrong answer!|
Just a sneak peak ;)
ATTENTION: There are some bugs when using the new Bukkit 1.4.7 beta build but I wont be able to fix it till next week I think this applies to most of the plugins that have not been updated yet, so I reccomend staying on 1.4.6 R0.3 for a few days
The 1.3 file still needs to be approved, but there are some new features that will be added in the next update:
- Color formatting in inputs and messages(new)
- Messages : msg[&cHello] or broadcast[&cHello] just to make things easier ;)
- JavaScript in books : Script[js here] make a variable output to replace the script[] with that variable
- Fixing several bugs
- calc() will be changed to calc[] but there will be a converter command to change that in already made cmdBooks
- Will look into the 'cmd spit by page' that has been added in 1.1.1 I think it better can be toggled, as some commands or text can be longer than one page
@Maximvdw That's gonna be sweet! Thanks for the changes, for sure going to make good use of this now. :D
@Snowybearr
Ok so the file is ready, it just needs to be approved:
you will need following permissions:
USERS:
- cmdbook.variable.runconsole
- cmdbook.variable.hidemessages
- cmdbook.use
you need to make a book with following content:
[cmdbook]
@runconsole
@hidemessages
/tp $player $targetplayer
This will teleport $player to the location of the player he is looking at without the need of the tp permission (just an example)
the hidemessages will hide "cmdbook performed commands.." and "Sleeping xxxx" when using $wait, $input will still input the user
I hope this will suite your needs (the file will be approved asap)
NOTE: It does not mather where you place @runconsole.. it can even be between two words. So if you forgot to place it, its no big deal :)
gr,
Maxim
@Snowybearr
even that will be added in 1.3 f.ex [Cmdbook] @runconsole @hidemessages /say test
will output <console> test
@Maximvdw
Aw poo, well then this won't really work for me. I thought the whole 'cmd' bit of the title meant it ran the commands through the console, as the server, not the player.