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.3.6
Release date: 2/02/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)
- Variables list ingame (planned 1.3.2)
- Config editor ingame (planned 1.5.0)
- Economy support (planned 1.4.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:/cbOR/cmdbookcanbeused# Create a cmdBook with the written book in your hand/cbcreate# Edit/Add commands in a cmdBook (Other books are blocked)/cbedit# List the commands inside a cmdBook/cbinfo# Show plugin information/cbabout# Make a normal book private/cbprivate# Make a normal book public/cbpublic# Reload the configuration/cbreload# Convert deprecated variables/cbconvert
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->Whenusingitinthisformat,itwilljustaskforaninput $input[Questionhere]->put[text]tocustomizeyourquestion# 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[javascripthere] $script[vardNow=newDate();varoutput='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[HElloThere!]# Send player chat $chat[..]# Only required when using @runconsole
Examples
Ex1:
[cmdbook]/give$playercookie1|Igotacookie:D|
Ex2:
[cmdbook]$targetplayerYouhavebeencaughtgriefing!|/ban$targetplayerGriefingVisualproof|/residentdelete$targetplayer|
Ex3:
[cmdbook]/lblookupplayer$targetplayerblock56area100time30minutes|
Ex4:
PAGE1:[cmdbook]Thisismyfirstpage|HELLOOWWPAGE2:Thisismysecondcommand|/give $playercookie 10|:DPAGE3:TheEnd
Ex5:
[cmdbook]/ban$targetplayer$input[Whybanhim?]|/lbrollbackplayer$targetplayertime$input[Howmanydaysyouwanttorollbackhim?]days|$wait[2000]|/yes|$wait[10000]|/no
Ex6:
# permissions needed:-cmdbook.variable.runconsole-cmdbook.use[cmdbook]@runconsole/give $playercookie 1
Ex7:
WillactlikeWorldEditcompassthecalcadds 1 blocktotheyaxis,soyoudontteleportINtheblock[cmdbook]/teleport $losxcalc($losy+1) $losz
Changes
Version 1.3.6
Status: Minor + Bugfixes
- Compiled for 1.4.7 R1.0
- Removed updater completly,.. until I have time to fix it
- Added @pay[..] to override default cost to use a cmdbook
- Added @uses[..] to define how many times you can use the book (decreases with 1 until 0)
- Added @destroywhenused to remove the book when @uses = 0 (MIGHT NOT WORK VERY WELL)
- Fixed economy bug
- ADDED base of new permissions, cmdbook.use.xxxx and cmdbook.variable.xxx will be changed cmdbook.use.xxxx allows you to use a variable in a book cmdbook.variable.xxxx allows you to use and add a variable in a book !!!NOTE: THIS IS NOT IMPLEMENTED YET!!! (I know, still it hasn't been done)
Click here to see all version changes