Everything posted by Explv
-
[B Stat] Experiemental UI Template [Opinions]
Just a heads up, I think the last person that tried to make a remote control type thing, wasn't allowed to do so.
- I just realised that because of the uefa cup its likely that jmods wont focus that much on banning bots because they want to watch the matches.
-
[B Stat] Experiemental UI Template [Opinions]
I don't really see how you are going to get that data without scripters integrating your API into their scripts. Which I think is unlikely. Nice idea though.
-
INodeRouteFinder
You can still use WebWalkEvent. You just no longer need INodeRouteFinder. So just remove that from your code.
-
Permissions error
You can only write to the data folder, the path of which is returned by: getDirectoryData()
-
Need help with reading message from chatbox and doing stuff if it contains something. debug my code please
Your function definition is this: public void onMessage(String m) throws InterruptedException { } It should be: @Override public void onMessage(Message message) throws InterruptedException { } And now the Message variable is called message so: @Override public void onMessage(Message message) throws InterruptedException { String text = message.getMessage().toLowerCase(); }
-
How to tell if there are none of a certain item in an area?
I was bored
-
Any way to change mouse speed?
It is Java, not JavaScript. Two very different languages. Java: https://en.wikipedia.org/wiki/Java_(programming_language) JavaScript: https://en.wikipedia.org/wiki/JavaScript
- FashionBot
-
"For your account safety" error
Use your own world hopper or Frostbug's. Or stop hopping so much
-
Any way to change mouse speed?
No, this feature was removed. If you need to move the mouse instantly then you can use: final void moveMouseInstantly(final MouseDestination mouseDestination) { Rectangle boundingBox = mouseDestination.getBoundingBox(); moveMouseInstantly(random((int) boundingBox.getMinX(), (int) boundingBox.getMaxX()), random((int) boundingBox.getMinY(), (int) boundingBox.getMaxY())); } final void moveMouseInstantly(final int x, final int y) { getBot().getMouseEventHandler().generateBotMouseEvent(MouseEvent.MOUSE_MOVED, System.currentTimeMillis(), 0, x, y, 0, false, MouseEvent.NOBUTTON, true); } And I'm sure if you spent some time making your own MouseEvent then you could have it at whatever speed you want. However, the setMouseSpeed feature was removed for a reason.
-
How to tell if there are none of a certain item in an area?
Using the OSBot API: final boolean itemIsInArea(final Area area, final String itemName) { return getGroundItems().filter(new AreaFilter<>(area), new NameFilter<>(itemName)).size() > 0; } Using the Java 8 Stream API : final boolean itemIsInArea(final Area area, final String itemName) { return getGroundItems().getAll().stream().anyMatch(groundItem -> groundItem.getName().equals(itemName) && area.contains(groundItem)); } Using a for loop: final boolean itemIsInArea(final Area area, final String itemName) { for(final GroundItem groundItem : getGroundItems().getAll()) { if(groundItem.getName().equals(itemName) && area.contains(groundItem)) { return true; } } return false; } If you want to get the closest matching item in the area you can do: With the OSBot API: final Optional<GroundItem> closestItemInArea(final Area area, final String itemName) { return Optional.ofNullable(getGroundItems().closest(new AreaFilter<>(area), new NameFilter<>(itemName))); } With the Java 8 Stream API: final Optional<GroundItem> closestItemInArea(final Area area, final String itemName) { return getGroundItems().getAll() .stream() .filter(groundItem -> groundItem.getName().equals(itemName) && area.contains(groundItem)) .min((g1, g2) -> Integer.compare(myPosition().distance(g1.getPosition()), myPosition().distance(g2.getPosition()))); } Or if you want to get any matching item in the area (not necessarily the closest) you can do: With the OSBot API: final Optional<GroundItem> getItemInArea(final Area area, final String itemName) { return Optional.ofNullable(getGroundItems().singleFilter(getGroundItems().getAll(), new AreaFilter<>(area), new NameFilter<>(itemName))); } With the Java 8 Stream API: final Optional<GroundItem> getItemInArea(final Area area, final String itemName) { return getGroundItems().getAll() .stream() .filter(groundItem -> groundItem.getName().equals(itemName) && area.contains(groundItem)) .findAny(); }
-
Explv's AIO [13 skill AIO in 1 script]
greezy
-
setHumanInputEnabled alternative?
hehehehe
-
setHumanInputEnabled alternative?
I don't think there is a way of enabling mouse input any more. You could always try and do some hacky stuff like this: getBot().getCanvas().addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { super.mouseClicked(e); getBot().getMouseEventHandler().generateBotMouseEvent( e.getID(), e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getClickCount(), false, e.getButton(), true ); } });
-
setHumanInputEnabled alternative?
Why do you still need that feature?
-
Help with basic to intermediate coding. (using 2 classes in a script, getting message from clanchat etc)
Yes. By the way, you say you want to learn how to program, if that is true then you should make some attempt to write the code yourself. This is the scripting help section not the scripting service section. Try and learn Java, look at the OSBot API, follow some tutorials, and then if you are still stuck request help here. Saying "I don't even know how to start this" is an indicator that you have not spent enough time trying to learn Java / scripting by yourself.
-
Help with basic to intermediate coding. (using 2 classes in a script, getting message from clanchat etc)
I wrote that class a long time ago and it needs some improvement, sorry I do not have too much time to fix it up for you: In terms of using it, I recommend you follow some Java tutorials if you do not understand how classes work.
-
How to reduce bans Tips & Tricks
This made my eyes bleed
-
How do we know when the client is back up?
Nope Relax breh. There used to be a little notification on the main forum page that stated whether the client was down or not. It is not there any more though, maybe because the devs cba to update it every time / a lot of people didn't seem to notice it. Usually the client will be back up a few hours after an update, it happens most Thursdays too.
- 1000
-
Explv's AIO [13 skill AIO in 1 script]
I'm just waiting for it to be uploaded to the SDN, then it will be open for testing
-
OSBot opens as a folder on mac now, previously I could just double click on the jar file and it would open.
You're welcome. If you don't find a reasonable solution such as Jar Launcher, you can always create a shell script to open OSBot for you: Step 1) Save this in a file called osbot.command: find ~/ -name "OSBot*.jar" -print0 | xargs -0 ls -t | head -n 1 | xargs -I{} java -jar {} Step 2) Make the file executable. To do this you will need to open up Terminal and type: chmod u+x /path/to/where/you/put/the/script/osbot.command Step 3) Double click the osbot.command file and it should open OSBot
-
OSBot opens as a folder on mac now, previously I could just double click on the jar file and it would open.
You will need to set the default application for .jar files as Java. If found this post on the internet, perhaps it will work for you (Sorry I do not use mac os) 1. Click once on the .jar file in the Finder. 2. From the menubar in the Finder select File -> Get Info". 3 Click on "Open with" and from the popup menu. 4. Select "Jar Launcher", which is built into OS X. 5. Whenever you double click on the .jar file the program will start.
-
OSBot opens as a folder on mac now, previously I could just double click on the jar file and it would open.
http://osbot.org/forum/topic/87717-fixing-osbot-not-starting/