Everything posted by Explv
-
Explv's Tutorial Island [Free] [Random Characters]
I believe this is a general issue with Local scripts at the moment. However, I will be uploading a new version of this script later today, so hopefully that will work for you. Thanks
-
Help with paint
Something like this should do it: // Set colour to white g.setColor(Color.white); // Get current mouse position Point mousePoint = getMouse().getPosition(); // Draw a rectangle starting at x-10, y-10, with width and height of 20 g.drawRect(mousePoint.x - 10, mousePoint.y - 10, 20, 20); // Draw a line from top of screen (0), to bottom (500), with mouse x coordinate g.drawLine(mousePoint.x, 0, mousePoint.x, 500); // Draw a line from left of screen (0), to right (800), with mouse y coordinate g.drawLine(0, mousePoint.y, 800, mousePoint.y);
-
Anyone knows how to stop spam clicking an npc?
In the case of Tutorial Island, every interaction with an NPC is followed by the user selecting continue. So you can use: final ConditionalSleep dialogSleep = new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return script.getDialogues().isPendingContinuation(); } };
-
Local script not appearing in selector / any problems with code
Problem was he had some other files in his .jar other than 'compiled output' .
-
Local script not appearing in selector / any problems with code
Try deleting the OSBot folder, restarting OSBot, and then re-building your script.
-
Detecting if another player has 'stolen' your ore from rock
Couldn't that be simplified to: boolean isMining = false; if(clayRock1 != null && (!myPlayer().isAnimating() || !isMining)){ clayRock1.interact("Mine"); isMining = true; sleep(random(2000, 2200)); } else if (clayRock1 == null){ isMining = false; } So that when isMining == false it ignores the fact that the player is animating, and tries to mine anyway?
-
Error: Could not open...
I think the problem is your PATH got fucked up somehow. Go to the Chat Box, and i'll try and help
-
Error: Could not open...
Maybe you need to update the Java path in Eclipse now that you have updated Java? Edit: http://bfy.tw/2p2K
-
Detecting if another player has 'stolen' your ore from rock
Entity clayRock1 = objects.closest(ID_CLAY1); if(clayRock1 != null && !myPlayer().isAnimating()){ clayRock1.interact("Mine"); sleep(random(2000, 2200)); } else if(clayRock1 == null){ // Do something else }
-
Detecting if another player has 'stolen' your ore from rock
Method 1) The rock will have a different ID when there is no ore Method 2) If the rock no longer has the "Mine" action, when there is no ore (i cant remember if it does or not) then you could check that
-
A simple Bone burier
That is probably because I didn't put in anything for bones.interact(); You need to specifiy the pick up action like bones.interact("Take"); To prevent it from clicking other stuff Edit: I fixed it Edit2: I also didn't really think about it, the bones when on the ground wont have the action "Bury", so I changed the filter
- A simple Bone burier
-
A simple Bone burier
I have commented it to maybe help you understand
-
A simple Bone burier
Maybe something like import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.GroundItem; import org.osbot.rs07.api.model.Item; import org.osbot.rs07.script.Script; @ScriptManifest(author = "Noob", name = "Noob Script", version = -15.0, logo = "", info = "Does some noob shit") public class Burier extends Script { private enum STATE{ PICKING, BURYING } // Enum for our two script states private STATE getState(){ if(!getInventory().isFull()) return STATE.PICKING; // When the inventory is not full, pick bones else return STATE.BURYING; // When the inventory is full, bury bones } @Override public int onLoop() throws InterruptedException { switch (getState()){ // Get the current state case PICKING: pick(); // If we are picking, call the pick method break; case BURYING: bury(); // If we are burying, call the bury method break; } return 0; } private void pick(){ /* Get the closest ground item that matches our filter, in this case items which name contains "bones". This could be simplified by storing the names of all bones in a String[] */ GroundItem bones = getGroundItems().closest(new Filter<GroundItem>() { @Override public boolean match(GroundItem groundItem) { return groundItem.getName().toLowerCase().contains("bones"); } }); if(bones != null){ // Check that we found bones on the ground bones.interact("Take"); // If we did, pick them up try{ sleep(random(1000, 1200)); // Sleep for between 1 and 1.2 seconds after clicking on the bones } catch(InterruptedException e){ log(e); } } } private void bury(){ for(Item item : getInventory().getItems()){ // Iterate over each inventory item if(item.hasAction("Bury")) { // If it has the "Bury" action item.interact("Bury"); // Bury it try{ sleep(random(1000, 1200)); // Sleep for between 1 and 1.2 seconds after burying } catch(InterruptedException e){ log(e); } } } } }
-
A simple Bone burier
Fill inventory from what? your bank?
-
A simple Bone burier
wtf is that Observer Arrays.stream(getInventory().getItems()) .filter(item -> item.hasAction("Bury")) .foreach(bones -> bones.interact("Bury")); or for(Item item : getInventory().getItems()){ if(item.hasAction("Bury")) item.interact("Bury"); }
- Loading a preset server in OSBot?
-
How to dynamically add jar to classpath at runtime
Why are you trying to do that
-
May someone link me to a release that has On-Screen UI
I just need a release that has it and i'll do the rest. steal the rest.
-
How do i show the bot's cursor trail?
This isn't really a "scripting help" question, you can enable cursor trail in Options -> Debug -> Mouse trail Edit: I didn't even read your question apparently. Although i'm fairly sure Mouse trail in settings == Bot's mouse trail
-
Fallout 4 Hype
They are all awesome games. Fallout 3 has 9/10 on Steam, 9.6 / 10 on IGN, got game of the year etc. Fallout New Vegas has 10/10 on Steam and 8.5/10 on IGN. Fallout 4 also doesn't continue on from the previous games so you don't ned to have played them. Bugs are pretty irrelevant.
-
Noob trying to learn
For walking just use getLocalWalker().walk() and getLocalWalker().walkPath() This: Entity essence = getObjects().closest(essenceID); if (essence != null && essence.interact("Mine")) { if (essence.isVisible()) { essence.interact("Mine"); log("Mining some essence"); } } Is also wrong you are calling essence.interact("Mine") in your if statement??? Should be more like: RS2Object essence = getObjects().closest(essenceId); if(essence != null) essence.interact("Mine"); I also suggest you add more states to your script. For example, WALK_TO_BANK and WALK_TO_ESSENCE and update your getState method to something like: private State getState() { if (getInventory().isFull()) { if(BANK_AREA.contains(myPosition())) return State.BANK; else return State.WALK_TO_BANK; } else { if(MINE_AREA.contains(myPosition()) return State.MINE: else return State.WALK_TO_ESSENCE; } } For banking you are doing: if (bankBooth != null && bankBooth.interact("Bank")) { if (bankBooth.isVisible()) { log("Opening Bank"); bankBooth.interact("Bank"); sleep(random(1500, 2000)); } else { camera.toEntity(bankBooth); } } But there are methods that already do this in the API: getBank() getBank().open() getBank().isOpen() getBank().close() etc. For walking to an entity or area you can use: getLocalWalker().walk(entity.getPosition()); and getLocalWalker().walk(area.getRandomPosition()); For moving camera to the portal: getCamera().toEntity(getObjects().closest("Portal")); For interacting with the portal why not make a path to the portal, then click on the portal, then follow another path to the essence. For detecting when you are at the Essence you could potentially use a nearby object e.g. if(getObjects().closest("Essence") != null) return State.MINING;
-
Explv's Tutorial Island [Free] [Random Characters]
Most of these bugs should be fixed now, update to latest and let me know if there are any more problems These bugs should be fixed now. Thanks
-
Explv's Tutorial Island [Free] [Random Characters]
I have been made aware that there are bugs in the script. Haven't gotten around to fixing them yet, as i've been busy doing other things. I will patch it up later :P
-
Finished my new script, but how do I type faster?
Oops didn't even notice. Corrected my post, thanks for pointing it out.