mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Give access to AutoRespond matches inside scripts
Available as %match_u%, %match_1% and so on See #770 for initial suggestion See #772 for in-progress implementation
This commit is contained in:
parent
e4e1f0b9fa
commit
00112e4c6a
25 changed files with 129 additions and 69 deletions
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "changeslot"; } }
|
||||
public override string CMDDesc { get { return "changeslot <1-9>: Change hotbar"; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (!handler.GetInventoryEnabled()) return "Please enable InventoryHandling in the config file first.";
|
||||
if (hasArg(command))
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "connect"; } }
|
||||
public override string CMDDesc { get { return "connect <server> [account]: connect to the specified server."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (hasArg(command))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "debug"; } }
|
||||
public override string CMDDesc { get { return "debug [on|off]: toggle debug messages."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (hasArg(command))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ namespace MinecraftClient.Commands
|
|||
{
|
||||
public override string CMDName { get { return "exit"; } }
|
||||
public override string CMDDesc { get { return "exit: disconnect from the server."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
Program.Exit();
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "getinventory"; } }
|
||||
public override string CMDDesc { get { return "getinventory: Show your inventory."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
Dictionary<int,Item> items = handler.GetPlayerInventory().Items;
|
||||
foreach(KeyValuePair<int,Item> a in items)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "list"; } }
|
||||
public override string CMDDesc { get { return "list: get the player list."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
return "PlayerList: " + String.Join(", ", handler.GetOnlinePlayers());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "log"; } }
|
||||
public override string CMDDesc { get { return "log <text>: log some text to the console."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (hasArg(command))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "look"; } }
|
||||
public override string CMDDesc { get { return "look <x y z|yaw pitch|up|down|east|west|north|south>: look at direction or coordinates."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (handler.GetTerrainEnabled())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "move"; } }
|
||||
public override string CMDDesc { get { return "move <on|off|get|up|down|east|west|north|south|x y z>: walk or start walking."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
string[] args = getArgs(command);
|
||||
string argStr = getArg(command).Trim().ToLower();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "reco"; } }
|
||||
public override string CMDDesc { get { return "reco [account]: restart and reconnect to the server."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
string[] args = getArgs(command);
|
||||
if (args.Length > 0)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "respawn"; } }
|
||||
public override string CMDDesc { get { return "respawn: Use this to respawn if you are dead."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
handler.SendRespawnPacket();
|
||||
return "You have respawned.";
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "script"; } }
|
||||
public override string CMDDesc { get { return "script <scriptname>: run a script file."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (hasArg(command))
|
||||
{
|
||||
handler.BotLoad(new ChatBots.Script(getArg(command)));
|
||||
handler.BotLoad(new ChatBots.Script(getArg(command), null, localVars));
|
||||
return "";
|
||||
}
|
||||
else return CMDDesc;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "send"; } }
|
||||
public override string CMDDesc { get { return "send <text>: send a chat message or command."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (hasArg(command))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "set"; } }
|
||||
public override string CMDDesc { get { return "set varname=value: set a custom %variable%."; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
if (hasArg(command))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace MinecraftClient.Commands
|
|||
public override string CMDName { get { return "useitem"; } }
|
||||
public override string CMDDesc { get { return "useitem: Use (left click) an item on the hand"; } }
|
||||
|
||||
public override string Run(McTcpClient handler, string command)
|
||||
public override string Run(McTcpClient handler, string command, Dictionary<string, object> localVars)
|
||||
{
|
||||
handler.UseItemOnHand();
|
||||
return "Use an item";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue