Thread: Simple Interface command

Page 1 of 3 123 LastLast
Results 1 to 10 of 22
  1. #1 Simple Interface command 
    Banned
    Join Date
    Jul 2012
    Posts
    114
    Thanks given
    10
    Thanks received
    7
    Rep Power
    0
    Hello. I'm trying to implement a ::updates command, That will bring up an interface with the recent updates that has been established. However, i'm getting something i don't think i've seen before. Here is my command:

    Code:
    	if (cmd.toLowerCase().startsWith("updates")) {
    			c.getPA().setInterfaceText("Recent Updates", 18814);
    			int id = 18822;
    			c.getPA().setInterfaceText("Increased Combat exp slightly.", id++);
    			c.getPA().setInterfaceText("Anti anti-bot into Thieving.", id++);
    			c.getPA().setInterfaceText("Added Dragon/Ruby bolts (e) into shops.", id++);
    			c.getPA().setInterfaceText("Simplified Barrows minigame.", id++);
    			c.getPA().setInterfaceText("Revised Zombie minigame rewards.", id++);
    			c.getPA().setInterfaceText("Fixed a few item slot mismatches.", id++);
    			c.getPA().setInterfaceText(":Added Money pouch in bank.", id++);
    			
    			for (int i = id; i < 18922; i++) c.getPA().setInterfaceText("", i);
    				c.getPA().showInterface(18810);
    When i implement that in Commands.java, I get multiple errors as in:

    Duplicate local variable with this line:

    Code:
    int id = 18822;
    That's for a rules interface.

    &&

    Code:
    int id = 18822;
    That's for a commands interface.

    Same code as above for a Lottery interface.

    All are throwing out the same error with that duplicate local variable. But when i "Null" out of updates command. It works perfectly without errors. Is there something i'm missing in that command? Cause it looks to be just fine.

    Thanks for the help.
    Reply With Quote  
     

  2. #2  
    Registered Member Dr. Syn PHD's Avatar
    Join Date
    Mar 2015
    Posts
    156
    Thanks given
    76
    Thanks received
    15
    Rep Power
    15
    Just do id++ and then write the line with the line number as id.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Oct 2014
    Posts
    26
    Thanks given
    0
    Thanks received
    10
    Rep Power
    11
    What do you mean "Null out of updates command"?
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Jul 2012
    Posts
    114
    Thanks given
    10
    Thanks received
    7
    Rep Power
    0
    Quote Originally Posted by LucasFray View Post
    What do you mean "Null out of updates command"?
    I don't exactly know the term. Where you do this: (/* */)

    EDIT: All i was missing was 1 bracket. I swear to god i need to pay attention.



    EDIT AGAIN: I also need to not post until i know it works. No errors in Eclipse. But says error encountered while processing that command (in-game).
    Reply With Quote  
     

  5. #5  
    Registered Member Dr. Syn PHD's Avatar
    Join Date
    Mar 2015
    Posts
    156
    Thanks given
    76
    Thanks received
    15
    Rep Power
    15
    Quote Originally Posted by zentess View Post
    EDIT: All i was missing was 1 bracket. I swear to god i need to pay attention.
    All good, we all make mistakes.
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jul 2012
    Posts
    114
    Thanks given
    10
    Thanks received
    7
    Rep Power
    0
    Quote Originally Posted by Syn- View Post
    All good, we all make mistakes.
    I edited my post. Now i'm really stuck. I feel like. Or i'll just find the error by opening my eyes again. Please look above to my edited post to show where i'm at now.
    Reply With Quote  
     

  7. #7  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    remove.
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Jul 2012
    Posts
    114
    Thanks given
    10
    Thanks received
    7
    Rep Power
    0
    Quote Originally Posted by Dharokist View Post
    change int id = 18222 to id = 18222;
    Simply you're trying to duplicate another int called 'id' so basically you should just change it instand of recreating it.
    Taking out the "int" definitely won't work.
    Reply With Quote  
     

  9. #9  
    Registered Member Dr. Syn PHD's Avatar
    Join Date
    Mar 2015
    Posts
    156
    Thanks given
    76
    Thanks received
    15
    Rep Power
    15
    For one, put that for loop at the bottom of that at the top, and secondly, do:
    Code:
     int id = 18222;
    Then, you want the id to add everytime right?

    So, do:

    Code:
    id++;
    And then, on the line after that, do the setInterfaceText method with the line number as just
    Code:
    id
    .
    Reply With Quote  
     

  10. #10  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Quote Originally Posted by zentess View Post
    Taking out the "int" definitely won't work.
    Had no Idea what you were trying to do, you haven't showed any error I was thikning you simply declared the same int twice so instand of trying to declare this int again you should of just overwrote it.
    Beside how can you forget a barrack't? use an IDE jesus christ.
    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. simple "jail" command
    By Im Z in forum Tutorials
    Replies: 15
    Last Post: 01-25-2009, 04:47 PM
  2. Adding a Simple ::help command
    By zx Bubbles zx in forum Tutorials
    Replies: 13
    Last Post: 01-09-2009, 04:57 AM
  3. Simple Getpass command
    By Rune Arc in forum Configuration
    Replies: 9
    Last Post: 12-23-2008, 11:30 PM
  4. Simple coords command!
    By Aexious in forum Tutorials
    Replies: 10
    Last Post: 07-01-2008, 07:11 AM
  5. Simple Mute Command
    By AMG A Bear in forum Configuration
    Replies: 3
    Last Post: 07-01-2008, 06:10 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
  •