Skip to content

Instantly share code, notes, and snippets.

@vbfox
Created May 2, 2011 18:48
Show Gist options
  • Save vbfox/952123 to your computer and use it in GitHub Desktop.
Save vbfox/952123 to your computer and use it in GitHub Desktop.
Simple LINQPad script to spawn blocks in Minecraft
// This LINQPad script is usin the "C# Statement(s)" mode
// It requires a reference to System.Windows.Forms.dll
// and an import of the System.Windows.Forms namespace
//
// To use it click Execute, switch to minecraft and wait 5s.
var item = 20;
var user = "vbfox";
var stacks = 54;
var itemsPerStack = 64;
var chatKey = "{ENTER}";
Thread.Sleep(5*1000);
for(int i = 0; i < stacks; i++)
{
SendKeys.SendWait(chatKey);
Thread.Sleep(50);
SendKeys.SendWait(string.Format("/give {0} {1} {2}", user, item, itemsPerStack));
Thread.Sleep(10);
SendKeys.SendWait("{ENTER}");
Thread.Sleep(50);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment