help error smithing

Results 1 to 3 of 3
  1. #1
    Novice marcelvn is offline
    MemberRank
    Jan 2009 Join Date
    1Posts

    help error smithing

    Code:
    .\DavidScape\players\Player.java:94: cannot find symbol
    symbol  : variable smithing
    location: class DavidScape.Engine
    public Smithing smithing = Engine.smithing;
                                     ^
    .\DavidScape\io\packets\ItemOnObject.java:211: cannot find symbol
    symbol  : method smithing(DavidScape.players.Player,int)
    location: class DavidScape.players.Player
                        player.smithing(p, 1);
                              ^
    .\DavidScape\io\packets\ItemOnObject.java:216: break outside switch or loop
                    break;
                    ^
    .\DavidScape\io\packets\ItemOnObject.java:219: boolean cannot be dereferenced
                        p.Smithing.smithing(p, 2);
                                  ^
    .\DavidScape\io\packets\ItemOnObject.java:224: break outside switch or loop
                    break;
                    ^
    .\DavidScape\io\packets\ItemOnObject.java:227: boolean cannot be dereferenced
                        p.Smithing.smithing(p, 3);
                                  ^
    .\DavidScape\io\packets\ItemOnObject.java:232: break outside switch or loop
                    break;
                    ^
    .\DavidScape\io\packets\ItemOnObject.java:236: boolean cannot be dereferenced
                        p.Smithing.smithing(p, 4);
                                  ^
    .\DavidScape\io\packets\ItemOnObject.java:241: break outside switch or loop
                    break;
                    ^
    .\DavidScape\io\packets\ItemOnObject.java:245: boolean cannot be dereferenced
                        p.Smithing.smithing(p, 5);
                                  ^
    .\DavidScape\io\packets\ItemOnObject.java:250: break outside switch or loop
                    break;
                    ^
    .\DavidScape\io\packets\ItemOnObject.java:254: boolean cannot be dereferenced
                        p.Smithing.smithing(p, 6);
                                  ^
    .\DavidScape\io\packets\ItemOnObject.java:259: break outside switch or loop
                    break;
                    ^
    Note: .\DavidScape\players\objectLoader.java uses or overrides a deprecated API.
    
    Note: Recompile with -Xlint:deprecation for details.
    13 errors
    Press any key to continue . . .

    Anyone that know the problem lolking!:confused:


  2. #2
    Novice elmirandalx is offline
    MemberRank
    Jan 2011 Join Date
    CALocation
    1Posts

    Runescape bot x

    Not allowed
    Last edited by GhostSnyper; 04-02-11 at 08:19 AM. Reason: sharing bots

  3. #3
    right + down + X GhostSnyper is offline
    MemberRank
    May 2006 Join Date
    AZ, USALocation
    2,818Posts

    Re: help error smithing

    three errors here

    1)
    .\DavidScape\io\packets\ItemOnObject.java:211: cannot find symbol
    symbol : method smithing(DavidScape.players.Player,int)
    location: class DavidScape.players.Player
    player.smithing(p, 1);
    ^
    Cannot find symbol... In layman's terms, the compiler doesn't know what the method "smithing" is. Basically, what this means is that in your Player class, you do not have a method called smithing... I.E

    PHP Code:
    public class Player implements Entity {

        
    //other code and stuff goes here

        
    public void smithing (Player pint id) {
            
    //do smithing stuff here
        
    }

    if you're using a tutorial, take a closer look. There's most likely some info you're supposed to add to Player.java

    2)
    .\DavidScape\io\packets\ItemOnObject.java:216: break outside switch or loop
    break;
    ^
    This is actually an easy one. I'll just show you what you're doing, and what you should be doing.

    Quote Originally Posted by what you are doing
    PHP Code:
    public Action getAction (int id) {

        switch(
    id) {

            case 
    1:
                return new 
    Action ("Cut Tree"492); 
            break;

            default:
               return 
    null;
        }
        >>>>>>>>>>>>>>>>>>>>>>break;<<<<<<<<<<<<<<<<< 
    // the >< are to point out the error being thrown


    Quote Originally Posted by what you SHOULD be doing
    PHP Code:
    public Action getAction (int id) {

        switch(
    id) {

            case 
    1:
                return new 
    Action ("Cut Tree"492); 
            >>>>>>>>>>>>>>>>>>break;<<<<<<<<<<<<<<<<<<< 
    // the >< are to point out the error being thrown

            
    default:
               return 
    null;
        }
        
    //the break has to be in a loop, or a switch statement, because they are only valid in those instances

    3)
    .\DavidScape\io\packets\ItemOnObject.java:254: boolean cannot be dereferenced
    p.Smithing.smithing(p, 6);
    I'll bet you money that "Smithing" in your Player class(that's what I call your .java files, if you are still confused by it still at this point), and it's most likely a boolean.

    Booleans can only have two states: true or false. You cannot "dereference" them by using them like methods or classes. You should only be using it by saying something like:

    PHP Code:
    p.Smithing true;

    or 

    if (
    p.smithing) {
        
    //stop smithing or perform other action

    Last edited by GhostSnyper; 04-02-11 at 08:35 AM. Reason: Fixed some errors



Advertisement