mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Move handling code in a separate file Add caching ability for low-power devices (rpi..) Use a distinct API with MCC.MethodName() Stop script execution only on specific API calls
31 lines
No EOL
614 B
C#
31 lines
No EOL
614 B
C#
//MCCScript 1.0
|
|
|
|
/* This script demonstrates how to use methods and arguments */
|
|
|
|
string text = "hello";
|
|
|
|
if (args.Length > 0)
|
|
text = args[0];
|
|
|
|
for (int i = 0; i < 5; i++)
|
|
{
|
|
int count = MCC.GetVarAsInt("test") + 1;
|
|
MCC.SetVar("test", count);
|
|
SendHelloWorld(count, text);
|
|
SleepBetweenSends();
|
|
}
|
|
|
|
//MCCScript Extensions
|
|
|
|
/* Here you can define methods for use into your script */
|
|
|
|
void SendHelloWorld(int count, string text)
|
|
{
|
|
MCC.SendText("Hello World no. " + count + ": " + text);
|
|
}
|
|
|
|
void SleepBetweenSends()
|
|
{
|
|
MCC.LogToConsole("Sleeping for 5 seconds...");
|
|
Thread.Sleep(5000);
|
|
} |