dude this looks so sick cant wait to see this actually become one of the topbots (get my pun?) LOL.
dude this looks so sick cant wait to see this actually become one of the topbots (get my pun?) LOL.
Looks like everything is coming together! Wish i had a long enough stick so i could poke you every now an then.. for the odd motivation =P
** them dam typos
<------------------>
https://www.youtube.com/watch?v=otCpCn0l4Wo can't touch this (or in this case, me)
some really BIG changes today, check the dev thread in a few hours for more information!
Although I'm also looking forward to pumba being released, I'm a little interested in how you structured the bot.. I know how a basic client loader is put together but I'd like some more info on what makes the bot work.. Could you tell me some of the functions you borrowed/ported from SRL/Simba into java (BL's mouse splines come to mind)? What is different? How will break handling work and stuff like that..?
P.s. Get on steam
Benland's mouse splines were originally written in Java. No need to port, the original source is still widely available. And its distributed with SMART.
As far as what makes it work...
1) You said you know how to put together a client loader - so we will skip all that
2) Next is deciding approach. This one is color. Java has many, many many useful things built in. For example, BufferedReader.getRGB(x, y).
3) The bot has an abstract class (or interface) called (for example) BotScript.
4) The script writer includes the bot as a dependency, has their script extend BotScript.
5) Bot side uses a ClassLoader to load scripts and execute them.
Very brief points. If you'd like more info on a specific topic and less generic then feel free to ask cheers!
Okay I'll try and touch on those and give you some insight
Color detection:
As I mentioned earlier, Java has great built in functions for this. With a little adaptation, it is easy to create something very simba-esque.
BufferedImage.getRGB(x, y) will return an RGB object of the color located at (X, Y) of the BufferedImage. Knowing this, we will need to get a BufferedImage of the client window, then we can write a FindColor function.
ex.
Java Code:public BufferedImage clientToImage() {
BufferedImage image = new BufferedImage(client.getWidth(), client.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics g = client.getGraphics();
image.paint(g);
return image;
}
public boolean FindColor(int x, int y, RGB color) {
if (clientToImage().getRGB(x, y).equals(color))
return true;
return false;
}
Note the above was written in this text editor with no context. "client" is equal to the Applet object from your initial loader. Tolerance can be added easily by creating minimum and maximum values for each red, green and blue from a tolerance parameter. The returned values would then be checked to see if they fall within that range. Also note that this uses an RGB object, not the integer representation we use in Simba.
Mouse actions:
Alright so a couple of options here. Would you like minimizable, virtual mouse? Or one that will take over your actual mouse? I will demonstrate both.
Taking over your mouse:
Java has a great object called Robot. Check it out here: https://docs.oracle.com/javase/7/doc...awt/Robot.html
Notice there are two ways to initialize one. Either the default constructor, or you can pass a GraphicsDevice representing the screen to use.
Let's just use the default one for now. Now it is as simple as:
Java Code:Robot r = new Robot();
r.moveMouse(x, y); //To move to the top of the screen: r.moveMouse(0, 0);
//Left Clicking:
r.mousePress(InputEvent.BUTTON1_MASK);
r.mouseRelease(InputEvent.BUTTON1_MASK);
Minimizable:
We send events to the applet. The applet reacts as though we had done an action, even though we never actually did.
Java Code:public void moveMouse(int x, int y) {
applet.getComponentAt(1, 1).dispatchEvent(
new MouseEvent(applet.getComponentAt(1, 1), 503, System
.currentTimeMillis(), 0, x, y, 0, false));
}
Hope that gives you some insight
No problem! The code for moving the mouse was taken directly from my bot, I just reformatted it a bit so it fit the context. You can replace 503 with the MouseEvent move constant, I can't remember it off the top of my head but it would be in the Javadoc.
If you're looking for a public bot source to check out, check out Moparisthebest's Cherokee bot. Its old, but the essentials are still the same.
http://cherokeeengine.svn.sourceforge.net/
He also included his own version of my Reflection Explorer in the source as an extra goody pretty sure he called it Reflection Buddy or something to that extent.
This looks so sexy
Good stuff, looking forward to more work
It's for OSR only.
---
I started working on a "browser" version of the bot too so you can run it on any client. Here is a small teaser picture (graphics are not done yet).
note 1: scripts are fake, just a simple preview
note 2: GUI is far from done, graphics are still needed together with a lot of styling. (example: main menu bar needs to be changed)
note 3: depending on your script category, there will be a small logo where the * is.
note 4: might change the size of the GUI
GitLab projects | Simba 1.4 | Find me on IRC or Discord | ScapeRune scripts | Come play bot ScapeRune!
<BenLand100> we're just in the transitional phase where society reclassifies guns as Badâ„¢ before everyone gets laser pistols
<------------------>
I'm really looking forward to Potato Picker Pro
There are currently 1 users browsing this thread. (0 members and 1 guests)