Thread: ItemOnObject

Results 1 to 6 of 6
  1. #1 ItemOnObject 
    Registered Member
    Optimum's Avatar
    Join Date
    Apr 2012
    Posts
    3,570
    Thanks given
    871
    Thanks received
    1,745
    Rep Power
    5000
    I use mithril kitesield on bank this is what happens

    console prints out this:
    Code:
    [1/7/15 11:47 PM]: Send packet: 192 12
    [1/7/15 11:47 PM]: Item on object: 256
    hers the class
    Code:
    package org.rs2server.entity.players.packets;
    
    import org.rs2server.entity.items.UseItem;
    import org.rs2server.entity.players.Client;
    import org.rs2server.entity.players.PacketType;
    import org.rs2server.entity.players.skills.Cooking;
    
    public class ItemOnObject implements PacketType {
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		//int a = c.getInStream().readUnsignedWord();
    		//int b = c.getInStream().readUnsignedWord();
    		int objectId = c.getInStream().readSignedWordBigEndian();
    		int objectY = c.getInStream().readSignedWordBigEndianA();
    		int objectX = c.getInStream().readSignedWordBigEndianA();
    		int itemId = c.getInStream().readUnsignedWord();
    		System.out.println("Item on object: " + itemId);
    		if (!c.getItems().playerHasItem(itemId, 1)) {
    			return;
    		}
    		UseItem.ItemonObject(c, objectId, objectX, objectY, itemId);
    		switch (objectId) {
    
    			
    		case 12269:
    		case 2732:
    		case 3039:
    		case 114:
    		case 2728:
    			Cooking.cookThisFood(c, itemId, objectId);
    			break;
    			
    		}
    
    	}
    }
    i have tried to set up the readUnsignedWord. here is the servers:
    Code:
    	public int readUnsignedWord() {
    		currentOffset += 2;
    		return ((buffer[currentOffset - 2] & 0xff) << 8) + (buffer[currentOffset - 1] & 0xff);
    	}
    and here is the clients
    Code:
    	public int readUnsignedWord() {
    		try {
    			currentOffset += 2;
    			return ((buffer[currentOffset - 2] & 0xff) << 8)
    					+ (buffer[currentOffset - 1] & 0xff);
    		} catch (Exception e) {
    			return -1;
    		}
    	}
    Any idea's why it's returning the wrong itemId?

    Quote Originally Posted by DownGrade View Post
    Don't let these no life creeps get to you, its always the same on here. They'd rather spend hours upon hours in the rune-server spam section then getting laid! ha ha!Its honestly pathetic i haven't seen so many lowlifes in my life its actually insane i wish that this section would just vanish its probably the only way to get these people out of the community...
    PLEASE BE AWARE OF IMPOSTERS MY DISCORD ID: 362240000760348683
    Reply With Quote  
     

  2. #2  
    Registered Member
    Optimum's Avatar
    Join Date
    Apr 2012
    Posts
    3,570
    Thanks given
    871
    Thanks received
    1,745
    Rep Power
    5000
    Bump

    Quote Originally Posted by DownGrade View Post
    Don't let these no life creeps get to you, its always the same on here. They'd rather spend hours upon hours in the rune-server spam section then getting laid! ha ha!Its honestly pathetic i haven't seen so many lowlifes in my life its actually insane i wish that this section would just vanish its probably the only way to get these people out of the community...
    PLEASE BE AWARE OF IMPOSTERS MY DISCORD ID: 362240000760348683
    Reply With Quote  
     

  3. #3  
    Donator

    Join Date
    Oct 2014
    Posts
    587
    Thanks given
    29
    Thanks received
    76
    Rep Power
    26
    In a PI I have laying around on my computer the actual correct decoder is:

    Code:
    int a = c.getInStream().readUnsignedWord();
    int objectId = c.getInStream().readSignedWordBigEndian();
    int objectY = c.getInStream().readSignedWordBigEndianA();
    int b = c.getInStream().readUnsignedWord();
    int objectX = c.getInStream().readSignedWordBigEndianA();
    int itemId = c.getInStream().readUnsignedWord();
    Try that, no idea what the a or b is, will look in the client later today to find out.
    Programming service - Fast, Cheap & Quality
    http://www.rune-server.org/black-mar...-services.html

    Project that I am currently working on:
    http://www.rune-server.org/runescape...emon-rsps.html

    Reply With Quote  
     

  4. Thankful user:


  5. #4  
    Donator

    Join Date
    Oct 2014
    Posts
    587
    Thanks given
    29
    Thanks received
    76
    Rep Power
    26
    Just looked in Apollo and it says that 'a' is a interface id and 'b' is a slot id.
    Programming service - Fast, Cheap & Quality
    http://www.rune-server.org/black-mar...-services.html

    Project that I am currently working on:
    http://www.rune-server.org/runescape...emon-rsps.html

    Reply With Quote  
     

  6. Thankful user:


  7. #5  
    Donator

    Jason's Avatar
    Join Date
    Aug 2009
    Posts
    6,092
    Thanks given
    2,402
    Thanks received
    2,823
    Rep Power
    4550
    Reading and writing data in specific order is extremely important, you cannot just comment out lines when its not working. Figure out what pieces of data the client is sending for this packet, thats a good place to start.
    Reply With Quote  
     

  8. #6  
    Registered Member
    Optimum's Avatar
    Join Date
    Apr 2012
    Posts
    3,570
    Thanks given
    871
    Thanks received
    1,745
    Rep Power
    5000
    Quote Originally Posted by Jason View Post
    Reading and writing data in specific order is extremely important, you cannot just comment out lines when its not working. Figure out what pieces of data the client is sending for this packet, thats a good place to start.
    I actually realised that it needs to be specific, Thanks

    Quote Originally Posted by Excision Pk View Post
    Just looked in Apollo and it says that 'a' is a interface id and 'b' is a slot id.

    And it works thanks a lot

    Quote Originally Posted by DownGrade View Post
    Don't let these no life creeps get to you, its always the same on here. They'd rather spend hours upon hours in the rune-server spam section then getting laid! ha ha!Its honestly pathetic i haven't seen so many lowlifes in my life its actually insane i wish that this section would just vanish its probably the only way to get these people out of the community...
    PLEASE BE AWARE OF IMPOSTERS MY DISCORD ID: 362240000760348683
    Reply With Quote  
     


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. ItemOnObject problems
    By tidie10 in forum Help
    Replies: 0
    Last Post: 03-12-2009, 07:25 PM
  2. Replies: 4
    Last Post: 03-11-2009, 11:23 PM
  3. ItemOnObject....
    By Alwaysstuck1 in forum Requests
    Replies: 2
    Last Post: 11-27-2008, 07:57 PM
  4. ItemOnObject Handler
    By doodoohead in forum Tutorials
    Replies: 2
    Last Post: 10-15-2007, 03:31 AM
  5. ItemOnObject Handler
    By Kelvin in forum Tutorials
    Replies: 11
    Last Post: 08-08-2007, 03:31 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •