klorox 1 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.