Donald Trump 333 Posted September 15, 2017 ~ Under Construction, expect changes! ~ Guide 1 - Setting up Intellij with basic template. Download Intellij Community Edition File -> New -> Project Select Java Ensure your Project SDK is 1.8 Fill Details Right click src -> New -> Java Class Enter main Now Copy/Paste this: https://hastebin.com/cizuyoweru.java File -> Project Structure -> Libraries Click green plus at top Click java once it appears Navigate to your BotData folder inside DreamBot then select client.jar Click OK Bottom right click Apply Click Artifacts Same again click green plus Jar -> Empty Fill in the Name & Output directory for the .jar file of your script Double click compile out so it's under the jar name you chose on the left Click Apply -> OK Script Examples: Walking to GE ~ https://hastebin.com/ozixezemuk.javaKilling Chickens ~ https://hastebin.com/yuforenemi.java Script Snippets: QuickStart Parameters ~ https://hastebin.com/kisoxokeko.cs Banking / Looting Example ~ https://hastebin.com/orisuzemav.swift
riset4 17 Posted September 15, 2017 Awesome, very helpful if you wanna get started creating your own simple scripts!
Sophisticated 1 Posted September 16, 2017 Awesome code examples, helped me making my first script today (picking grain and banking)!
LogicSoup 92 Posted September 16, 2017 it would be better not to use states and just onLoop for noobs bro
dQw4w9WgXcQ 184 Posted September 21, 2017 these are not examples of good code. not following naming conventions/incorrect access modifier. area_chickens and enum set should be in all cap case. AREA_CHICKENS should be public static final: private Area area_chickens public enum State { nothing, walk probably dont understand lambdas if you name the parameter "filter"... getNpcs().closest(filter -> filter != null && filter.getName().equals("Chicken") && !filter.isInCombat()); unecessary sleepUntil. sleepUntil should be avoided unless necessary since its resource intensive (it polls a condition every 25ms). private boolean sleepWalk(int distance, int timeout) { // This will make the client sleep until the player isn't moving, times out or within the distance defined.return sleepUntil(() -> !getLocalPlayer().isMoving() || getLocalPlayer().distance(getClient().getDestination()) < distance, timeout);} maybe you should read tutorials instead of making them
Donald Trump 333 Author Posted September 21, 2017 these are not examples of good code. not following naming conventions/incorrect access modifier. area_chickens and enum set should be in all cap case. AREA_CHICKENS should be public static final: private Area area_chickens public enum State { nothing, walk probably dont understand lambdas if you name the parameter "filter"... getNpcs().closest(filter -> filter != null && filter.getName().equals("Chicken") && !filter.isInCombat()); unecessary sleepUntil. sleepUntil should be avoided unless necessary since its resource intensive (it polls a condition every 25ms). private boolean sleepWalk(int distance, int timeout) { // This will make the client sleep until the player isn't moving, times out or within the distance defined. return sleepUntil(() -> !getLocalPlayer().isMoving() || getLocalPlayer().distance(getClient().getDestination()) < distance, timeout); } maybe you should read tutorials instead of making them These are things I would have found useful on day 1 of starting to script. The lambdas named filter was just a way to express its a filter to the new user not understanding that. The naming conventions is just nitt picking, if you have anything actually constructive to contribute then I'm all ears.
Articron 746 Posted September 21, 2017 These are things I would have found useful on day 1 of starting to script. The lambdas named filter was just a way to express its a filter to the new user not understanding that. The naming conventions is just nitt picking, if you have anything actually constructive to contribute then I'm all ears. I think the point he's trying to make is that if you teach people, it should be code that is actually functional in the bigger scheme of things (access modifiers aren't naming conventions, they're a pivotal element that every scripter and/or programmer should know), and code that teaches them good (naming) habits
AceKingSuited 24 Posted September 22, 2017 these are not examples of good code. not following naming conventions/incorrect access modifier. area_chickens and enum set should be in all cap case. AREA_CHICKENS should be public static final: private Area area_chickens public enum State { nothing, walk probably dont understand lambdas if you name the parameter "filter"... getNpcs().closest(filter -> filter != null && filter.getName().equals("Chicken") && !filter.isInCombat()); unecessary sleepUntil. sleepUntil should be avoided unless necessary since its resource intensive (it polls a condition every 25ms). private boolean sleepWalk(int distance, int timeout) { // This will make the client sleep until the player isn't moving, times out or within the distance defined. return sleepUntil(() -> !getLocalPlayer().isMoving() || getLocalPlayer().distance(getClient().getDestination()) < distance, timeout); } maybe you should read tutorials instead of making them Most new scripters aren't set out to become software developers. I learned at a young age off poorly documented and poorly conventioned code and honestly feel like it helped because I wasn't trying to absorb so much information that didn't matter at the time. I didn't care if a constant was in all caps as long as the damn thing worked. If they are trying to take it that seriously, they need to be doing more learning than the tutorials section on DreamBot lmfao. If this is presented in a way that someone will learn from it, who cares if they aren't learning damn conventions. They are learning concepts that are 10x more important in the beginning to understand and get something working.
GANJAMAN 9 Posted September 27, 2017 How would I go about making code from OSBot work with dreambot API? import org.osbot.W;import org.osbot.rs07.api.map.Area;import org.osbot.rs07.api.map.Position;import org.osbot.rs07.api.model.NPC;import org.osbot.rs07.api.ui.EquipmentSlot;import org.osbot.rs07.api.ui.MagicSpell;import org.osbot.rs07.api.ui.Skill;import org.osbot.rs07.api.ui.Spells;import org.osbot.rs07.event.WebWalkEvent;import org.osbot.rs07.script.Script;import org.osbot.rs07.script.ScriptManifest;import org.osbot.rs07.utility.Condition;import org.osbot.rs07.utility.ConditionalSleep;import java.awt.*;import static org.osbot.rs07.api.map.constants.Banks.CANIFIS; I'm a novice scripter so please help a brother out! cheers, you scripters motivate me!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.