05-03-2012, 12:27 PM
So recently I decided that to get a little more into Java, I would code a hack client(Not for Orcworm of course ) for some friends. I have about half a dozen hacks set up and I want to create a console so I can add a friendslist, etc. But I can't seem to figure out how. I watched a few minutes of a tutorial on the subject and this is what I have so far:
[spoiler]
package net.minecraft.src;
import org.lwjgl.input.Keyboard;
public class GuiConsole extends GuiScreen{
protected String message;
private int updateCounter;
private static final String allowedCharacters;
public GuiConsole(){
message = "";
updateCounter = 0;
}
public void initGui(){
Keyboard.enableRepeatEvents(true);
}
public void onGuiClosed(){
Keyboard.enableRepeatEvents(false);
}
public void updateScreen(){
updateCounter++;
}
public void processCommand(String s){
}
protected void keyTyped(char c, int i){
if(i == 1){
mc.displayGuiScreen(null);
return;
}
if(i == 28){
String s = message.trim();
if(s.length() > 0){
processCommand(s);
}
mc.displayGuiScreen(null);
return;
}
if(i == 14 && message.length() > 0){
message = message.substring(0, message.length() - 1);
}
if(allowedCharacters.indexOf© > 0 && message.length() < 100){
message += c;
}
}
public void drawScreen(int i, int j, float f){
drawRect(2, height - 14, width - 2, height - 2, 0x80000000);
drawString(fontRenderer, "Console: " +message+ ((updateCounter / 6) % 2 != 0 ? "" : "_"), 4, height - 12, 0xffffff);
super.drawScreen(i, j, f);
}
public void mouseClicked(int i, int j, int k){
super.mouseClicked(i, j, k);
if(k != 0){
return;
}
if(mc.ingameGUI.field_933_a == null){
return;
}
if(message.length() > 0 && !message.endsWith("")){
message += " ";
}
message += mc.ingameGUI.field_933_a;
byte byte0 = 100;
if(message.length() > byte0){
message = message.substring(0, byte0);
}
}
}
}
[/spoiler]
field_933_a comes up as an error.
Can anyone help?
[spoiler]
package net.minecraft.src;
import org.lwjgl.input.Keyboard;
public class GuiConsole extends GuiScreen{
protected String message;
private int updateCounter;
private static final String allowedCharacters;
public GuiConsole(){
message = "";
updateCounter = 0;
}
public void initGui(){
Keyboard.enableRepeatEvents(true);
}
public void onGuiClosed(){
Keyboard.enableRepeatEvents(false);
}
public void updateScreen(){
updateCounter++;
}
public void processCommand(String s){
}
protected void keyTyped(char c, int i){
if(i == 1){
mc.displayGuiScreen(null);
return;
}
if(i == 28){
String s = message.trim();
if(s.length() > 0){
processCommand(s);
}
mc.displayGuiScreen(null);
return;
}
if(i == 14 && message.length() > 0){
message = message.substring(0, message.length() - 1);
}
if(allowedCharacters.indexOf© > 0 && message.length() < 100){
message += c;
}
}
public void drawScreen(int i, int j, float f){
drawRect(2, height - 14, width - 2, height - 2, 0x80000000);
drawString(fontRenderer, "Console: " +message+ ((updateCounter / 6) % 2 != 0 ? "" : "_"), 4, height - 12, 0xffffff);
super.drawScreen(i, j, f);
}
public void mouseClicked(int i, int j, int k){
super.mouseClicked(i, j, k);
if(k != 0){
return;
}
if(mc.ingameGUI.field_933_a == null){
return;
}
if(message.length() > 0 && !message.endsWith("")){
message += " ";
}
message += mc.ingameGUI.field_933_a;
byte byte0 = 100;
if(message.length() > byte0){
message = message.substring(0, byte0);
}
}
}
}
[/spoiler]
field_933_a comes up as an error.
Can anyone help?