Jump to content

zulul123

Members
  • Posts

    2
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by zulul123

  1. Hi.

    Trying to split up my script into multiple classes but getting null pointer error when trying to access methods from a different class like in this example:

    public class Main extends Script {
        Test test = new Test();
    
        @Override
        public void onStart() throws InterruptedException {
            test.exchangeContext(getBot());
        }
    
        @Override
        public int onLoop() throws InterruptedException {
            test.testLog();
            return 256;
        }
    
        @Override
        public void onExit() throws InterruptedException {}
    }

     

    public class Test extends MethodProvider {
    
        TestTwo testTwo = new TestTwo();
    
        public void testLog() {
            testTwo.logFromTestTwo();
        }
    
    }

     

    public class TestTwo extends MethodProvider {
    
        public void logFromTestTwo() {
            log("Test Two");
        }
    
    }

     

×
×
  • Create New...