Thread: [667] A quick Turael.java problem

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 [667] A quick Turael.java problem 
    Registered Member
    Join Date
    Jul 2012
    Posts
    134
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Hey, currently I'm adding a basic Turael dialogue until I can think of more to add to it.

    Only problem is; I'm getting 3 errors.
    Code:
    src\com\rs\game\player\dialogues\Turael.java:122: error: ';' expected
    public void finish() {
                      ^
    src\com\rs\game\player\dialogues\Turael.java:130: error: illegal start of expres
    sion
     private int npcId;
     ^
    src\com\rs\game\player\dialogues\Turael.java:133: error: reached end of file whi
    le parsing
    }
     ^
    3 errors
    Press any key to continue . . .
    My Turael.java is:
    Spoiler for Turael:
    Code:
    package com.rs.game.player.dialogues;
     
    import com.rs.cache.loaders.NPCDefinitions;
    import com.rs.game.player.actions.Slayer;
    import com.rs.utils.ShopsHandler;
    import com.rs.game.player.content.slayer.SlayerMaster;
    import com.rs.game.player.actions.slayer.SlayerTask;
     
    
    public class Turael extends Dialogue {
     
     /**
      * Starts the dialogue
      */
    
     public Turael() {
    
     }
     
        @Override
        public void start() {
            npcId = (Integer) parameters[0];
            sendEntityDialogue(SEND_1_TEXT_CHAT,
                    new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
                            "Hey! What would you like?" }, 
    	(byte) 1, npcId, 9827);
        }
     
        @Override
        public void run(int interfaceId, int componentId) {
                    sendEntityDialogue(SEND_4_OPTIONS, new String[] {
                            SEND_DEFAULT_OPTIONS_TITLE,
                            "How many monsters do I have left?",
                            "What do you have in your shop?", "Give me a tip.",
                            "Nothing." }, IS_PLAYER, player.getIndex(),
                            9827);
                    stage = 0;
                    sendEntityDialogue(SEND_4_OPTIONS, new String[] {
                            SEND_DEFAULT_OPTIONS_TITLE, "Please give me a task.",
                            "What do you have in your shop?", "Give me a tip.",
                            "Nothing." }, IS_PLAYER, player.getIndex(),
                            9827);
                    stage = 1;
             if (stage == 0 || stage == 1) {
                if (componentId == 1) {
                    SlayerTask task = player.getSlayerTask();
                    if (task != null && stage == 0) {
                        sendEntityDialogue(
                                SEND_1_TEXT_CHAT,
                                new String[] {
                                        NPCDefinitions.getNPCDefinitions(npcId).name,
                                        "You're current assigned to kill "
                                                + task.getName().toLowerCase()
                                                + " only " + task.getAmount()
                                                + " more to go." }, IS_NPC, npcId,
                                9827);
                    } else {
                        Slayer.submitRandomTask(player);
                        sendEntityDialogue(
                                SEND_1_TEXT_CHAT,
                                new String[] {
                                        NPCDefinitions.getNPCDefinitions(npcId).name,
                                        "Your new task is to kill "
                                                + player.getSlayerTask().getName()
                                                        .toLowerCase() + "." },
                                IS_NPC, npcId, 9827);
                    }
                    stage = -1;
                } else if (componentId == 2) {
                    sendEntityDialogue(
                            SEND_1_TEXT_CHAT,
                            new String[] {
                                    NPCDefinitions.getNPCDefinitions(npcId).name,
                                    "I have multiple items for sale." }, IS_NPC,
                            npcId, 9827);
                    ShopsHandler.openShop(player, 29);
                    stage = -1;
                } else if (componentId == 3) {
                    sendEntityDialogue(
                            SEND_1_TEXT_CHAT,
                            new String[] {
                                    NPCDefinitions.getNPCDefinitions(npcId).name,
                                    "I currently dont have any tips for you now." },
                            IS_NPC, npcId, 9827);
                    stage = -1;
                } else {
                    end();
                }
    	stage = 2;
                sendEntityDialogue(SEND_2_OPTIONS, new String[] {
                        SEND_DEFAULT_OPTIONS_TITLE, "What do you have in your shop?", "Nothing." },
                        IS_PLAYER, player.getIndex(), 9827);
                stage = 3;
                if (stage == 3) {
                    if (componentId == 1) {
                        if (player.getSlayerTask() != null) {
                            sendEntityDialogue(
                                    SEND_1_TEXT_CHAT,
                                    new String[] {
                                            NPCDefinitions.getNPCDefinitions(npcId).name,
                                            "I cannot teach you until your slayer task is complete. Come back later." },
                                    IS_NPC, npcId, 9827);
                            return;
                        }
                        sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
                                NPCDefinitions.getNPCDefinitions(npcId).name,
                                "You are now under my wings." }, IS_NPC, npcId,
                                9827);
                        player.setSlayerMaster(Master.forId(npcId));
    		if (componentId == 2) {
                        sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
                                NPCDefinitions.getNPCDefinitions(npcId).name,
                                "I have multiple items for sale." }, IS_NPC, npcId,
                                9827);
                        ShopsHandler.openShop(player, 29);
                    } else {
                        end();
                    }
                }
     
     @Override
    public void finish() {
        
     }
     
     /**
      * Declares the npc ID
      */
    
     private int npcId;
    	}
    }


    If you can help, thanks a lot.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Oct 2012
    Posts
    164
    Thanks given
    12
    Thanks received
    6
    Rep Power
    0
    Why not just use the eclipse IDE?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jul 2012
    Posts
    134
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Bazi View Post
    Why not just use the eclipse IDE?
    Haven't really ever used Eclipse, guess I should learn how eh lol
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Oct 2012
    Posts
    164
    Thanks given
    12
    Thanks received
    6
    Rep Power
    0
    You should, it helps fix a lot of errors. Especially really easy ones like this.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jul 2012
    Posts
    134
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Bazi View Post
    You should, it helps fix a lot of errors. Especially really easy ones like this.
    Well I fixed the parsing error and the ";" expected errors. Never really took a careful look and facepalmed when I seen that. I know the other one is rather simple, just seem to be braindead.
    Reply With Quote  
     

  6. #6  
    Donator

    Josh''s Avatar
    Join Date
    Jul 2012
    Age
    26
    Posts
    2,036
    Thanks given
    1,119
    Thanks received
    520
    Rep Power
    192
    Delete/add brackets at the end below that code: Public void finish()

    then you're golden
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jul 2012
    Posts
    134
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by Joshreynolds123 View Post
    Delete/add brackets at the end below that code: Public void finish()

    then you're golden
    The following spoiler displays my turael.java
    Spoiler for Turael:
    Code:
    package com.rs.game.player.dialogues;
     
    import com.rs.cache.loaders.NPCDefinitions;
    import com.rs.game.player.actions.Slayer;
    import com.rs.utils.ShopsHandler;
    import com.rs.game.player.content.slayer.SlayerMaster;
    import com.rs.game.player.actions.slayer.SlayerTask;
     
    public class Turael extends Dialogue {
     
     /**
      * Starts the dialogue
      */
    
     public Turael() {
    
     }
     
        @Override
        public void start() {
            npcId = (Integer) parameters[0];
            sendEntityDialogue(SEND_1_TEXT_CHAT,
                    new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
                            "Hey! What would you like?" }, 
    	(byte) 1, npcId, 9827);
        }
     
        @Override
        public void run(int interfaceId, int componentId) {
                    sendEntityDialogue(SEND_4_OPTIONS, new String[] {
                            SEND_DEFAULT_OPTIONS_TITLE,
                            "How many monsters do I have left?",
                            "What do you have in your shop?", "Give me a tip.",
                            "Nothing." }, IS_PLAYER, player.getIndex(),
                            9827);
                    stage = 0;
                    sendEntityDialogue(SEND_4_OPTIONS, new String[] {
                            SEND_DEFAULT_OPTIONS_TITLE, "Please give me a task.",
                            "What do you have in your shop?", "Give me a tip.",
                            "Nothing." }, IS_PLAYER, player.getIndex(),
                            9827);
                    stage = 1;
             if (stage == 0 || stage == 1) {
                if (componentId == 1) {
                    SlayerTask task = player.getSlayerTask();
                    if (task != null && stage == 0) {
                        sendEntityDialogue(
                                SEND_1_TEXT_CHAT,
                                new String[] {
                                        NPCDefinitions.getNPCDefinitions(npcId).name,
                                        "You're current assigned to kill "
                                                + task.getName().toLowerCase()
                                                + " only " + task.getAmount()
                                                + " more to go." }, IS_NPC, npcId,
                                9827);
                    } else {
                        Slayer.submitRandomTask(player);
                        sendEntityDialogue(
                                SEND_1_TEXT_CHAT,
                                new String[] {
                                        NPCDefinitions.getNPCDefinitions(npcId).name,
                                        "Your new task is to kill "
                                                + player.getSlayerTask().getName()
                                                        .toLowerCase() + "." },
                                IS_NPC, npcId, 9827);
                    }
                    stage = -1;
                } else if (componentId == 2) {
                    sendEntityDialogue(
                            SEND_1_TEXT_CHAT,
                            new String[] {
                                    NPCDefinitions.getNPCDefinitions(npcId).name,
                                    "I have multiple items for sale." }, IS_NPC,
                            npcId, 9827);
                    ShopsHandler.openShop(player, 29);
                    stage = -1;
                } else if (componentId == 3) {
                    sendEntityDialogue(
                            SEND_1_TEXT_CHAT,
                            new String[] {
                                    NPCDefinitions.getNPCDefinitions(npcId).name,
                                    "I currently dont have any tips for you now." },
                            IS_NPC, npcId, 9827);
                    stage = -1;
                } else {
                    end();
                }
    	stage = 2;
                sendEntityDialogue(SEND_2_OPTIONS, new String[] {
                        SEND_DEFAULT_OPTIONS_TITLE, "What do you have in your shop?", "Nothing." },
                        IS_PLAYER, player.getIndex(), 9827);
                stage = 3;
                if (stage == 3) {
                    if (componentId == 1) {
                        if (player.getSlayerTask() != null) {
                            sendEntityDialogue(
                                    SEND_1_TEXT_CHAT,
                                    new String[] {
                                            NPCDefinitions.getNPCDefinitions(npcId).name,
                                            "I cannot teach you until your slayer task is complete. Come back later." },
                                    IS_NPC, npcId, 9827);
                            return;
                        }
                        sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
                                NPCDefinitions.getNPCDefinitions(npcId).name,
                                "You are now under my wings." }, IS_NPC, npcId,
                                9827);
                        player.setSlayerMaster(Master.forId(npcId));
    		if (componentId == 2) {
                        sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
                                NPCDefinitions.getNPCDefinitions(npcId).name,
                                "I have multiple items for sale." }, IS_NPC, npcId,
                                9827);
                        ShopsHandler.openShop(player, 29);
                    } else {
                        end();
                    }
                }
     
     @Override
    private int npcId;
     
     /**
      * Declares the npc ID
      */
    
    }
    	{
    {
    public void finish()
             }
            }
           }
          }
         }


    And I still get 3 errors.
    Code:
    src\com\rs\game\player\dialogues\Turael.java:130: error: illegal start of expres
    sion
    public void finish()
    ^
    src\com\rs\game\player\dialogues\Turael.java:130: error: illegal start of expres
    sion
    public void finish()
           ^
    src\com\rs\game\player\dialogues\Turael.java:130: error: ';' expected
    public void finish()
                      ^
    3 errors
    Press any key to continue . . .
    Reply With Quote  
     

  8. #8  
    Super Donator
    Kova+'s Avatar
    Join Date
    Jan 2012
    Posts
    937
    Thanks given
    124
    Thanks received
    249
    Rep Power
    13
    public void finish()
    }
    }
    }
    }
    }
    ?
    public void finish() {

    }
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jul 2012
    Posts
    134
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Quote Originally Posted by partyhatz View Post
    public void finish()
    }
    }
    }
    }
    }
    ?
    public void finish() {

    }
    Code:
    src\com\rs\game\player\dialogues\Turael.java:129: error: ';' expected
    public void finish()
                        ^
    src\com\rs\game\player\dialogues\Turael.java:131: error: class, interface, or en
    um expected
    }
    ^
    src\com\rs\game\player\dialogues\Turael.java:136: error: class, interface, or en
    um expected
    public void finish() {
           ^
    3 errors
    Press any key to continue . . .
    Spoiler for Turael.java:
    Code:
    package com.rs.game.player.dialogues;
     
    import com.rs.cache.loaders.NPCDefinitions;
    import com.rs.game.player.actions.Slayer;
    import com.rs.utils.ShopsHandler;
    import com.rs.game.player.content.slayer.SlayerMaster;
    import com.rs.game.player.actions.slayer.SlayerTask;
     
    public class Turael extends Dialogue {
     
     /**
      * Starts the dialogue
      */
    
     public Turael() {
    
     }
     
        @Override
        public void start() {
            npcId = (Integer) parameters[0];
            sendEntityDialogue(SEND_1_TEXT_CHAT,
                    new String[] { NPCDefinitions.getNPCDefinitions(npcId).name,
                            "Hey! What would you like?" }, 
    	(byte) 1, npcId, 9827);
        }
     
        @Override
        public void run(int interfaceId, int componentId) {
                    sendEntityDialogue(SEND_4_OPTIONS, new String[] {
                            SEND_DEFAULT_OPTIONS_TITLE,
                            "How many monsters do I have left?",
                            "What do you have in your shop?", "Give me a tip.",
                            "Nothing." }, IS_PLAYER, player.getIndex(),
                            9827);
                    stage = 0;
                    sendEntityDialogue(SEND_4_OPTIONS, new String[] {
                            SEND_DEFAULT_OPTIONS_TITLE, "Please give me a task.",
                            "What do you have in your shop?", "Give me a tip.",
                            "Nothing." }, IS_PLAYER, player.getIndex(),
                            9827);
                    stage = 1;
             if (stage == 0 || stage == 1) {
                if (componentId == 1) {
                    SlayerTask task = player.getSlayerTask();
                    if (task != null && stage == 0) {
                        sendEntityDialogue(
                                SEND_1_TEXT_CHAT,
                                new String[] {
                                        NPCDefinitions.getNPCDefinitions(npcId).name,
                                        "You're current assigned to kill "
                                                + task.getName().toLowerCase()
                                                + " only " + task.getAmount()
                                                + " more to go." }, IS_NPC, npcId,
                                9827);
                    } else {
                        Slayer.submitRandomTask(player);
                        sendEntityDialogue(
                                SEND_1_TEXT_CHAT,
                                new String[] {
                                        NPCDefinitions.getNPCDefinitions(npcId).name,
                                        "Your new task is to kill "
                                                + player.getSlayerTask().getName()
                                                        .toLowerCase() + "." },
                                IS_NPC, npcId, 9827);
                    }
                    stage = -1;
                } else if (componentId == 2) {
                    sendEntityDialogue(
                            SEND_1_TEXT_CHAT,
                            new String[] {
                                    NPCDefinitions.getNPCDefinitions(npcId).name,
                                    "I have multiple items for sale." }, IS_NPC,
                            npcId, 9827);
                    ShopsHandler.openShop(player, 29);
                    stage = -1;
                } else if (componentId == 3) {
                    sendEntityDialogue(
                            SEND_1_TEXT_CHAT,
                            new String[] {
                                    NPCDefinitions.getNPCDefinitions(npcId).name,
                                    "I currently dont have any tips for you now." },
                            IS_NPC, npcId, 9827);
                    stage = -1;
                } else {
                    end();
                }
    	stage = 2;
                sendEntityDialogue(SEND_2_OPTIONS, new String[] {
                        SEND_DEFAULT_OPTIONS_TITLE, "What do you have in your shop?", "Nothing." },
                        IS_PLAYER, player.getIndex(), 9827);
                stage = 3;
                if (stage == 3) {
                    if (componentId == 1) {
                        if (player.getSlayerTask() != null) {
                            sendEntityDialogue(
                                    SEND_1_TEXT_CHAT,
                                    new String[] {
                                            NPCDefinitions.getNPCDefinitions(npcId).name,
                                            "I cannot teach you until your slayer task is complete. Come back later." },
                                    IS_NPC, npcId, 9827);
                            return;
                        }
                        sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
                                NPCDefinitions.getNPCDefinitions(npcId).name,
                                "You are now under my wings." }, IS_NPC, npcId,
                                9827);
                        player.setSlayerMaster(Master.forId(npcId));
    		if (componentId == 2) {
                        sendEntityDialogue(SEND_1_TEXT_CHAT, new String[] {
                                NPCDefinitions.getNPCDefinitions(npcId).name,
                                "I have multiple items for sale." }, IS_NPC, npcId,
                                9827);
                        ShopsHandler.openShop(player, 29);
                    } else {
                        end();
                    }
                }
     
     @Override
    private int npcId;
     
     /**
      * Declares the npc ID
      */
    }
    }
    }
    public void finish()
    }
    }
    }
    }
    }
    ?
    public void finish() {
    
    }
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jul 2012
    Posts
    134
    Thanks given
    3
    Thanks received
    5
    Rep Power
    11
    Anyone?
    Reply With Quote  
     

Page 1 of 3 123 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. Turael Dialogue [667]
    By PvMLegacyTyler in forum Help
    Replies: 1
    Last Post: 11-26-2012, 02:32 PM
  2. 667 Help, Quick!
    By altiar in forum Help
    Replies: 2
    Last Post: 07-03-2012, 01:32 PM
  3. Quick Java question please help
    By kill you704 in forum Help
    Replies: 1
    Last Post: 06-03-2012, 04:48 AM
  4. Need quick help please [667/711]
    By Xoath in forum Help
    Replies: 4
    Last Post: 04-21-2012, 12:35 AM
  5. 667/704 Need quick help!
    By Xoath in forum Help
    Replies: 6
    Last Post: 04-04-2012, 02:48 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
  •