For this to work you'll need Minecraft Coder Pack and JDK7u25. There is more then enough tutorials on this if you Google it
First you're going to have to import this:
Code:
import org.lwjgl.input.Keyboard;
Secondly:
Code:
private boolean keyStates[];
Then...:
Code:
keyStates = new boolean[256];
}
public boolean checkKey1(int i)
{
if(mc.currentScreen !=null)
{
return false;
}
if(Keyboard.isKeyDown(i) != keyStates[i])
{
return keyStates[i] = !keyStates[i];
}else
{
return false;
}
}
Finally, you're gonna have to add the actual key events:
Code:
if (checkKey1(Keyboard.KEY_DOWN)){
mc.thePlayer.sendChatMessage("/afk");
}
if (checkKey1(Keyboard.KEY_UP)){
mc.thePlayer.sendChatMessage("/home home");
}
This should be located under the if statement that refers to F3:
Code:
if (this.mc.gameSettings.showDebugInfo)