2015-06-21 18:45:43 +02:00
|
|
|
//MCCScript 1.0
|
|
|
|
|
|
2015-06-25 12:12:59 +02:00
|
|
|
/* This script demonstrates how to use methods and arguments */
|
2015-06-21 18:45:43 +02:00
|
|
|
|
2015-06-25 12:12:59 +02:00
|
|
|
string text = "hello";
|
|
|
|
|
|
|
|
|
|
if (args.Length > 0)
|
|
|
|
|
text = args[0];
|
|
|
|
|
|
2015-06-21 18:45:43 +02:00
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
|
|
{
|
|
|
|
|
int count = GetVarAsInt("test") + 1;
|
|
|
|
|
SetVar("test", count);
|
2015-06-25 12:12:59 +02:00
|
|
|
SendHelloWorld(count, text);
|
2015-06-21 18:45:43 +02:00
|
|
|
SleepBetweenSends();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//MCCScript Extensions
|
|
|
|
|
|
|
|
|
|
/* Here you can define methods for use into your script */
|
|
|
|
|
|
2015-06-25 12:12:59 +02:00
|
|
|
void SendHelloWorld(int count, string text)
|
2015-06-21 18:45:43 +02:00
|
|
|
{
|
|
|
|
|
/* Warning: Do not make more than one server-related call into a method
|
|
|
|
|
* defined as a script extension eg SendText or switching servers,
|
|
|
|
|
* as execution flow is not managed in the Extensions section */
|
|
|
|
|
|
2015-06-25 12:12:59 +02:00
|
|
|
SendText("Hello World no. " + count + ": " + text);
|
2015-06-21 18:45:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SleepBetweenSends()
|
|
|
|
|
{
|
|
|
|
|
LogToConsole("Sleeping for 5 seconds...");
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
}
|