Description: Making a Colourful Yell System.
Difficulty: 2-3/10
Assumed Knowledge: Able to use Ctrl+F, copy + paste
Files/Classes Modified: Client and Server: Client.java
Client1. Open
Client.java.2. Search for this:
String s = aString887.toLowerCase();And under that, add this:
if(s.startsWith("@or1@")) {
aString887 = aString887.substring(5);
method77(aString887, 14, "", aBoolean991);
aString887 = "";
break;
}
if(s.startsWith("@yel@")) {
aString887 = aString887.substring(5);
method77(aString887, 15, "", aBoolean991);
aString887 = "";
break;
}
if(s.startsWith("@red@")) {
aString887 = aString887.substring(5);
method77(aString887, 16, "", aBoolean991);
aString887 = "";
break;
}
if(s.startsWith("@gre@")) {
aString887 = aString887.substring(5);
method77(aString887, 17, "", aBoolean991);
aString887 = "";
break;
}
if(s.startsWith("@pur@")) {
aString887 = aString887.substring(5);
method77(aString887, 20, "", aBoolean991);
aString887 = "";
break;
}
if(s.startsWith("@blu@")) {
aString887 = aString887.substring(5);
method77(aString887, 19, "", aBoolean991);
aString887 = "";
break;
}
3. Search for this:
method18(intAnd replace that Method with this:
public final void method18(int i) {
aClass15_1166.method237(0);
Class30_Sub2_Sub1_Sub3.anIntArray1472 = anIntArray1180;
aClass30_Sub2_Sub1_Sub1_1198.method348(0, 16083, 0);
if(aBoolean1256) {
aClass30_Sub2_Sub1_Sub4_1272.method381(0, aString1121, 23693, 40, 239);
aClass30_Sub2_Sub1_Sub4_1272.method381(128, aString1212 + "*", 23693, 60, 239);
} else
if(anInt1225 == 1) {
aClass30_Sub2_Sub1_Sub4_1272.method381(0, "Enter amount:", 23693, 40, 239);
aClass30_Sub2_Sub1_Sub4_1272.method381(128, aString1004 + "*", 23693, 60, 239);
} else
if(anInt1225 == 2) {
aClass30_Sub2_Sub1_Sub4_1272.method381(0, "Enter name:", 23693, 40, 239);
aClass30_Sub2_Sub1_Sub4_1272.method381(128, aString1004 + "*", 23693, 60, 239);
} else
if(aString844 != null) {
aClass30_Sub2_Sub1_Sub4_1272.method381(0, aString844, 23693, 40, 239);
aClass30_Sub2_Sub1_Sub4_1272.method381(128, "Click to continue", 23693, 60, 239);
} else
if(anInt1276 != -1)
method105(8, 0, 0, Class9.aClass9Array210[anInt1276], 0);
else if(anInt1042 != -1) {
method105(8, 0, 0, Class9.aClass9Array210[anInt1042], 0);
} else {
Class30_Sub2_Sub1_Sub4 class30_sub2_sub1_sub4 = aClass30_Sub2_Sub1_Sub4_1271;
int j = 0;
Class30_Sub2_Sub1.method333(77, 0, false, 463, 0);
for(int k = 0; k < 100; k++)
if(aStringArray944[k] != null)
{
int l = anIntArray942[k];
int i1 = (70 - j * 14) + anInt1089;
String s1 = aStringArray943[k];
byte byte0 = 0;
if(s1 != null && s1.startsWith("@cr1@")) //mod icons
{
s1 = s1.substring(5);
byte0 = 1;
}
if(s1 != null && s1.startsWith("@cr2@")) {
s1 = s1.substring(5);
byte0 = 2;
}
if(l == 0) {
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method389(false, false, 4, 0, aStringArray944[k], i1);
j++;
}
if((l == 1 || l == 2 ) && (l == 1 || anInt1287 == 0 || anInt1287 == 1 && method109(false, s1))) {
if(i1 > 0 && i1 < 120) {
int j1 = 4;
if(byte0 == 1) { //draws mod icons
aClass30_Sub2_Sub1_Sub2Array1219[0].method361(j1, 16083, i1 - 12);
j1 += 14;
}
if(byte0 == 2) {
aClass30_Sub2_Sub1_Sub2Array1219[1].method361(j1, 16083, i1 - 12);
j1 += 14;
}
class30_sub2_sub1_sub4.method385(UserLoader.namesetcolour, s1 + ":", i1, 822, j1);
j1 += class30_sub2_sub1_sub4.method383(anInt1116, s1) + 8;
class30_sub2_sub1_sub4.method385(UserLoader.chatsetcolour, aStringArray944[k], i1, 822, j1); //name colour chatbox
}
j++;
}
if(l == 10 && anInt1195 == 0) {
if(i1 > 0 && i1 < 120)
if(s1 != null && s1.startsWith("@cr4@")) {
s1 = s1.substring(5);
byte0 = 6;
}
class30_sub2_sub1_sub4.method385(255, aStringArray944[k], i1, 822, 4);
}
if((l == 3 || l == 7) && anInt1195 == 0 && (l == 7 || anInt845 == 0 || anInt845 == 1 && method109(false, s1))) { //(pm system)
if(i1 > 0 && i1 < 120) {
int k1 = 4;
class30_sub2_sub1_sub4.method385(0x800000, "From", i1, 822, k1);//friends(pm system)
k1 += class30_sub2_sub1_sub4.method383(anInt1116, "From ");
if(byte0 == 1) {
//aClass30_Sub2_Sub1_Sub1Array1219[0].method348(k1, 16083, i1 - 12);
aClass30_Sub2_Sub1_Sub2Array1219[0].method361(k1, 16083, i1 - 12);
k1 += 14;
}
if(byte0 == 2) {
//aClass30_Sub2_Sub1_Sub1Array1219[1].method348(k1, 16083, i1 - 12);
aClass30_Sub2_Sub1_Sub2Array1219[1].method361(k1, 16083, i1 - 12);
k1 += 14;
}
class30_sub2_sub1_sub4.method385(0x800000, s1 + ":", i1, 822, k1);
k1 += class30_sub2_sub1_sub4.method383(anInt1116, s1) + 8;
//class30_sub2_sub1_sub4.method385(0x800000, aStringArray944[k], i1, 822, k1);
class30_sub2_sub1_sub4.method385(0x800000, aStringArray944[k], i1, 822, k1);
}
j++;
}
if(l == 4 && (anInt1248 == 0 || anInt1248 == 1 && method109(false, s1))) {
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0x800080, s1 + " " + aStringArray944[k], i1, 822, 4);
j++;
}
if(l == 5 && anInt1195 == 0 && anInt845 < 2) {
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0x800000, aStringArray944[k], i1, 822, 4);
j++;
}
if(l == 6 && anInt1195 == 0 && anInt845 < 2) {
if(i1 > 0 && i1 < 120) {
class30_sub2_sub1_sub4.method385(0x800000, "To " + s1 + ":", i1, 822, 4);
class30_sub2_sub1_sub4.method385(0x800000, aStringArray944[k], i1, 822, 12 + class30_sub2_sub1_sub4.method383(anInt1116, "To " + s1));
}
j++;
}
if(l == 80)
{
if(i1 > 0 && i1 < 120)
{
class30_sub2_sub1_sub4.method385(0x800000, s1 + " " + aStringArray944[k], i1, 822, 4);
}
j++;
}
if(l == 8 && (anInt1248 == 0 || anInt1248 == 1 && method109(false, s1))) {
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0x7e3200, s1 + " " + aStringArray944[k], i1, 822, 4);
j++;
}
if((l == 9) && (l == 1 || anInt1287 == 0 || anInt1287 == 1 && method109(false, s1))) {
if(i1 > 0 && i1 < 120) {
int j1 = 4;
if(byte0 == 1) {
aClass30_Sub2_Sub1_Sub2Array1219[0].method361(j1, 16083, i1 - 12);
j1 += 14;
}
if(byte0 == 2) {
aClass30_Sub2_Sub1_Sub2Array1219[1].method361(j1, 16083, i1 - 12);
j1 += 14;
}
j1 += class30_sub2_sub1_sub4.method383(anInt1116, s1) + 8;
class30_sub2_sub1_sub4.method385(0xFF0000, aStringArray944[k], i1, 822, j1); //name colour chatbox
}
j++;
}
if(l == 14) { //@or1@ +msg
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0xEE8700, aStringArray944[k], i1, 822, 0);
j++;
}
if(l == 15) { //@yel@ +msg
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0xEEEE00, aStringArray944[k], i1, 822, 0);
j++;
}
if(l == 16) { //@red@ +msg
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0xCC0000, aStringArray944[k], i1, 822, 0);
j++;
}
if(l == 17) { //@gre@ +msg
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0x00A403, aStringArray944[k], i1, 822, 0);
j++;
}
if(l == 19) { //@blu@ +msg
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0x006FA4, aStringArray944[k], i1, 822, 0);
j++;
}
if(l == 20) { //@pur@ +msg
if(i1 > 0 && i1 < 120)
class30_sub2_sub1_sub4.method385(0xEE009B, aStringArray944[k], i1, 822, 0);
j++;
}
}
Class30_Sub2_Sub1.method332(4);
anInt1211 = j * 14 + 7;
if(anInt1211 < 78)
anInt1211 = 78;
method30(519, 77, anInt1211 - anInt1089 - 77, 0, 463, anInt1211);
String s;
if(aClass30_Sub2_Sub4_Sub1_Sub2_1126 != null && aClass30_Sub2_Sub4_Sub1_Sub2_1126.aString1703 != null)
s = aClass30_Sub2_Sub4_Sub1_Sub2_1126.aString1703;
else
s = Class50.method587(-45804, aString1173);
class30_sub2_sub1_sub4.method385(0x002f06, s + ":", 90, 822, 4);
class30_sub2_sub1_sub4.method385(0x0000ff, aString887 + "*", 90, 822, 6 + class30_sub2_sub1_sub4.method383(anInt1116, s + ": "));
Class30_Sub2_Sub1.method339(77, 0, 479, 0, (byte)4);
}
if(aBoolean885 && anInt948 == 2)
method40((byte)9);
aClass15_1166.method238(357, 23680, super.aGraphics12, 17);
aClass15_1165.method237(0);
Class30_Sub2_Sub1_Sub3.anIntArray1472 = anIntArray1182;
if(i < 6 || i > 6)
aBoolean991 = !aBoolean991;
}
Server.1. Open
Client.javaNow find your yell command and replace it with this. If you don't have a yell command, then just add this where
the commands are;
if (command.startsWith("yell") && command.length() > 5) {
String text = command.substring(5);
String color[] = { "@dre@", "@or2@", "@red@", "@mag@", "@dre@" };
text = Character.toUpperCase(text.charAt(0)) + text.substring(1);
if (muted == 1) {
sendMessage("You are muted and cannot yell!");
return;
}
yell(playerName + ": " + color[playerRights] + "" + censorString(text));
}2. Nearly done, you have to now add these Methods.
public String censorString(String text) {
String[] censor = { playerPass, "****", " ass ", "****", "hoe", "fag", "******", "****", "f u c k", "****", "****", "no-ip", "servergame", "no - ip", "jagex", "runescape", "****", "dick", "****", "skank", "bastard", "****", "******", "beaner", "beener", "this server sucks", "nigga", "negro", "cracka", "honkey", "homo", "****", "wet back", "chink" };
text = text.toLowerCase();
for (int x = 0; x < censor.length; x++) {
if (text.contains(censor[x])) {
text = text.replaceAll(censor[x], "****");
}
}
text = Character.toUpperCase(text.charAt(0)) + text.substring(1);
return text;
}
public void yell(String msg) {
String text = msg;
if (msg.startsWith("@")) {
text = Character.toUpperCase(text.charAt(5)) + text.substring(6);
} else {
text = Character.toUpperCase(text.charAt(0)) + text.substring(1);
}
server.playerHandler.messageToAll = text;
}This tutorial is suggested for NON-DELTA Based Servers !
You could try it, but it may not work.
The codes can always be converted for delta though :)
Tbh, the colours
can get annoying 8)
But, it's something unique and makes servers less boring. :)
100% Credits to RobGob