Resolved OSRS GameObject NPE

Discussion in 'Developer Support' started by qverkk, Apr 12, 2016.

    1. Spectre Version: 1.1.3
    2. Bind Version: 1.1.0
    3. Affected Games: OSRS
    4. Code Used:


      Code (Text):
      1. public class BankingHandler extends Task {
      2.     @Override
      3.     public boolean validate() {
      4.         GameObject bank = GameObjects.newQuery().names("Bank booth").results().nearest();
      5.         return bank != null && bank.isVisible() && Inventory.isFull();
      6.     }
      7.  
      8.     @Override
      9.     public void execute() {
      10.         GameObject bank = GameObjects.newQuery().names("Bank booth").results().nearest();
      11.  
      12.         if(Bank.isOpen()){
      13.             if(!Inventory.isEmpty()){
      14.                 if(Bank.depositInventory()){
      15.                     Execution.delayUntil(() -> Inventory.isEmpty(), 5000);
      16.                 }
      17.             }else{
      18.                 Bank.close();
      19.             }
      20.         }else{
      21.             if(bank != null){
      22.                 if(bank.isVisible()){
      23.                     if(Bank.open()){
      24.                         Execution.delayUntil(() -> Bank.isOpen(), 5000);
      25.                     }
      26.                 }
      27.             }
      28.         }
      29.  
      30.         /*
      31.         if(bank != null){
      32.             System.out.println("Bank isn't null");
      33.             if(bank.isVisible()){
      34.                 System.out.println("Bank is visible");
      35.                 if(Bank.isOpen()){
      36.                     if(!Inventory.isEmpty()) {
      37.                         System.out.println("Bank is open");
      38.                         if (Bank.depositInventory()) {
      39.                             System.out.println("Depositing items");
      40.                             Execution.delayUntil(() -> Inventory.isEmpty(), 1000, 2500);
      41.                         }
      42.                     }else{
      43.                         Bank.close();
      44.                     }
      45.                 }else{
      46.                     System.out.println("Opening bank");
      47.                     Bank.open();
      48.                 }
      49.             }else{
      50.                 System.out.println("Bank isn't visible");
      51.                 completeWalking(bank);
      52.             }
      53.         }else{
      54.             System.out.println("Bank is null");
      55.             completeWalking(bankCoord);
      56.         }
      57.         */
      58.     }
      59.  
      60.     /*public static boolean completeWalking(Locatable location) {
      61.         WebPath q = Traversal.getDefaultWeb().getPathBuilder().buildTo(location);
      62.         if (q != null) {
      63.             q.step();
      64.         } else {
      65.             RegionPath q2 = RegionPath.buildTo(location);
      66.             if (q2 != null) {
      67.                 q2.step();
      68.             } else {
      69.                 BresenhamPath q3 = BresenhamPath.buildTo(location);
      70.                 if (q3 != null) {
      71.                     q3.step();
      72.                 }
      73.             }
      74.         }
      75.         return false;
      76.     }*/
      77. }
    Error:

    Code (Text):
    1. java.lang.NullPointerException
    2.     at nul.IiIIiIIIII.else(vb:31)
    3.     at nul.IiIIiIIIII.special_uids(vb:100)
    4.     at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
    5.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    6.     at java.lang.reflect.Method.invoke(Method.java:601)
    7.     at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
    8.     at sun.rmi.transport.Transport$1.run(Transport.java:177)
    9.     at sun.rmi.transport.Transport$1.run(Transport.java:174)
    10.     at java.security.AccessController.doPrivileged(Native Method)
    11.     at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    12.     at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
    13.     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
    14.     at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
    15.     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    16.     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    17.     at java.lang.Thread.run(Thread.java:722)
    18.     at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
    19.     at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
    20.     at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
    21.     at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
    22.     at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
    23.     at com.sun.proxy.$Proxy8.special_uids(Unknown Source)
    24.     at nul.IIiiIIiIiiII.goto(avb:274)
    25.     at nul.IIiiIIiIiiII.goto(avb:190)
    26.     at com.runemate.game.api.hybrid.region.GameObjects.getLoaded(igc:60)
    27.     at com.runemate.game.api.hybrid.region.GameObjects.getLoaded(igc:104)
    28.     at com.runemate.game.api.hybrid.queries.GameObjectQueryBuilder.initialDataSet(vbc:180)
    29.     at com.runemate.game.api.hybrid.queries.QueryBuilder.results(kob:202)
    30.     at QveCutter.Tasks.BankingHandler.validate(BankingHandler.java:22)
    31.     at com.runemate.game.api.script.framework.task.TaskScript.onLoop(xtb:183)
    32.     at com.runemate.game.api.script.framework.LoopingScript.run(mqb:180)
    33.     at com.runemate.game.api.script.framework.AbstractScript.start(lqb:125)
    34.     at nul.IIIIIIiIIIii.run(azb:236)
    Line 22:
    GameObject bank = GameObjects.newQuery().names("Bank booth").results().nearest();
    @Cloud
     
  1. Best Answer:
    Post #2 by Cloud, Apr 12, 2016
  2. Fixed in the next release.
     

Share This Page

Loading...