mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Add set varname=value MCC command
- Allow to use vars declared in scripts or directly by the user - Commands my now use %variable% as well - Moved "help" command from RemoteControl to inner MCC command manager - The only special command is "wait", which is only available in scripts Todo: Solve ambiguity between MCC help and Server help commands Note: Auto accept tpa suggested by MousePak Note: Manually choosing MC version suggested by ZizzyDizzyMC
This commit is contained in:
parent
8b5ce567a6
commit
87d4687394
5 changed files with 96 additions and 76 deletions
|
|
@ -233,9 +233,7 @@ namespace MinecraftClient
|
|||
break;
|
||||
|
||||
case ParseMode.AppVars:
|
||||
string varName = new string(argName.TakeWhile(char.IsLetterOrDigit).ToArray()).ToLower();
|
||||
if (varName.Length > 0)
|
||||
AppVars[varName] = argValue;
|
||||
setVar(argName, argValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -353,6 +351,24 @@ namespace MinecraftClient
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a custom %variable% which will be available through expandVars()
|
||||
/// </summary>
|
||||
/// <param name="varName">Name of the variable</param>
|
||||
/// <param name="varData">Value of the variable</param>
|
||||
/// <returns>True if the parameters were valid</returns>
|
||||
|
||||
public static bool setVar(string varName, string varData)
|
||||
{
|
||||
varName = new string(varName.TakeWhile(char.IsLetterOrDigit).ToArray()).ToLower();
|
||||
if (varName.Length > 0)
|
||||
{
|
||||
AppVars[varName] = varData;
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replace %variables% with their value
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue