Created
July 16, 2012 10:07
-
-
Save md-5/3121917 to your computer and use it in GitHub Desktop.
Test javascript script for MC-Bot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importPackage(Packages.com.md_5.bot.mc); | |
importPackage(Packages.java.lang); | |
var connection = new Connection("127.0.0.1", 25565); | |
connection.setUsername("md_5"); | |
if (connection.connect()){ | |
// read thread | |
new Thread(function run(){ | |
while (connection.isConnected()){ | |
} | |
}).start(); | |
// write thread | |
new Thread(function run(){ | |
while (connection.isConnected()){ | |
} | |
}).start(); | |
} else { | |
out.println("Failed to connect."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment