Thread: Update Specific Object

Page 1 of 3 123 LastLast
Results 1 to 10 of 27
  1. #1 Update Specific Object 
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    When i execute the following code

    Code:
    for (int i = 0; i < FarmingPatches.values().length; i++) {
    			int value = getConfigFor(FarmingPatches.values()[i].config), config = FarmingPatches.values()[i].config;
    			if(value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
    				player.getPacketSender().sendConfig(config, value);
    				System.out.println("config: " + config + " value: " + value);
    			}
    			else {
    				player.getPacketSender().sendConfig(config, value);
    				System.out.println("Else if conditin" +  " config: " + config + " value: " + value);
    			}
    		}

    it updates all my farming patches...how do i make it so it only updates the one clicked...?


    Attached image

    https://pastebin.com/aLNteWM8 heres my entire farming class.
    Attached image

    Attached image
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by Guruu View Post
    When i execute the following code

    Code:
    for (int i = 0; i < FarmingPatches.values().length; i++) {
    			int value = getConfigFor(FarmingPatches.values()[i].config), config = FarmingPatches.values()[i].config;
    			if(value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
    				player.getPacketSender().sendConfig(config, value);
    				System.out.println("config: " + config + " value: " + value);
    			}
    			else {
    				player.getPacketSender().sendConfig(config, value);
    				System.out.println("Else if conditin" +  " config: " + config + " value: " + value);
    			}
    		}

    it updates all my farming patches...how do i make it so it only updates the one clicked...?


    Attached image

    https://pastebin.com/aLNteWM8 heres my entire farming class.
    All these objects are using the same config and value it seems
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Nighel View Post
    All these objects are using the same config and value it seems
    I tried changing the config ids, that did nothing if i change the values they will update at different speeds...
    Code:
    HOME1(3045, 2952, 3048, 2955, 1, 529, 5343, 2275, 5329, SeedType.HERB),
    	HOME2(3048, 2952, 3051, 2955, 1, 522, 5343, 2275, 5329, SeedType.HERB),
    	HOME3(3051, 2952, 3054, 2955, 1, 522, 5343, 2275, 5329, SeedType.HERB),
    	HOME4(3045, 2948, 3048, 2951, 1, 522, 5343, 2275, 5329, SeedType.HERB),
    	HOME5(3048, 2948, 3051, 2951, 1, 522, 5343, 2275, 5329, SeedType.HERB);
    I am just using the first patch Home1

    its definatly this...i just dont know how to make it read the one i am using...
    Code:
    	
    public void doConfig() {
    		for (int i = 0; i < FarmingPatches.values().length; i++) {
    			int value = getConfigFor(FarmingPatches.values()[i].config), config = FarmingPatches.values()[i].config;
    			if(value < Byte.MIN_VALUE || value > Byte.MAX_VALUE)
    				player.getPacketSender().sendToggle(config, value);
    			else
    				player.getPacketSender().sendConfig(config, value);
    		}
    	}
    Attached image

    Attached image
    Reply With Quote  
     

  4. #4  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by Guruu View Post
    I tried changing the config ids, that did nothing if i change the values they will update at different speeds...
    Code:
    HOME1(3045, 2952, 3048, 2955, 1, 529, 5343, 2275, 5329, SeedType.HERB),
    	HOME2(3048, 2952, 3051, 2955, 1, 522, 5343, 2275, 5329, SeedType.HERB),
    	HOME3(3051, 2952, 3054, 2955, 1, 522, 5343, 2275, 5329, SeedType.HERB),
    	HOME4(3045, 2948, 3048, 2951, 1, 522, 5343, 2275, 5329, SeedType.HERB),
    	HOME5(3048, 2948, 3051, 2951, 1, 522, 5343, 2275, 5329, SeedType.HERB);
    I am just using the first patch Home1
    The objects still has the same config/values client sided.
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Nighel View Post
    The objects still has the same config/values client sided.
    How do i change the config/values client sided?
    Attached image

    Attached image
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Have a look at opcode 77 in objectdef
    Reply With Quote  
     

  7. #7  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    Quote Originally Posted by Nighel View Post
    Have a look at opcode 77 in objectdef
    I dont understand...

    Code:
    if (type == 77 || type == 92) {
    		varp = stream.readUShort();
    
    		if (varp == 0xFFFF) {
    			varp = -1;
    		}
    
    		varbit = stream.readUShort();
    
    		if (varbit == 0xFFFF) {
    			varbit = -1;
    		}
    
    		int value = -1;
    
    		if (type == 92) {
                value = stream.readUShort();
    
                if (value == 0xFFFF) {
                    value = -1;
                }
            }
    
    		int len = stream.readUnsignedByte();
    
    		childrenIDs = new int[len + 2];
    		for (int i = 0; i <= len; ++i) {
    			childrenIDs[i] = stream.readUShort();
    			if (childrenIDs[i] == 0xFFFF) {
    				childrenIDs[i] = -1;
    			}
    		}
    		childrenIDs[len + 1] = value;
    	}
    Attached image

    Attached image
    Reply With Quote  
     

  8. #8  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    Quote Originally Posted by Guruu View Post
    I dont understand...

    Code:
    if (type == 77 || type == 92) {
    		varp = stream.readUShort();
    
    		if (varp == 0xFFFF) {
    			varp = -1;
    		}
    
    		varbit = stream.readUShort();
    
    		if (varbit == 0xFFFF) {
    			varbit = -1;
    		}
    
    		int value = -1;
    
    		if (type == 92) {
                value = stream.readUShort();
    
                if (value == 0xFFFF) {
                    value = -1;
                }
            }
    
    		int len = stream.readUnsignedByte();
    
    		childrenIDs = new int[len + 2];
    		for (int i = 0; i <= len; ++i) {
    			childrenIDs[i] = stream.readUShort();
    			if (childrenIDs[i] == 0xFFFF) {
    				childrenIDs[i] = -1;
    			}
    		}
    		childrenIDs[len + 1] = value;
    	}
    Yea dump that data from that opcode for the object
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Aug 2012
    Posts
    2,462
    Thanks given
    312
    Thanks received
    459
    Rep Power
    457
    idk if this is what you mean....
    Spoiler for dump:

    Code:
    varp: -1
    varbit: 4771
    len: 255
    childrenIDs[0]18819
    childrenIDs[1]18820
    childrenIDs[2]18821
    childrenIDs[3]18818
    childrenIDs[4]18822
    childrenIDs[5]18823
    childrenIDs[6]18824
    childrenIDs[7]18825
    childrenIDs[8]18826
    childrenIDs[9]18826
    childrenIDs[10]18826
    childrenIDs[11]18822
    childrenIDs[12]18823
    childrenIDs[13]18824
    childrenIDs[14]18825
    childrenIDs[15]18826
    childrenIDs[16]18826
    childrenIDs[17]18826
    childrenIDs[18]18822
    childrenIDs[19]18823
    childrenIDs[20]18824
    childrenIDs[21]18825
    childrenIDs[22]18826
    childrenIDs[23]18826
    childrenIDs[24]18826
    childrenIDs[25]18822
    childrenIDs[26]18823
    childrenIDs[27]18824
    childrenIDs[28]18825
    childrenIDs[29]18826
    childrenIDs[30]18826
    childrenIDs[31]18826
    childrenIDs[32]18822
    childrenIDs[33]18823
    childrenIDs[34]18824
    childrenIDs[35]18825
    childrenIDs[36]18826
    childrenIDs[37]18826
    childrenIDs[38]18826
    childrenIDs[39]18822
    childrenIDs[40]18823
    childrenIDs[41]18824
    childrenIDs[42]18825
    childrenIDs[43]18826
    childrenIDs[44]18826
    childrenIDs[45]18826
    childrenIDs[46]18822
    childrenIDs[47]18823
    childrenIDs[48]18824
    childrenIDs[49]18825
    childrenIDs[50]18826
    childrenIDs[51]18826
    childrenIDs[52]18826
    childrenIDs[53]18822
    childrenIDs[54]18823
    childrenIDs[55]18824
    childrenIDs[56]18825
    childrenIDs[57]18826
    childrenIDs[58]18826
    childrenIDs[59]18826
    childrenIDs[60]18819
    childrenIDs[61]18819
    childrenIDs[62]18819
    childrenIDs[63]18819
    childrenIDs[64]18819
    childrenIDs[65]18819
    childrenIDs[66]18819
    childrenIDs[67]18819
    childrenIDs[68]18822
    childrenIDs[69]18823
    childrenIDs[70]18824
    childrenIDs[71]18825
    childrenIDs[72]18826
    childrenIDs[73]18826
    childrenIDs[74]18826
    childrenIDs[75]18822
    childrenIDs[76]18823
    childrenIDs[77]18824
    childrenIDs[78]18825
    childrenIDs[79]18826
    childrenIDs[80]18826
    childrenIDs[81]18826
    childrenIDs[82]18822
    childrenIDs[83]18823
    childrenIDs[84]18824
    childrenIDs[85]18825
    childrenIDs[86]18826
    childrenIDs[87]18826
    childrenIDs[88]18826
    childrenIDs[89]18822
    childrenIDs[90]18823
    childrenIDs[91]18824
    childrenIDs[92]18825
    childrenIDs[93]18826
    childrenIDs[94]18826
    childrenIDs[95]18826
    childrenIDs[96]18822
    childrenIDs[97]18823
    childrenIDs[98]18824
    childrenIDs[99]18825
    childrenIDs[100]18826
    childrenIDs[101]18826
    childrenIDs[102]18826
    childrenIDs[103]18822
    childrenIDs[104]18823
    childrenIDs[105]18824
    childrenIDs[106]18825
    childrenIDs[107]18826
    childrenIDs[108]18826
    childrenIDs[109]18826
    childrenIDs[110]65535
    childrenIDs[111]65535
    childrenIDs[112]65535
    childrenIDs[113]65535
    childrenIDs[114]65535
    childrenIDs[115]65535
    childrenIDs[116]65535
    childrenIDs[117]65535
    childrenIDs[118]65535
    childrenIDs[119]65535
    childrenIDs[120]65535
    childrenIDs[121]65535
    childrenIDs[122]65535
    childrenIDs[123]65535
    childrenIDs[124]65535
    childrenIDs[125]65535
    childrenIDs[126]65535
    childrenIDs[127]65535
    childrenIDs[128]18827
    childrenIDs[129]18828
    childrenIDs[130]18829
    childrenIDs[131]18827
    childrenIDs[132]18828
    childrenIDs[133]18829
    childrenIDs[134]18827
    childrenIDs[135]18828
    childrenIDs[136]18829
    childrenIDs[137]18827
    childrenIDs[138]18828
    childrenIDs[139]18829
    childrenIDs[140]18827
    childrenIDs[141]18828
    childrenIDs[142]18829
    childrenIDs[143]18827
    childrenIDs[144]18828
    childrenIDs[145]18829
    childrenIDs[146]18827
    childrenIDs[147]18828
    childrenIDs[148]18829
    childrenIDs[149]18827
    childrenIDs[150]18828
    childrenIDs[151]18829
    childrenIDs[152]18827
    childrenIDs[153]18828
    childrenIDs[154]18829
    childrenIDs[155]18827
    childrenIDs[156]18828
    childrenIDs[157]18829
    childrenIDs[158]18827
    childrenIDs[159]18828
    childrenIDs[160]18829
    childrenIDs[161]18827
    childrenIDs[162]18828
    childrenIDs[163]18829
    childrenIDs[164]18827
    childrenIDs[165]18828
    childrenIDs[166]18829
    childrenIDs[167]18827
    childrenIDs[168]18828
    childrenIDs[169]18829
    childrenIDs[170]18830
    childrenIDs[171]18831
    childrenIDs[172]18832
    childrenIDs[173]18819
    childrenIDs[174]18819
    childrenIDs[175]18819
    childrenIDs[176]18819
    childrenIDs[177]18819
    childrenIDs[178]18819
    childrenIDs[179]18819
    childrenIDs[180]18819
    childrenIDs[181]18819
    childrenIDs[182]18819
    childrenIDs[183]18819
    childrenIDs[184]18819
    childrenIDs[185]18819
    childrenIDs[186]18819
    childrenIDs[187]18819
    childrenIDs[188]18819
    childrenIDs[189]18819
    childrenIDs[190]18819
    childrenIDs[191]18819
    childrenIDs[192]9044
    childrenIDs[193]9045
    childrenIDs[194]9046
    childrenIDs[195]9047
    childrenIDs[196]9048
    childrenIDs[197]9048
    childrenIDs[198]9049
    childrenIDs[199]9050
    childrenIDs[200]9051
    childrenIDs[201]9052
    childrenIDs[202]9053
    childrenIDs[203]9054
    childrenIDs[204]18819
    childrenIDs[205]18819
    childrenIDs[206]18819
    childrenIDs[207]18819
    childrenIDs[208]18819
    childrenIDs[209]18819
    childrenIDs[210]18819
    childrenIDs[211]18819
    childrenIDs[212]18819
    childrenIDs[213]18819
    childrenIDs[214]18819
    childrenIDs[215]18819
    childrenIDs[216]18819
    childrenIDs[217]18819
    childrenIDs[218]18819
    childrenIDs[219]18819
    childrenIDs[220]65535
    childrenIDs[221]18819
    childrenIDs[222]18819
    childrenIDs[223]18819
    childrenIDs[224]18819
    childrenIDs[225]18819
    childrenIDs[226]18819
    childrenIDs[227]18819
    childrenIDs[228]18819
    childrenIDs[229]18819
    childrenIDs[230]18819
    childrenIDs[231]18819
    childrenIDs[232]18819
    childrenIDs[233]18819
    childrenIDs[234]18819
    childrenIDs[235]18819
    childrenIDs[236]18819
    childrenIDs[237]18819
    childrenIDs[238]18819
    childrenIDs[239]18819
    childrenIDs[240]18819
    childrenIDs[241]18819
    childrenIDs[242]18819
    childrenIDs[243]18819
    childrenIDs[244]18819
    childrenIDs[245]18819
    childrenIDs[246]18819
    childrenIDs[247]18819
    childrenIDs[248]18819
    childrenIDs[249]18819
    childrenIDs[250]18819
    childrenIDs[251]18819
    childrenIDs[252]18819
    childrenIDs[253]18819
    childrenIDs[254]18819
    childrenIDs[255]18817



    Code:
    else if (type == 77 || type == 92) {
    				System.out.println("varp: "  + varp);
    				varp = stream.readUShort();
    
    				if (varp == 0xFFFF) {
    					varp = -1;
    				}
    
    				varbit = stream.readUShort();
    
    				System.out.println("varbit: "  + varp);
    				if (varbit == 0xFFFF) {
    					varbit = -1;
    				}
    
    				int value = -1;
    
    				if (type == 92) {
    					value = stream.readUShort();
    
    					System.out.println("value: "  + value);
    					if (value == 0xFFFF) {
    						value = -1;
    					}
    				}
    				int len = stream.readUnsignedByte();
    				System.out.println("len: " + len);
    				childrenIDs = new int[len + 2];
    				for (int i = 0; i <= len; ++i) {
    					childrenIDs[i] = stream.readUShort();
    
    					System.out.println("childrenIDs["+i+"]"+ childrenIDs[i]);
    					if (childrenIDs[i] == 0xFFFF) {
    						childrenIDs[i] = -1;
    					}
    				}
    				childrenIDs[len + 1] = value;
    			}
    and i have already got

    case 18816:
    objectDef.varbit = 4771;
    break;
    Attached image

    Attached image
    Reply With Quote  
     

  10. #10  
    Donator


    Join Date
    Jan 2010
    Age
    29
    Posts
    4,122
    Thanks given
    274
    Thanks received
    551
    Rep Power
    738
    and now dump varbit 4771 it should tell you the config id and values
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. WindRush Auto-Cast Config Value
    By Gluon in forum Requests
    Replies: 5
    Last Post: 01-07-2016, 01:26 PM
  2. 508 farming configs/values
    By Nighel in forum Help
    Replies: 1
    Last Post: 12-07-2013, 11:40 PM
  3. Config values (Something to do with bit shits?)
    By Wildskiller in forum Requests
    Replies: 10
    Last Post: 06-17-2013, 01:10 AM
  4. Config values
    By Polish Civil in forum Requests
    Replies: 8
    Last Post: 05-08-2011, 12:40 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
  •