Thread: Adding interface

Results 1 to 10 of 10
  1. #1 Adding interface 
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    258
    Thanks given
    12
    Thanks received
    13
    Rep Power
    57
    okay im trying to add an interface. but when i open the interface it crashes.


    Code:
    	public static void addModerateWidget(TextDrawingArea[] tda) {
    		RSInterface widget = addInterface(33200);
    		addSprite(33201, 0, "Interfaces/Moderate/IMAGE");
    		addHoverButton(33202, "Interfaces/Moderate/IMAGE", 1, 21, 21, "Close", -1, 33203, 3);
    		addHoveredButton(33203, "Interfaces/Moderate/IMAGE", 2, 21, 21, 33204);
    		addInputField(33205, 120, 0xFF981F, "Reason", 144, 20, false, true, "[A-Za-z0-9 ,']");
    		addText(33206, "'Fourteen Chars'", tda, 2, 0xFF981F, true, true);
    		addHoverButton(33207, "Interfaces/Moderate/IMAGE", 5, 90, 25, "Close", -1, 33208, 1);
    		addHoveredButton(33208, "Interfaces/Moderate/IMAGE", 6, 90, 25, 33209);
    		addText(33210, "Execute", tda, 2, 0xFF981F, true, true);
    		addInputField(33211, 120, 0xFF981F, "Duration", 144, 20, false, true, "[0-9]");
    		setChildren(10, widget);
    		setBounds(33201, 180, 46, 0, widget);
    		setBounds(33202, 313, 53, 1, widget);
    		setBounds(33203, 313, 53, 2, widget);
    		setBounds(33205, 185, 232, 3, widget);
    		setBounds(33206, 250, 55, 4, widget);
    		setBounds(33207, 215, 254, 5, widget);
    		setBounds(33208, 215, 254, 6, widget);
    		setBounds(33210, 258, 259, 7, widget);
    		setBounds(33211, 185, 212, 8, widget);
    		setBounds(33214, 185, 77, 9, widget);
    
    		RSInterface scroll = addInterface(33214);
    		scroll.width = 128;
    		scroll.height = 135;
    		scroll.scrollMax = 220;
    		setChildren(20, scroll);
    		for (int i = 0; i < 20; i += 2) {
    			addClickableSprites(33215 + i, "Select", "Interfaces/Moderate/IMAGE", 3, 4);
    			addText(33215 + i + 1, "Empty", tda, 0, 0xFF981F, false, true);
    			setBounds(33215 + i, 0, i / 2 * 22, i, scroll);
    			setBounds(33215 + i + 1, 4, 6 + (i / 2 * 22), i + 1, scroll);
    		}
    	}
    so when i try to open this interface it crashs but when i change the 33200 it will open but the background doesn't show. the other buttons do. how do i get it to stop crashing?
    Reply With Quote  
     

  2. #2  
    Registered Member Os Supreme's Avatar
    Join Date
    Sep 2021
    Posts
    23
    Thanks given
    1
    Thanks received
    17
    Rep Power
    53
    It could be the wrong child Id
    Reply With Quote  
     

  3. #3  
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    258
    Thanks given
    12
    Thanks received
    13
    Rep Power
    57
    Quote Originally Posted by Os Supreme View Post
    It could be the wrong child Id
    you're talking about this right?

    setChildren(10, widget);
    Reply With Quote  
     

  4. #4  
    Registered Member Os Supreme's Avatar
    Join Date
    Sep 2021
    Posts
    23
    Thanks given
    1
    Thanks received
    17
    Rep Power
    53
    Quote Originally Posted by Bubz View Post
    you're talking about this right?

    setChildren(10, widget);
    Yeah what I'm thinking is if you have a wrong number set , it will crash the client when loading up
    Reply With Quote  
     

  5. #5  
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    258
    Thanks given
    12
    Thanks received
    13
    Rep Power
    57
    Quote Originally Posted by Os Supreme View Post
    Yeah what I'm thinking is if you have a wrong number set , it will crash the client when loading up
    it doesnt crash when loading. it crashes when trying to open that interface

    https://gyazo.com/58de2380fda309f6df30c75c7dd861e8

    this is the error i get. but im not sure whats causing it.

    Code:
    java.lang.NullPointerException
    	at com.client.Client.method60(Client.java:4171)
    	at com.client.Client.parsePacket(Client.java:16356)
    	at com.client.Client.mainGameProcessor(Client.java:42  29)
    	at com.client.Client.processGameLoop(Client.java:3423  )
    	at com.client.RSApplet.run(RSApplet.java:283)
    	at com.client.Client.run(Client.java:6593)
    	at java.lang.Thread.run(Thread.java:748)
    Error: T2 - 97,126,-1 - 2,3086,3498 - 88,122,
    Reply With Quote  
     

  6. #6  
    Banned


    Join Date
    Jul 2020
    Posts
    157
    Thanks given
    100
    Thanks received
    166
    Rep Power
    0
    Quote Originally Posted by Bubz View Post
    it doesnt crash when loading. it crashes when trying to open that interface

    https://gyazo.com/58de2380fda309f6df30c75c7dd861e8

    this is the error i get. but im not sure whats causing it.

    Code:
    java.lang.NullPointerException
    	at com.client.Client.method60(Client.java:4171)
    	at com.client.Client.parsePacket(Client.java:16356)
    	at com.client.Client.mainGameProcessor(Client.java:42  29)
    	at com.client.Client.processGameLoop(Client.java:3423  )
    	at com.client.RSApplet.run(RSApplet.java:283)
    	at com.client.Client.run(Client.java:6593)
    	at java.lang.Thread.run(Thread.java:748)
    Error: T2 - 97,126,-1 - 2,3086,3498 - 88,122,
    Its due to some kinda packet you are sending it seems [97,126] one of these, that or your interface number is to high
    Reply With Quote  
     

  7. #7  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    Make the interface simple and then start adding till you get the interface you want
    public static void addModerateWidget(TextDrawingArea[] tda) {
    RSInterface widget = addInterface(33200);
    }
    Make the interface simple and then start adding till you get the interface you want
    public static void addModerateWidget(TextDrawingArea[] tda) {
    RSInterface widget = addInterface(33200);
    System.out.println("Loading?");
    }
    Attached image
    Reply With Quote  
     

  8. #8  
    Banned
    Join Date
    Sep 2021
    Age
    31
    Posts
    19
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    Quote Originally Posted by Mgt Madness View Post
    Make the interface simple and then start adding till you get the interface you want


    Make the interface simple and then start adding till you get the interface you want
    Not really helpful. Should add a command to print out the nulled interface ids

    Quote Originally Posted by Bubz View Post
    okay im trying to add an interface. but when i open the interface it crashes.


    Code:
    	public static void addModerateWidget(TextDrawingArea[] tda) {
    		RSInterface widget = addInterface(33200);
    		addSprite(33201, 0, "Interfaces/Moderate/IMAGE");
    		addHoverButton(33202, "Interfaces/Moderate/IMAGE", 1, 21, 21, "Close", -1, 33203, 3);
    		addHoveredButton(33203, "Interfaces/Moderate/IMAGE", 2, 21, 21, 33204);
    		addInputField(33205, 120, 0xFF981F, "Reason", 144, 20, false, true, "[A-Za-z0-9 ,']");
    		addText(33206, "'Fourteen Chars'", tda, 2, 0xFF981F, true, true);
    		addHoverButton(33207, "Interfaces/Moderate/IMAGE", 5, 90, 25, "Close", -1, 33208, 1);
    		addHoveredButton(33208, "Interfaces/Moderate/IMAGE", 6, 90, 25, 33209);
    		addText(33210, "Execute", tda, 2, 0xFF981F, true, true);
    		addInputField(33211, 120, 0xFF981F, "Duration", 144, 20, false, true, "[0-9]");
    		setChildren(10, widget);
    		setBounds(33201, 180, 46, 0, widget);
    		setBounds(33202, 313, 53, 1, widget);
    		setBounds(33203, 313, 53, 2, widget);
    		setBounds(33205, 185, 232, 3, widget);
    		setBounds(33206, 250, 55, 4, widget);
    		setBounds(33207, 215, 254, 5, widget);
    		setBounds(33208, 215, 254, 6, widget);
    		setBounds(33210, 258, 259, 7, widget);
    		setBounds(33211, 185, 212, 8, widget);
    		setBounds(33214, 185, 77, 9, widget);
    
    		RSInterface scroll = addInterface(33214);
    		scroll.width = 128;
    		scroll.height = 135;
    		scroll.scrollMax = 220;
    		setChildren(20, scroll);
    		for (int i = 0; i < 20; i += 2) {
    			addClickableSprites(33215 + i, "Select", "Interfaces/Moderate/IMAGE", 3, 4);
    			addText(33215 + i + 1, "Empty", tda, 0, 0xFF981F, false, true);
    			setBounds(33215 + i, 0, i / 2 * 22, i, scroll);
    			setBounds(33215 + i + 1, 4, 6 + (i / 2 * 22), i + 1, scroll);
    		}
    	}
    so when i try to open this interface it crashs but when i change the 33200 it will open but the background doesn't show. the other buttons do. how do i get it to stop crashing?
    setChildren(20, scroll);
    for (int i = 0; i < 20; i += 2) {

    This part there might be the issue. outprint the total value of "i" to see

    Edit: If you still can't get it to work dm me i will take a look for you at it and help you to solve it.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Sep 2020
    Posts
    20
    Thanks given
    0
    Thanks received
    5
    Rep Power
    0
    addModerateWidget(TextDrawingArea); need to add this
    Reply With Quote  
     

  10. #10  
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    258
    Thanks given
    12
    Thanks received
    13
    Rep Power
    57
    i figured it out actually. for some reason it did not like the interface id 33200. i ended up changing and adding one line of code at a time.
    Reply With Quote  
     


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. Replies: 3
    Last Post: 02-15-2010, 03:17 AM
  2. Errors adding interface
    By CTucker in forum Help
    Replies: 4
    Last Post: 10-15-2009, 03:13 AM
  3. adding interface error?
    By Gunzpk in forum Help
    Replies: 3
    Last Post: 05-06-2009, 10:31 PM
  4. 1 error adding interface - REP++
    By mige5 in forum Help
    Replies: 4
    Last Post: 03-04-2009, 10:37 AM
  5. Adding interface (Lunar and piety)
    By Gimmeyoshoez™ in forum Help
    Replies: 1
    Last Post: 01-23-2009, 02:15 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
  •