-
Posts
4523 -
Joined
-
Last visited
-
Days Won
10 -
Feedback
100%
Posts posted by Eliot
-
-
2 hours ago, Athylus said:
Cool, thanks! Can you elaborate on this line?
Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) && Arrays.asList(actions).contains(obj.getActions()[0]) && (getMap().canReach(obj) || obj.getName().equals("Crate")) && !obj.equals(previous));
Why .contains(obj.getActions()[0])? Why the [0], that's got me stuck. What is it's purpose here?
An object has some set of actions, for example: ["Jump-up", "Walk here", "Examine"]. For agility, we always want to do the first interaction which in most programming languages is the 0 element. So I check my list of actions contains the first action in the object's list of actions, if it does, then I know it is an agility obstacle and I should interact with it.
- 1
-
Good luck buddy sounds fun!
-
A couple more ideas I have are a code review series where I go over someone's script and offer advice, etc.
Also a "What is antiban?" video I think @Alek would get a kick out of.
- 1
-
Thanks for the feedback friends. The code certainly isn't perfect, but it's definitely a good starting point and demonstrates the simplicity of some scripts!
I've added the source code to the original post. Some things for aspiring script writers to try and add on:
- Make the bot pick up marks of grace
- Make the bot eat food if it becomes damaged
- 2
- 1
-
- Popular Post
I started a new account and needed some agility levels, so I figured I'd record myself making an agility script and post it here. The goal of this is to try and encourage others to learn to script. Apologies for those on tiny monitors, the text will be very difficult to read (I make the font bigger about 2.5 minutes in). Also sorry for pauses and random scene switches, I was trying to figure out how to work the recording software and code and talk at the same time... too many things at once.
Watch at max quality (1440p) if you want to be able to read the code.
Source code:
import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.util.Arrays; @ScriptManifest(author = "eliot", info = "", logo = "", version = 1.0, name = "A GOOD SCRIPT") public class Main extends Script { private String[] actions = {"Climb", "Cross", "Balance", "Jump-up", "Jump", "Climb-down"}; private String[] names = {"Rough wall", "Tightrope", "Narrow wall", "Wall", "Gap", "Crate"}; Entity previous; @Override public void onStart() { getExperienceTracker().start(Skill.AGILITY); } @Override public int onLoop() throws InterruptedException { int starting = getExperienceTracker().getGainedXP(Skill.AGILITY); Entity nextObj = getObjects().closest(obj -> Arrays.asList(names).contains(obj.getName()) && Arrays.asList(actions).contains(obj.getActions()[0]) && (getMap().canReach(obj) || obj.getName().equals("Crate")) && !obj.equals(previous)); if (nextObj != null && !myPlayer().isMoving()) { if (nextObj.interact(nextObj.getActions()[0])) { new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return getExperienceTracker().getGainedXP(Skill.AGILITY) > starting; } }.sleep(); } if (getExperienceTracker().getGainedXP(Skill.AGILITY) > starting) { previous = nextObj; } } return 250; } }
- 26
- 3
-
On 7/4/2018 at 4:37 PM, lizzzerd said:
all data collected is sent to the H I V E for analysis
SOON.
- 1
-
Seeing code would help.
-
I know the game is a long ways from being release, but is anyone else planning to play when it finally launches?
-
Cool looking plugin Chris, keep it up!
- 1
-
I like Czar's scripts because they utilize the Newer Engine technology.
- 2
- 3
- 1
-
Hi, American here. I've lived in five different states and I have never seen a firearm in public aside from those being carried by police or military personnel. Foreigners have misinformed views of American gun culture due to sensationalization of gun violence in American and international media.
I believe there are steps that can be taken to reduce the occurrence of mass shooting incidences by making changes to both law and culture. I don't think it makes sense to take a polarizing view of the issue. Joining the "change nothing" camp or the "ban guns" camp does little to help reduce the rate of violent crimes. There are more guns in America than people, hopefully we will become better at keeping them in the hands of good people and out of the hands of bad people, but that's a problem that lacks a perfect solution.
- 1
-
Looks like Google installed NewerEngine.
-
Anyone having success with the script, any issues?
-
8 minutes ago, Chris said:
PlE3Ase Use NpC OkAY?
Entity fishingSpot
PoLyMoRpHiSM
- 2
- 1
-
Open Minnows
One-click fishing trainingWhat is it?
This script will catch you minnows!Features
- Fishes minnows in the expanded fishing guild
- Avoids & moves away from the fishing spot that eat your minnows
- Open source
Requirements
- Small fishing net
- 82+ fishing
- Angler's outfit
More Details
Start the script on the expanded fishing guild platform with the required items.Code
import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.awt.*; @ScriptManifest(name = "Open Minnows", version = 1.0, author = "Eliot", info = "Fish minnows", logo = "") public class MainDriver extends Script { private long startTime; private ConditionalSleep flyingFishCS; private ConditionalSleep interactingCS; private ConditionalSleep runningCS; // Paint constants private final Color transBackground = new Color(0, 0, 0, 178); private final Color rsOrange = new Color(252, 155, 31); private final Font font = new Font("Helvetica", Font.PLAIN, 12); @Override public void onStart() { startTime = System.currentTimeMillis(); getExperienceTracker().start(Skill.FISHING); flyingFishCS = new ConditionalSleep(1500) { @Override public boolean condition() throws InterruptedException { return myPlayer().getInteracting() != null && myPlayer().getInteracting().getModelHeight() > 9; } }; interactingCS = new ConditionalSleep(5000) { @Override public boolean condition() throws InterruptedException { return myPlayer().getInteracting() != null; } }; runningCS = new ConditionalSleep(3000) { @Override public boolean condition() throws InterruptedException { return getSettings().isRunning(); } }; } @Override public int onLoop() throws InterruptedException { if ((myPlayer().getInteracting() == null && !myPlayer().isMoving()) || (myPlayer().getInteracting() != null && myPlayer().getInteracting().getHeight() > 9) || getDialogues().isPendingContinuation()) { flyingFishCS.sleep(); if (!getSettings().isRunning() && getSettings().getRunEnergy() > 30) { getSettings().setRunning(true); runningCS.sleep(); } else { Entity fishingSpot = getNpcs().closest((Filter<NPC>) npc -> npc.getName().equals("Fishing spot") && npc.getModelHeight() < 10); if (fishingSpot != null) { fishingSpot.interact("Small Net"); interactingCS.sleep(); } } } return random(50, 200); } @Override public void onPaint(Graphics2D g) { // Set the font g.setFont(font); // Transparent box, holds paint strings g.setColor(transBackground); g.fillRect(1, 250, 225, 88); // Outside of transparent box g.setColor(rsOrange); g.drawRect(1, 250, 225, 88); // Draw paint info g.drawString("Open Minnows by Eliot", 10, 265); g.drawString("Runtime: " + formatTime(System.currentTimeMillis() - startTime), 10, 285); g.drawString("Fishing XP (p/h): " + getExperienceTracker().getGainedXP(Skill.FISHING) + " (" + getExperienceTracker().getGainedXPPerHour(Skill.FISHING) + ")", 10, 300); g.drawString("Fishing Level: " + getSkills().getStatic(Skill.FISHING) + " (" + getExperienceTracker().getGainedLevels(Skill.FISHING) + ")", 10, 315); g.drawString("Time to level: " + formatTime(getExperienceTracker().getTimeToLevel(Skill.FISHING)), 10, 330); } /** * Formats the runtime into human readable form * * @param time * @return string representing the runtime of the script */ private String formatTime(final long time) { long s = time / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } }
- 8
- 1
-
Got it, thanks @Aqua!
-
Looking To Borrow Account 82+ Fishing w/ Angler's Outfit
pls PM me it's for the good of the community
-
Cool scripts, especially the wilderness one. Nice job man!
-
45 minutes ago, LeBron said:
Is that allowed? Releasing someone elses product without their consent.
Technically allowed, but ethically questionable.
- 1
-
Awesome! Congrats to all, go buy some scripts friendos.
- 1
-
I run my sites on Heroku, but it's definitely not the most cost efficient, they just have nice tools and it's easy to use.
-
-
With a culturally insensitive and demeaning name like that I'm surprised workers are not flooding to your door!
-
Need quotes for this, about 10.7M exp needed.
Leave price and time frame. No botting, reputation required.
Has 70 atk, 70 def, and 70 prayer so can DH if wanted.
Free & Open Source | Open Minnows | Minnow Fishing
in Resource Collection
Posted
Checks for the random event thing that you don't want to continue fishing in.