Thread: Item On Interface method

Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1 Item On Interface method 
    Registered Member CbSeven's Avatar
    Join Date
    Mar 2011
    Age
    31
    Posts
    55
    Thanks given
    3
    Thanks received
    2
    Rep Power
    1
    So I've added this method:
    Code:
    public void displayItem(int frame, int item, int slot, int amount) {
    		c.outStream.createFrameVarSizeWord(34);
    		c.outStream.writeWord(frame);
    		c.outStream.writeByte(slot);
    		c.outStream.writeWord(item+1);
    		c.outStream.writeByte(255);
    		c.outStream.writeDWord(amount);
    		c.outStream.endFrameVarSizeWord();
    	}
    which is supposed to be the frame method for displaying items on an interface, but every time I call this packet through a command,
    Code:
    if (playerCommand.startsWith("iof")) {
    				c.getPA().displayItem(12140, 1050, 0, 240); // frame id, item Id, slot, zoom
    				c.sendMessage("CHECK");
    			}
    My client throws a NullPointerException at line 11473 in my client class.

    Code:
    case 34:
    					needDrawTabArea = true;
    					int i9 = inStream.readUnsignedWord();
    					RSInterface class9_2 = RSInterface.interfaceCache[i9];
    					while(inStream.currentOffset < pktSize) {
    						int j20 = inStream.method422();
    						int i23 = inStream.readUnsignedWord();
    						int l25 = inStream.readUnsignedByte();
    						if(l25 == 255)
    							l25 = inStream.readDWord();
    						if(j20 >= 0 && j20 < class9_2.inv.length) { 
    							class9_2.inv[j20] = i23;
    							class9_2.invStackSizes[j20] = l25;
    						}
    					}
    					pktType = -1;
    					return true;
    Here's the exception being thrown:
    Code:
    java.lang.NullPointerException
            at client.parsePacket(client.java:11473)
            at client.mainGameProcessor(client.java:2691)
            at client.processGameLoop(client.java:1989)
            at RSApplet.run(RSApplet.java:101)
            at client.run(client.java:4402)
            at java.lang.Thread.run(Unknown Source)
    Base is galkon's

    Could anyone help?
    Quote Originally Posted by _Zip View Post
    >claims to bring us back to Rs in 2006
    >didnt play Rs in 2006
    >LOGIC.
    Reply With Quote  
     

  2. #2  
    plz dont take my wizard mind bombs Women's Avatar
    Join Date
    Mar 2010
    Posts
    1,881
    Thanks given
    724
    Thanks received
    1,162
    Rep Power
    4763
    it'd be nice to see the error
    Reply With Quote  
     

  3. #3  
    Registered Member CbSeven's Avatar
    Join Date
    Mar 2011
    Age
    31
    Posts
    55
    Thanks given
    3
    Thanks received
    2
    Rep Power
    1
    Quote Originally Posted by Women View Post
    it'd be nice to see the error
    Sorry about that, edited first post.
    Quote Originally Posted by _Zip View Post
    >claims to bring us back to Rs in 2006
    >didnt play Rs in 2006
    >LOGIC.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Jan 2013
    Posts
    553
    Thanks given
    38
    Thanks received
    154
    Rep Power
    127
    The inv array for the interface you're trying to send is null.
    Reply With Quote  
     

  5. #5  
    Registered Member CbSeven's Avatar
    Join Date
    Mar 2011
    Age
    31
    Posts
    55
    Thanks given
    3
    Thanks received
    2
    Rep Power
    1
    Quote Originally Posted by iLiftPlenty View Post
    The inv array for the interface you're trying to send is null.
    Thanks. I'll look into it.

    You wouldn't happen to know an interface Id that actually supports items on them? It would work then, correct?
    Quote Originally Posted by _Zip View Post
    >claims to bring us back to Rs in 2006
    >didnt play Rs in 2006
    >LOGIC.
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jan 2013
    Posts
    553
    Thanks given
    38
    Thanks received
    154
    Rep Power
    127
    Quote Originally Posted by CbSeven View Post
    Thanks. I'll look into it.

    You wouldn't happen to know an interface Id that actually supports items on them? It would work then, correct?
    Bank interface, Inventory interface, Shop interface.
    Reply With Quote  
     

  7. #7  
    Registered Member CbSeven's Avatar
    Join Date
    Mar 2011
    Age
    31
    Posts
    55
    Thanks given
    3
    Thanks received
    2
    Rep Power
    1
    Quote Originally Posted by iLiftPlenty View Post
    Bank interface, Inventory interface, Shop interface.
    I guess it must be the way I'm using this method, because I changed the interface ID to the shop interface ID, 3824.

    Still no luck, same error.
    Quote Originally Posted by _Zip View Post
    >claims to bring us back to Rs in 2006
    >didnt play Rs in 2006
    >LOGIC.
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Jan 2013
    Posts
    553
    Thanks given
    38
    Thanks received
    154
    Rep Power
    127
    Quote Originally Posted by CbSeven View Post
    I guess it must be the way I'm using this method, because I changed the interface ID to the shop interface ID, 3824.

    Still no luck, same error.
    Pretty sure the child id for shop items is 3823
    Reply With Quote  
     

  9. #9  
    Registered Member CbSeven's Avatar
    Join Date
    Mar 2011
    Age
    31
    Posts
    55
    Thanks given
    3
    Thanks received
    2
    Rep Power
    1
    Quote Originally Posted by iLiftPlenty View Post
    Pretty sure the child id for shop items is 3823
    Using that id brings up nothing, but the client throws no error.
    Quote Originally Posted by _Zip View Post
    >claims to bring us back to Rs in 2006
    >didnt play Rs in 2006
    >LOGIC.
    Reply With Quote  
     

  10. #10  
    Registered Member CbSeven's Avatar
    Join Date
    Mar 2011
    Age
    31
    Posts
    55
    Thanks given
    3
    Thanks received
    2
    Rep Power
    1
    bump.
    Quote Originally Posted by _Zip View Post
    >claims to bring us back to Rs in 2006
    >didnt play Rs in 2006
    >LOGIC.
    Reply With Quote  
     

Page 1 of 2 12 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. Replies: 5
    Last Post: 01-02-2009, 05:33 AM
  2. [508]item on interface
    By Richard1992 in forum RS 503+ Client & Server
    Replies: 28
    Last Post: 09-15-2008, 12:36 AM
  3. Item on interface release
    By peterbjornx in forum RS 503+ Client & Server
    Replies: 12
    Last Post: 09-12-2008, 11:48 PM
  4. Replies: 17
    Last Post: 04-28-2008, 01:10 PM
  5. Replies: 30
    Last Post: 02-10-2008, 04:48 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
  •