Results 1 to 2 of 2
  1. #1
    harryblue is offline Member
    Join Date
    Mar 2009
    Posts
    4
    Rep Power
    0

    Default [REQ] can sombody clean up this code?

    hi just wondering if sombody could clean up this code since its so messy, i need it set out only like this.....

    Java Code:
                if(i == 2)
                
                if(i == 3)
                    
                if(i == 12)
                    
                if(i == 13)
                    
                if(i == 14)
                    
                if(i == 17)
    atm it has loads of "else" etc

    here is what i need cleaning

    Java Code:
    public void readValues(int i, Stream stream, boolean bool) {
    	anInt1459++;
    	if (i != 1) {
    	    if (i != 2) {
    		if (i != 12) {
    		    if (i != 13) {
    			if (i == 14)//walk animation?
    			    anInt1440 = stream.readUnsignedWord(1355769544);
    			else if (i != 15) {
    			    if (i != 16) {
    				if (i != 17) {
    				    if (i > 30 || i <= 35) {
    					if (i == 40) {
    					    int k = stream.readUnsignedByte(-6677);
    					    OriginalModelColors = new short[k];
    					    ChangedModelColors = new short[k];
    					    for (int k1 = 0; k > k1; k1++) 
    					    {
    						OriginalModelColors[k1] = (short) (stream.readUnsignedWord(1355769544));
    						ChangedModelColors[k1] = (short) (stream.readUnsignedWord(1355769544));
    					    }
    					} else if (i == 41) {
    					    int i_11_ = stream.readUnsignedByte(-6677);
    					    aShortArray1442 = new short[i_11_];
    					    aShortArray1425 = new short[i_11_];
    					    for (int i_12_ = 0;((i_12_ ^ 0xffffffff) > (i_11_ ^ 0xffffffff));i_12_++) {
    						aShortArray1442[i_12_] = (short) (stream.readUnsignedWord(1355769544));
    						aShortArray1425[i_12_]= (short) (stream.readUnsignedWord(1355769544));
    					    }
    					} else if (i == 42) {
    					    int i_13_ = stream.readUnsignedByte(-6677);
    					    aByteArray1422 = new byte[i_13_];
    					    for (int i_14_ = 0;((i_13_ ^ 0xffffffff) < (i_14_ ^ 0xffffffff));i_14_++)
    						aByteArray1422[i_14_] = stream.method955(3390);
    					} else if (i != 60) {
    					    if (i != 93) {
    						if (i == 95)
    						    anInt1444 = (stream.readUnsignedWord(1355769544));//combat lvl
    						else if (i != 97) {
    						    if (i == 98)
    						    	scaleNPCheight = (stream.readUnsignedWord(1355769544));
    						    else if (i != 99) {
    							if (i != 100) {
    							    if (i != 101) {
    								if (i == 102)
    								    anInt1439 = (stream.readUnsignedWord(1355769544));//headicon
    								else if (i == 103)
    								    anInt1456 = (stream.readUnsignedWord(1355769544));
    								else if (i == 106 || i == 118) {
    								    anInt1426 = (stream.readUnsignedWord(1355769544));
    								    if ((anInt1426 ^ 0xffffffff)== -65536)
    									anInt1426 = -1;
    								    anInt1469 = (stream.readUnsignedWord(1355769544));
    								    if (anInt1469 == 65535)
    									anInt1469 = -1;
    								    int i_15_ = -1;
    								    if (i == 118) {
    									i_15_ = stream.readUnsignedWord(1355769544);
    									if (i_15_ == 65535)
    									    i_15_ = -1;
    								    }
    								    int i_16_ = (stream.readUnsignedByte(-6677));
    								    anIntArray1431 = (new int[2 + i_16_]);
    								    for (int i_17_ = 0;((i_17_^ 0xffffffff)>= (i_16_^ 0xffffffff));i_17_++) {
    									anIntArray1431[i_17_] = stream.readUnsignedWord(1355769544);
    									if ((anIntArray1431[i_17_]^ 0xffffffff)== -65536)
    									    anIntArray1431[i_17_] = -1;
    								    }
    								    anIntArray1431[1 + i_16_] = i_15_;
    								} else if (i != 107) {
    								    if (i == -110)
    									aBoolean1424= false;
    								    else if (i== 111)
    									aBoolean1448= false;
    								    else if (i== 113) {
    									aShort1464= (short) stream.readUnsignedWord(1355769544);
    									aShort1436= (short) stream.readUnsignedWord(1355769544);
    								    } else if (i== 114) {
    									aByte1470= stream.method955(3390);
    									aByte1453= stream.method955(3390);
    								    } else if (i == 115) {
    									aShort1419 = (short) (4 * stream.readUnsignedByte(-6677));
    									aShort1423 = (short) (stream.readUnsignedByte(-6677) * 4);
    								    } else if ((i ^ 0xffffffff)== 119)
    									aByte1446= stream.method955(3390);
    								    else if ((i^ 0xffffffff)!= 120) {
    									if (i== 121) {
    									    anIntArrayArray1457 = new int[anIntArray1454.length][];
    									    int i_18_ = stream.readUnsignedByte(-6677);
    									    for (int i_19_ = 0; i_19_ < i_18_; i_19_++) {
    										int i_20_ = stream.readUnsignedByte(-6677);
    										int[] is = anIntArrayArray1457[i_20_] = new int[3];
    										is[0] = stream.method955(3390);
    										is[1] = stream.method955(3390);
    										is[2] = stream.method955(3390);
    									    }
    									} else if (i == 122)
    									    anInt1437 = stream.readUnsignedWord(1355769544);
    									else if (i == 249) {
    									    int i_21_ = stream.readUnsignedByte(-6677);
    									    if (aClass113_1413 == null) {
    										int i_22_ = Class90.method1517(i_21_, -21189);
    										aClass113_1413 = new Class113(i_22_);
    									    }
    									    for (int i_23_ = 0; i_21_ > i_23_; i_23_++) {
    										boolean bool_24_ = (stream.readUnsignedByte(-6677) ^ 0xffffffff) == -2;
    										int i_25_ = stream.method921((byte) 50);
    										Class68 class68;
    										if (bool_24_)
    										    class68 = new Class68_Sub5(stream.readString(127));
    										else
    										    class68 = new Class68_Sub10(stream.readDWord());
    										aClass113_1413.method1677((byte) -59, class68, (long) i_25_);
    									    }
    									}
    								    } else {
    									anInt1429 = stream.readUnsignedWord(1355769544);
    									anInt1430 = stream.readUnsignedWord(1355769544);
    									anInt1471 = stream.readUnsignedWord(1355769544);
    									anInt1463 = stream.readUnsignedByte(-6677);
    								    }
    								} else
    								    aBoolean1433 = false;
    							    } else
    								ModelContrast = (5 * (stream.method955(3390)));
    							} else
    							    ModelBrightness = (stream.method955(3390));
    						    } else
    							aBoolean1420 = true;
    						} else
    						    scaleNPCwidth = (stream.readUnsignedWord(1355769544));
    					    } else
    						aBoolean1438 = false;
    					} else {
    					    int i_26_ = stream.readUnsignedByte(-6677);
    					    anIntArray1435 = new int[i_26_];
    					    for (int i_27_ = 0;((i_26_ ^ 0xffffffff)< (i_27_ ^ 0xffffffff));i_27_++)
    						anIntArray1435[i_27_]= (stream.readUnsignedWord(1355769544));
    					}
    				    } else {
    					aRSStringArray1432[-30 + i] = stream.readString(127);
    					if (aRSStringArray1432[i - 30].method1600(false,Class13_Sub2.aRSString_2647))
    					    aRSStringArray1432[i - 30] = null;
    				    }
    				} else {//walking type animations
    				    anInt1440 = stream.readUnsignedWord(1355769544);
    				    anInt1410 = stream.readUnsignedWord(1355769544);
    				    anInt1447 = stream.readUnsignedWord(1355769544);
    				    anInt1415 = stream.readUnsignedWord(1355769544);
    				}
    			    } else
    				anInt1421 = stream.readUnsignedWord(1355769544);
    			} else
    			    anInt1467 = stream.readUnsignedWord(1355769544);
    		    } else
    			anInt1409 = stream.readUnsignedWord(1355769544);
    		} else
    		    anInt1451 = stream.readUnsignedByte(-6677);
    	    } else
    		aRSString_1466 = stream.readString(127);
    	} else {
    	    int i_28_ = stream.readUnsignedByte(-6677);
    	    anIntArray1454 = new int[i_28_];
    	    for (int i_29_ = 0; (i_29_ ^ 0xffffffff) > (i_28_ ^ 0xffffffff);i_29_++)
    		anIntArray1454[i_29_] = stream.readUnsignedWord(1355769544);
    	}
    	if (bool != false)
    	    method1447(29);
        }

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    6

    Default

    we don't do other people's work here. i'm sure you can find some macro that does it faster then posting and waiting here.
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

Similar Threads

  1. Why doesn't this code accept my code?
    By PeterFeng in forum New To Java
    Replies: 5
    Last Post: 02-03-2009, 01:39 PM
  2. clean and Build
    By bhanu in forum Eclipse
    Replies: 3
    Last Post: 07-03-2008, 01:13 PM
  3. I need help fixing my code.. or non code?
    By MrHuggykins in forum New To Java
    Replies: 1
    Last Post: 03-19-2008, 10:12 PM
  4. Clean the content of the JTextField
    By elizabeth in forum AWT / Swing
    Replies: 1
    Last Post: 07-26-2007, 08:38 PM
  5. Replies: 1
    Last Post: 04-26-2007, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •