i some how cant get JDK says the folder does not have JDK so i cant do any of this creating of a bot interface with iam very interested in
i some how cant get JDK says the folder does not have JDK so i cant do any of this creating of a bot interface with iam very interested in
Last edited by Olly; 12-06-2015 at 02:54 AM.
I'm not sure about the details of what could happen yet, it's extremely simple.
Java Code:public static void communicate(final Bot bot) {
try {
AcidCommunication coms = new AcidCommunication();
AcidCommunication.MessageType msg;
while (true) {
msg = coms.getMessage(); // Waits until message received (fixed offset in shared memory is different than 0)
if (msg == AcidCommunication.MessageType.MOVE_MOUSE) {
int x = coms.getParamInt(AcidCommunication.PARAM_ONE);
int y = coms.getParamInt(AcidCommunication.PARAM_TWO);
bot.getInputManager().moveMouse(x, y);
coms.reset(); // Reset all vars in shared mem to zero, simba waits for this reset, and then can write another message
}
}
} catch (Exception e) { System.out.println("NO!"); }
}
Updated the tutorial. Completely brand new. Massive overhaul of programming patterns.
New:
Loads the game like the Official RS client (Both OSRS and RS3).
HTTPSocket class simplifies the loader.
ClientApplet is MUCH simpler.
Uses Observer Pattern (PaintListener) for drawing.
Uses BootLoader to override the Canvas.
Uses Event Multi-Casting/Chaining.
Uses IntelliJ IDE.
Better drawing.
Fixed canvas notifications.
Code is better over-all.
Last edited by Brandon; 12-21-2015 at 01:57 AM.
I am Ggzz..
Hackintosher
Hahaha great to see info like this making an appearance on this side of the scene. Brings me back to when I was putting out these tutorials - not much has changed it seems.
Great job @Brandon !
@Brandon;
Doesn't seem to work on my pc (mac) it says that bin/sh -c or something isn't found. How ever when i run the windows exec, it will work fine.Code:application = runtime.exec(new String[]{ "/bin/sh", "-c", commands.toString() });
Last edited by Hoodz; 12-30-2015 at 08:17 AM.
I don't understand, I can load the rs3 client fine, but I can't load the osrs client. The program just runs and nothing starts, the ClientApplet Constructor was taking in (String root, String params, int Width, int Height), but the object created in Main.Java only use 3 parameters, (doesn't have anything for String params), so I just added "" as the input for params.
edit: also i am running this in eclipse. I am not sure displayFrame ever runs.
OK it works now,
Instead of new client, change to displayFrame//new ClientApplet("http://oldschool1.runescape.com", 765, 503);
displayFrame("http://oldschool1.runescape.com", 765, 503);
Last edited by Grunt; 01-01-2016 at 07:23 PM.
Not on the original post, but scrolling down there is some code for old school. params is set to null when the object client is instanced in displayFrame method, although the original code instanced a clientApplet object instead of calling displayFrame.
It's great to see you still taking an interest, thanks for helping out.public ClientApplet(String root, String params, int Width, int Height) {
Last edited by Grunt; 01-01-2016 at 08:19 PM.
Thanks
Yeah ShatterHand's post is from the old tutorial that parses the HTML file (like SMART). That requires root + params. It's not just for old school but for RS3 as well. However, the code on the OP does not require that as it loads the client like the official client instead of like the browser.
I am Ggzz..
Hackintosher
I went through this whole thing, everything worked out, of course. I'll be honest though I've got a lot to learn. Great tutorial!
Sorry my knowledge of java is pretty basic. But I am really curious how is the canvas objected created? And why not create a new class that inherits from the canvas class, rather than using xboot?
Noticed that you updated the tutorial when I had a problem implementing a screenshotting feature in my loader that was based off of your old tutorial. I'm working on making my own color-bot. I don't want to take the time to learn ASM so I wrote my own OSRS-dedicated text recognition library (very fast, and lightweight as the RS characters are only like 5 pixels tall) and send mouse input events directly to the applet instead of reflection and code injection.
I want to run multiple accounts at once in tabs, so instead of Java Robot (which grabs the screen pixels) I was trying to grab the applet's screen by calling the paint() method on a buffered image via Graphics2D. Obviously, like you say in the comment I'm replying to, the applet doesn't draw like a regular applet does and I figured that out the hard way.
How can I screenshot the applet without java Robot so I can run my color based scripts on a JTabbedPane with multiple accounts? In other words, how does the applet draw? BTW thanks for all your work so far, I love it!
Because RS has no idea about the class inheriting from the Canvas class. If you do that, then you have to use reflection or injection to manually set the Canvas in the client.
However, if you just boot the Canvas class, the client loads it. The rule is that the system can only have one definition of such a class. If you tell the system, hey, use my class, any time the game creates a Canvas, it will use the one you have provided instead.
----
@prest0g; You have a Canvas and you have getGraphics. You also have a paintListener. You can just have the canvas draw onto your bufferedImage. OR you can add a Listener to it and have the listener call some function with the GraphicsContext and do the screenshot through that.
I don't understand what issue you are having. As for how the applet draws, it double buffers but this doesn't matter, unless you're drawing ON the applet. If it's just a screenshot then just snapshot the graphics context when the applet attempts to draw.
I am Ggzz..
Hackintosher
Haha awesome!
Had no idea that was how SMART worked. Sweet
I've never actually looked at how SMART does anything for that matter. I don't personally use it so I've always stuck to trawling the Simba and SRL repos. I'll surely check out the SMART repo now
---
Cheers for the swift responses lads!
Nice guide, had fun messing around with it while I was bored. It got me interested a little bit.
What would technically be the next step in customizing your client? Say for instance I wanted to display usernames above heads, what sort of process would that take?
Sort of a noob, sorry if thats asking alot.
Thanks, I think I figured it out. It was the stupidest mistake ever. I migrated my project to NetBeans just because that's what i'm used to using, and then I just cut and pasted the configuration for the -Xbootclasspath JVM arg and ist was still set to the old IntelliJ Eos.jar. So basically every time I ran my project it was starting the same old loader that I had made in IntelliJ with no features. I was about ready to rip my hair out because nothing was working and I thought it had to do with the BootLoader (I've never done anything with a bootloader before). But now it's pretty simple! Thanks.
There are currently 2 users browsing this thread. (0 members and 2 guests)