XShortcut

XShortcut is a tool to create admin-defined commands, running multiple commands at once, e.g. to do semi-automatic World-Edit operations or doing permission- and right-management for your users. But many shortcut plugins have too less features if you want to create shortcut commands, e.g. returning text to a player, running commands as OP or checking if the arguments are valid. So I created XShortcut to enable more control over shortcut commands.

What can this plugin do?

For example, you want to create a shortcut for your permission manager, but it's hard to remember commands like /pex user <user> group set player. This plugin is able to create a command (e.g /player <player name>) to make your life easier.

Another usage is, for example protecting props for your users: Normally, you would select the corners of the prop and type expand 20 u, expand 20 d and /region define prop_<player>. With XShortcut, you can configure ONE command, doing these 3 commands. Instead of typing them, you only would have to run, for example, /protect <player>. The 3 commands are run in background by the plugin.

expand 20 u, expand 20 d and /region define prop_<player> ~ Merge~~> /protect <player>

Read the example section to find out what admins and players also can do!

Why XShortcut?

Because I used bShortcut (Very good shortcut plugin) before creating XShortcut. XShortcut is using XML instead of YML (i hate YML :P) to enable all features, I wanted for a shortcut plugin. The X stands for XML.

Features

  • "Run as Player" commands
  • "Run as OP" commands
  • Normal commands (:
  • "Return text to sender" commands
  • Argument validitation (e.g. numbers, player names or only special values)
  • Shortcut command restictions (Permissions, OP required)

Installation

Just extract the *.zip file into your server folder (where craftbukkit.jar is) and restart/reload your server.

Reference

Arguments (+Additional attributes)

Possible attributes for every argument: Placeholder, Type, Name

Argument Types + Additional attributes

  • Text
  • Number (min, max)
  • AllowedVars (vars)
  • Player (allowoffline=true)
  • World
  • Date
  • Time
  • DateTime
  • Asterisk (Look at example how to use)

Commands

Command Types + Attributes

  • Run (Command, Colored=true, Color-Char=%)
  • Player (Command, Player [+Placeholder support], Colored=true, Color-Char=%)
  • Op (Command, Colored=true, Color-Char=%)
  • Return (Text, Colored=true, Color-Char=%)

Example

<XShortcut>
    <!-- You may insert comments :D -->
    <Command Name="/xreload" NeedsOp="true" Description="Reloads XShortcut. Ops Only.">		
		<Commands>
			<Run Command="/xshortcut reload" />		<!-- Run a command (or write sth into the chat) -->	
		</Commands>
	</Command>
	
	<!-- Arguments are registered in the "Arguments" tag -->
	<!-- There are many argument types: Player, Number, Allowedvars, Date, Time, Datetime, Text (Text = No checking ore sth else -->
	<Command Name="/vipkick" NeedsPermission="i.am.vip" Description="VIP may kick ...">
	    <Arguments>
	        <Argument Type="Player" AllowOffline="true"/> <!-- Only kick valid players, AllowOffline defaults to true -->
	    </Arguments>
	    <Commands>
	        <Op Command="kick %%1%%" /> <!-- Run as OP -->
	        <Return Text="You kicked %%1%%. %bHaha!" /> <!-- Return a text to the command sender - With Color (%b)-->
	    </Commands>
	</Command>
	
	<!-- Asterisk argument example (Annoy your players!!!) -->
	<Command Name="/sayas" NeedsOP="true">
	    <Arguments>
	        <Argument Type="Player" Placeholder="#player#"/> <!-- First argument: Player - ok -->
	        <Argument Type="Asterisk" /> <!-- Asterisk ??? -->
	    </Arguments>
	    <Commands>
	        <Player Command="%%*%%" Player="#player#" />
	    </Commands>
	    
	    <!-- What will happen: if you run /sayas Notch hi i am Notch!, The player Notch will say "hi i am Notch!"
	    Asterisk collects every argument after its occurence and will set a placeholder %%asterisk%% (You may set it as other placeholders). It acts like %%args%% (List all arguments). -->
	</Command>
	
	<!-- Allowed vars: Help pages and more -->
	<Command Name="/rules">
	    <Arguments>
	        <Argument Type="Allowedvars" Vars="general"/> <!-- Allow only "general" as first argument - otherwise it will look for another matching command -->
	    </Arguments>
	    <Commands>
	        <Return Text="#4Rule no1: #b?????" Color-Char="#" />
	        <Return Text="#4Rule no2: #baaaaaaaaaaaahn! No coloring!" Colored="false" />
	        <Return Text="#4Rule no3: %bDefault color char!" />
	    </Commands>
	</Command>
	<Command Name="/rules">
	     <Arguments>
	        <Argument Type="Allowedvars" Vars="extra"/> <!-- Allow only "extra" as first argument - otherwise it will look for another matching command -->
	    </Arguments>
	    <Commands>
	        <Return Text="#4Rule no4: #babcde" Color-Char="#" />
	        <Return Text="#4Rule no5: #bfghi!" Colored="false" />
	        <Return Text="#4Rule no6: %bjklmnop!" />
	    </Commands>
	</Command>
	<!-- Now an index for no argument -->
	<Command Name="/rules">	    
	    <Commands>
	        <Return Text="%c/rules general"/>
	        <Return Text="%c/rules extra"/>	        
	    </Commands>
	</Command>
</XShortcut>

Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files