klorox 1 Share Posted March 22, 2020 Hello, I am trying to access the dreambot API using Jython. I much prefer the python syntax and I would like to create a python script that accesses the dreambot API but allows me to use python. So far I have successfully imported the API but nothing seems to be working as planned. I'm wondering if this is even possible. When trying to make the API tell me what world I'm in I get a null pointer exception presumably because it isn't finding the client. If this is the problem, how can I make my script find the client? Here's my current code: import os,glob,sys from org.dreambot.api import Client from org.dreambot.core import Instance directories=['C:\\Users\\klorox\\Desktop\\jython-test\\'] # Other directories can be added for directory in directories: for jar in glob.glob(os.path.join(directory,'*.jar')): sys.path.append(jar) currentClient = Client.getClient() currentinstance = Instance.getInstance() print(currentinstance) print(currentClient) print(Client.getCurrentWorld(currentClient)) The current instance and current client methods return "None" so I am assuming it's not finding the client I am running that is logged in (All I did was execute dreambot.jar and hope that it would find the process or something but apparently not). I'm guessing I need to import the client in my script and somehow execute the client then point that instance of the client at whatever methods I am using. Is this correct or can someone please help me clarify what exactly the problem is? I plan on releasing the python wrapper if I can get it working as I have not seen anything like it written yet which really just adds to the difficulty here as there are no examples to build upon. Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now