Results 1 to 9 of 9
  1. #1
    Alienz is offline Member
    Join Date
    Apr 2011
    Posts
    13
    Rep Power
    0

    Exclamation 1 error left D: help please

    Hey guys, I just cleaned up my script and I am down to 1 error. Can anyone help me out with it?

    Java Code:
    ';' expected
    new RSTile(2338, 3807)};
                                   ^
    Here is the code before it

    Java Code:
    import java.util.Map;
    import org.rsbot.script.Script;
    import org.rsbot.script.ScriptManifest;
    import org.rsbot.script.wrappers.RSArea;
    import org.rsbot.script.wrappers.RSObject;
    import org.rsbot.script.wrappers.RSTile;
    
    	@ScriptManifest(authors = "Alienz",  name = "YakPicker", version = 1.0, description = "Picks up Yak hide and banks")
    	public class YakPicker extends Script {;
    	
    	int yakHideID = 10818;
    	int bankChestID = 21301;
    	
    	private void yaksToBank(){ new RSTile(2326, 3798); new RSTile(2326, 3801); new RSTile(2328, 3805); newRSTile(2334, 3804);
    			new RSTile(2338, 3807)
    };


    THANKS IN ADVANCE :D

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    Values in an array initialisation are separated by commas not semi-colons.

  3. #3
    Alienz is offline Member
    Join Date
    Apr 2011
    Posts
    13
    Rep Power
    0

    Default

    Now it is saying this...



    Scripts\Sources\YakPicker.java:14: ';' expected
    private void yaksToBank(){ new RSTile(2326, 3798), new RSTile(2326, 3801
    ), new RSTile(2328, 3805), newRSTile(2334, 3804),
    ^
    Scripts\Sources\YakPicker.java:14: ';' expected
    private void yaksToBank(){ new RSTile(2326, 3798), new RSTile(2326, 3801
    ), new RSTile(2328, 3805), newRSTile(2334, 3804),

    ^
    Scripts\Sources\YakPicker.java:14: ';' expected
    private void yaksToBank(){ new RSTile(2326, 3798), new RSTile(2326, 3801
    ), new RSTile(2328, 3805), newRSTile(2334, 3804),

    ^
    Scripts\Sources\YakPicker.java:14: ';' expected
    private void yaksToBank(){ new RSTile(2326, 3798), new RSTile(2326, 3801
    ), new RSTile(2328, 3805), newRSTile(2334, 3804),

    ^
    Scripts\Sources\YakPicker.java:15: ';' expected
    new RSTile(2338, 3807)};
    ^

  4. #4
    Vase is offline Member
    Join Date
    Jan 2011
    Location
    Gainesville, FL
    Posts
    45
    Rep Power
    0

    Default

    It looks like yaksToBank() is a method definition, not an array.

    For the record, you don't need semi-colons after braces; they are just read by the compiler as empty statements.

    Java Code:
    public class YakPicker extends Script {;
    	
    	int yakHideID = 10818;
    	int bankChestID = 21301;
    	
    	private void yaksToBank() {
                new RSTile(2326, 3798);
                new RSTile(2326, 3801);
                new RSTile(2328, 3805);
                newRSTile(2334, 3804); [color=red]// typo[/color]
                new RSTile(2338, 3807) [color=red]// no semi-colon[/color]
    
    } [color=red]// remove semi-colon[/color]

  5. #5
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    The first part of that line is a method signature. The second part is an incomplete array creation. It is not legal syntax. What are you trying to do? Your basic knowledge of the Java language is severely lacking and you are nowhere near competent enough to be attempting a project like this.

  6. #6
    Alienz is offline Member
    Join Date
    Apr 2011
    Posts
    13
    Rep Power
    0

    Default

    Sorry Junky :/ this is my first script. I am actually going through a tutorial and as I learn something I try to implement it into my script. It helps me learn it.

    Sorry again.

  7. #7
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,800
    Rep Power
    7

    Default

    This is not the way to learn. This is analogous to a med student performing open heart surgery on their first day.

  8. #8
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Quote Originally Posted by Junky View Post
    This is not the way to learn. This is analogous to a med student performing open heart surgery on their first day.

    I like that way to learn surgery.

    @aliens, I believe you will benefit greatly from the sun tutorials. If you are coding java for your rune scale bot, understanding some of the fundamental java principles will be incredibly helpful.

  9. #9
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    @aliens, I believe you will benefit greatly from the sun tutorials.
    Only if they're from this solar system ;)

    Sorry, couldn't resist.

    db

Similar Threads

  1. square moves left and down but not up or left
    By natdizzle in forum AWT / Swing
    Replies: 3
    Last Post: 02-04-2011, 06:20 PM
  2. mp5 left!!.. anyOne know it?.
    By jhon123 in forum New To Java
    Replies: 0
    Last Post: 01-31-2011, 06:50 AM
  3. jasperreport-right to left
    By marjanzfz in forum Advanced Java
    Replies: 1
    Last Post: 09-15-2009, 04:06 PM
  4. Align left
    By britto_bicsjohn in forum AWT / Swing
    Replies: 2
    Last Post: 09-09-2009, 05:05 AM
  5. menu in top left always
    By sschwinghammer in forum New To Java
    Replies: 2
    Last Post: 02-06-2008, 03:39 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
  •