Thread: Errors in my Mining.java :\

Results 1 to 4 of 4
  1. #1 Errors in my Mining.java :\ 
    Brandon42792
    Guest
    I am learning to try and take some things out of my client.java into my own files. I read a tutorial on making handlers but It is not helping.

    Here is my problem..


    I have a MiningSkill.java file.. inside it's like this:


    the red in my code is the error that it brings up in my compiler
    Code:
    public class MiningSkill
    {
    	public void deleteIt(client c)
    	{
    		{
     			if (c.useItemID == 1265 && c.atObjectID == 2095) //mining tin
    			{
    				if (c.playerLevel[14] >= 45)
    				{
    					c.sendMessage("You mine 3 tin!");
    					c.addSkillXP(650, 14);
    					c.addItem(438, 1);
    					c.addItem(438, 1);
    					c.addItem(438, 1);
    				} else if (c.playerLevel[14] >= 20 && c.playerLevel[14] < 45)
    				{
    					c.sendMessage("You mine 2 tin!");
    					c.addSkillXP(225, 14);
    					c.addItem(438, 1);
    					c.addItem(438, 1);
    				} else if (c.playerLevel[14] <= 20 && c.playerLevel[14] >= 1)
    				{
    					c.sendMessage("You mine tin!");
    					c.addSkillXP(100, 14);
    					c.addItem(438, 1);
    				} else
    				{
    					c.sendMessage("You need a mining level of 1 to mine this rock!");
    				}
    			}
    		}
    	}
    }

    here is my compiler when it is ran...


    Code:
    
    MiningSkill.java:6: cannot find symbol
    symbol  : variable useItemID
    location: class client
                            if (c.useItemID == 1265 && c.atObjectID == 2095) //minin
    g tin
                                 ^
    MiningSkill.java:6: cannot find symbol
    symbol  : variable atObjectID
    location: class client
                            if (c.useItemID == 1265 && c.atObjectID == 2095) //minin
    g tin
                                                        ^
    Note: stream.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Press any key to continue . . .


    I found where 'useItemID' and 'atObjectID' is and its in this case, I will highlight the variables in red:

    Code:
    
    case 192:
    int actionButton2 = misc.HexToInt(inStream.buffer, 0, packetSize);
    int shark  = misc.HexToInt(inStream.buffer, 0, packetSize);
    int lob  = misc.HexToInt(inStream.buffer, 0, packetSize);
    int carb  = misc.HexToInt(inStream.buffer, 0, packetSize);
    int smelt  = misc.HexToInt(inStream.buffer, 0, packetSize);
    int cow  = misc.HexToInt(inStream.buffer, 0, packetSize);
    int turtle  = misc.HexToInt(inStream.buffer, 0, packetSize);
    int manta  = misc.HexToInt(inStream.buffer, 0, packetSize);
    //int atObjectID = inStream.readUnsignedWordBigEndian();
    //int atObjectY = inStream.readUnsignedWordBigEndianA();
    //int itemSlot = inStream.readUnsignedWordBigEndian();
    //int atObjectX = inStream.readUnsignedWordBigEndianA();
    //int useItemID = inStream.readUnsignedWord();
    int j6 = inStream.readUnsignedWordA();
    int atObjectID = inStream.readSignedWordBigEndian();
    int atObjectY = inStream.readUnsignedWordBigEndianA();
    int itemSlot = inStream.readUnsignedWordBigEndian();
    int atObjectX = inStream.readUnsignedWordBigEndianA();
    int useItemID = inStream.readUnsignedWord();
     

  2. #2  
    Member #35, most veteran member left? :D


    Join Date
    Jul 2006
    Age
    27
    Posts
    2,663
    Thanks given
    53
    Thanks received
    331
    Rep Power
    925
    At the top of your client.java add:
    Code:
    int atObjectID;
    int useItemID;
    And replace what you have in your packet 192 (the lines with red in them) with:
    Code:
    atObjectID = inStream.readSignedWordBigEndian();
    and
    Code:
    useItemID = inStream.readUnsignedWord();
    Respectively. Let me know if this works.
    [Only registered and activated users can see links. ]

    `Ex-global moderator x3 (resigned)
     

  3. #3  
    Registered Member
    Join Date
    Oct 2007
    Posts
    46
    Thanks given
    0
    Thanks received
    0
    Rep Power
    3
    Edit: Runite beats me

    You should just use first click object instead of item on object. If you mine this way, you will have to use the pick with the rock every time

    Look for a objectclick void in your client.java, maybe search first click or click one.

    You can then reference it in mining.java but I would personally just imput it into client.java.. Then again I don't know how to reference that type of void in an external class :\
     

  4. #4  
    Brandon42792
    Guest
    Okay it did get me somewhere. I didnt get any errors..

    but.. when I use the pick on the rock.. it says

    nothing interesting happens.. but something was suppost to happen?
     


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
  •