Resolved ArrayIndexOutOfBounds

Discussion in 'Client & Site Support' started by Philosobyte, Dec 27, 2014.

  1. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    @Cloud possibly a client bug.
    (09:18:19) java.lang.ArrayIndexOutOfBoundsException
    (09:18:19) at java.lang.reflect.Array.get(Native Method)
    (09:18:19) at a.al.byte(ywb:131)
    (09:18:19) at a.Gl.getComponent(whb:64)
    (09:18:19) at com.runemate.game.api.hybrid.local.hud.interfaces.Interfaces.getAt(dwb:52)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.interfaceNext(RaysNatRunner.java:364)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.repairNPC(RaysNatRunner.java:343)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.repairNPC(RaysNatRunner.java:328)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.repairNPC(RaysNatRunner.java:328)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.repairNPC(RaysNatRunner.java:313)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.checkPouches(RaysNatRunner.java:197)
    (09:18:19) at com.raymondbl.runemate.natRunner.RaysNatRunner.onLoop(RaysNatRunner.java:124)
    (09:18:19) at com.runemate.game.api.script bot.framework.LoopingScript.run(yhb:89)
    (09:18:19) at com.runemate.game.api.script bot.framework.AbstractScript.start(plb:197)
    (09:18:19) at a.sJ.run(clb:102)

    Lines 362 - 373 of my code:
    Code (Text):
    1.  
    2.     public boolean interfaceNext(int i, int k, int m)
    3.     {
    4.         if(Interfaces.getAt(i, k, m) != null)         //error occuring here
    5.         {
    6.             if(Interfaces.getAt(i, k, m) != null)
    7.             {
    8.                 return Interfaces.getAt(i, k, m).click();
    9.             }
    10.             else return true;
    11.         }
    12.         else return false;
    13.     }
    14.  
    Line 343, which calls the method above:
    Code (Text):
    1. interfaceNext(88, 6, 14);
    I double-checked. The Development Toolkit indeed lists the Dark Mage InterfaceComponent from the lunar spell Contact NPC as [88, 6, 14].

    edit: I also tried [88, 5, 14], which came out with the same error.

     
    #1 Philosobyte, Dec 27, 2014
    Last edited: Dec 27, 2014
  2. Best Answer:
    Post #6 by Cloud, Dec 28, 2014
  3. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,585
    Likes Received:
    931
    RS3 or OSRS?
     
  4. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    RS3.
     
  5. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,585
    Likes Received:
    931
    Well I've adjusted it to make sure the exception doesn't occur again, but if your passing a valid index within the correct range it shouldn't have happened.
     
  6. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    Weird. I take it that means that the adjustment, while preventing an exception, will not allow the script bot to obtain the interfaceComponent I'm looking for because my index isn't valid. We'll see when the update rolls out.
     
  7. Cloud

    Joined:
    Jul 28, 2013
    Messages:
    2,585
    Likes Received:
    931
    That is correct. As another point, there is absolutely no reason that you should ever be looking up a specific interface component by index. Use dynamic queries instead.
     
  8. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    Thanks. I originally started used specific indices because the yellow button in character dialogue doesn't have text. I now realize the Texture ID stays the same for EOC and Legacy Mode and thus, can be used in a dynamic query's filter.
     
  9. frazboyz

    Joined:
    Nov 15, 2013
    Messages:
    338
    Likes Received:
    55
    Take yo c# syntax outa here :p
     
    dog_ likes this.
  10. Philosobyte

    Joined:
    Dec 18, 2014
    Messages:
    398
    Likes Received:
    78
    I don't get it.
     
  11. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,561
    Likes Received:
    1,087
    @Raymondbl please mark a post as Best Answer after testing at your earlier convenience.
     

Share This Page

Loading...