Thread: [503] Object Clicks

Results 1 to 9 of 9
  1. #1 [503] Object Clicks 
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    Description: Adding all object clicks if not i mist 1 or 2
    Difficulty: 1/10
    Assumed Knowledge: Basic Java, RS2E Knowledge
    Tested Server: RS2E some version lol
    Files/Classes Modified: ObjectClicks.java & HandlePacket.java
    Credits: 100% me i didnt use ownage bones first click when i came on today i was like ah **** that coulda saved me some time

    Go into the package Packets
    inside of it make a new package called PacketTypes
    in there make a new class called ObjectPackets
    Inside your new class add

    Code:
    /*
     * ObjectPackets
     *
     * Monday, June 28, 2008
     *
     * Created by Shamon King
     */
    
    package RS2E.Packets.PacketTypes;
    
    import RS2E.Players.*;
    
    public class ObjectPackets {
    
    	/*
             * Packet ID: examine
    	 * 207
    	 */
    
    	public void examineObject(Player p) {
    		// nothing at the time
    	}
    
    	/*
             * Packet ID: first click
    	 * 27
    	 */
    
    	public void objectClickOne(Player p) {
    	
                    int objectID = p.inStream.readUnsignedWord();
                    int objectY = p.inStream.readUnsignedWordBigEndian();
                    int objectX = p.inStream.readUnsignedWord();
    
    		System.out.println(objectID + ": " + objectX + ", " + objectY);
    
    		switch(objectID) {
    			case 1281:
    				System.out.println("You start cutting the tree.");
    				break;
    		}
    	}
    
    	/*
             * Packet ID: 2.1 click
    	 * 67
    	 */
    
    	public void objectClickTwo(Player p) {
    
                    int objectX = p.inStream.readSignedWordA();
                    int objectID = p.inStream.readUnsignedWord();
                    int objectY = p.inStream.readUnsignedWord();
    	
    		System.out.println(objectID + ": " + objectX + ", " + objectY);
    
    		switch(objectID) {
    			case 1281:
    				System.out.println("You start cutting the tree.");
    				break;
    		}
    	}
    
    	/*
             * Packet ID: 2.2 click
    	 * 129
    	 */
    
    	public void objectClickTwoTwo(Player p) {
    
                    int objectID = p.inStream.readUnsignedWordBigEndian();
                    int objectX = p.inStream.readUnsignedWordA();
                    int objectY = p.inStream.readUnsignedWordBigEndian();
    
    		System.out.println(objectID + ": " + objectX + ", " + objectY);
    
    		switch(objectID) {
    			case 1281:
    				System.out.println("You start cutting the tree.");
    				break;
    		}
    	}
    	/*
             * Packet ID: third click
    	 * 23
    	 */
    
    	public void objectClickThree(Player p) {
    
                    int objectX = p.inStream.readUnsignedWordBigEndianA();
                    int objectY = p.inStream.readUnsignedWordBigEndianA();
                    int objectID = p.inStream.readUnsignedWord();
    
    		System.out.println(objectID + ": " + objectX + ", " + objectY);
    
    		switch(objectID) {
    			case 1281:
    				System.out.println("You start cutting the tree.");
    				break;
    		}
    	}
    }
    now go into HandlePackets
    add this package
    Code:
    import RS2E.Packets.PacketTypes.ObjectPackets;
    now add this under the public class
    Code:
    private ObjectPackets objects = new ObjectPackets();
    under the switch add
    Code:
    	    case 27:
    		objects.objectClickOne(p);
    	    	break;
    
    	    case 67:
    		objects.objectClickTwo(p);
    	    	break;
    
    	    case 129:
    		objects.objectClickTwoTwo(p);
    	    	break;
    
    	    case 23:
    		objects.objectClickThree(p);
    	    	break;
    
    	    case 207:
    		objects.examineObject(p);
    	    	break;
    now save compile and run
    this will add all the object clicks if not its missing 1 or 2
    also added the examine packet just to see if anyone can figure it out
    Reply With Quote  
     

  2. #2  
    Registered Member
    The Lizard King's Avatar
    Join Date
    Jun 2008
    Posts
    837
    Thanks given
    13
    Thanks received
    12
    Rep Power
    169
    Ty for releasing but when i right click a tree it show the menu for a sec and then dissapears
    Reply With Quote  
     

  3. #3  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    hold the right click then lol
    Reply With Quote  
     

  4. #4  
    Registered Member
    The Lizard King's Avatar
    Join Date
    Jun 2008
    Posts
    837
    Thanks given
    13
    Thanks received
    12
    Rep Power
    169
    isnt working still disapearing
    Reply With Quote  
     

  5. #5  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    you dont even really need to click the menus
    you can just click the object unless it has more then 2 options
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Sep 2006
    Posts
    375
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    Include this instead of using System.out.println for things.

    Add this to RS2E.Packets.Frames:
    Code:
    	public void sendMessage(Player p, String s)
    	{
            if(p == null || p.outStream == null || p.disconnected[0]) 
    		{
                return;
            }
            p.outStream.createFrameVarSize(39);
            p.outStream.writeString(s);
    		p.outStream.endFrameVarSize();
    		}
    Usage:
    Code:
    p.frame.sendMessage(p, "blah blah");
    Reply With Quote  
     

  7. #7  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    why?
    what if i want to just print things through the command prompt?
    im not adding that this is object clicks not sendmessages
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Sep 2006
    Posts
    375
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    Sure, up to you :-) Was just trying to help because it would be better if it printed You chop down a tree in chatbox rather than the cmd.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Shamon King's Avatar
    Join Date
    Aug 2007
    Posts
    3,336
    Thanks given
    90
    Thanks received
    228
    Rep Power
    1363
    like 87 fews and little posts
    did anyone even use this (c)
    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

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