Everything posted by TheGreatests
-
GE Help
Ah that sucks, so the API doesnt have the e.sellItems(2354,"Steel bar", 22, 299); method does it...
-
GE Help
Ah ok, gonna do that now. Basically adding the .jar files I assume correct? Got it Juggles, tyvm buddy!
-
GE Help
Updated the bot, using Eclipse. Can you just update it that way or some other way?
-
GE Help
the buyitems seems to be not working for me, continues to tell me that im not assigning the right integers, and such. GE.box??
-
Generating an area next to an RS2Object with variable size
Ya weird thing is ive made several scripts already. Willing to tutor me alittle, i'll pay ya! How do I call this class into another class though. its a Enum?
-
Generating an area next to an RS2Object with variable size
Can you tell me how to implement it without having to have the code in the class itself?
-
Generating an area next to an RS2Object with variable size
How do you implement this into a constants class? or without having to add the code to a node.
-
DNS broken?
lol love the end brother lol
-
OSBot 2.4.96 - Bunch of Treats, No Tricks
Check the candy for razor blades and firearms but if you find any drugs, let me know I will confiscate. (no meth, or Heroine please though)
-
Some help if possible, trying to get script to sit idling without lag
So this is a better structure for nodes then I am assuming. Should I use this structure instead of the one I am using now, if so, is there any special features added to this one?
-
Logging out, and logging into a array of specific or a randomized accounts
Oh I was hoping to have script log my current slave out, and then login from a stored list of arrays. This works though also huh? Is this all through command prompt using echos?
-
Logging out, and logging into a array of specific or a randomized accounts
Looked at the API briefly, and am still getting confused. What I am trying to do is Trying to store accounts, and then randomizing login into those accounts after a certain amounts of a resource is obtained(Ore, Essences.. ect) Here is what I found in the API but I do not know how to implement it into the script and make the method function correctly. Client.LoginStage.LOGGED_OUT, however I do not know how to implement this into my method so I can have it login and log out from a randomized account. I know loginStage gets where the clients protocols are at during operation, but how the hell do you logout, and then login with a listed array of stored accounts. well found out how to log out I believe.. logoutTab.logOut();
-
My node class! everything looks clean but not start -_-
Awesome tyvm, switched it over. It works, however now somehow my data.RandomSleep() is throwing a null. Its using a method from the data class.. Why would it throw a null.. Do I need to make a instance of this? And I did just that, and it worked. Used sleep.RandomSleep(); and made a instance of the Data class by Data sleep = new Data();
-
gold farming
^^ the wanna be police up in the club. everybody get him a donut!
-
My node class! everything looks clean but not start -_-
Yup, it hasnt fixed the lag at all. Anyone else know a reason why its lagging out?
-
My node class! everything looks clean but not start -_-
Yup, I tried this way just to test it out, this is the wait class package nodes; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import Scripts.Node; import data.Data; public class Wait extends Node { public Wait(Script sA) { super(sA); // TODO Auto-generated constructor stub } public boolean isTrading(){ return s.trade.isCurrentlyTrading(); } public String status(){ return "In our waiting method"; } public String status; Data c = new Data(); private Script s; @SuppressWarnings("unused") private Player me; @SuppressWarnings("unused") private Inventory inv; private Data data; @[member=Override] public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return !isTrading(); } @[member=Override] public boolean execute() throws InterruptedException { // TODO Auto-generated method stub System.out.println("We are in the wait class"); status = "We are sleeping"; data.RandomSleep(); return true; } Im not sure why that class was posted, that was long ago. My wait class is throwing nullpointers at wait.isTrading (wait.java: 17) <-- Which is the is trading boolean and line 33 which is the validation for isTrading... Wondering if I need to do null checks? but how would you do that? s.trade.isCurrentlyTrading != null?
-
My node class! everything looks clean but not start -_-
Yup I corrected these awhile back, and used MethodProvider just like you mentioned. still messed up, here is my modified code now for my wait class. and the data class package nodes; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import Scripts.Node; import data.Data; public class Wait extends Node { public Wait(Script sA) { super(sA); // TODO Auto-generated constructor stub } public boolean isTrading(){ return s.trade.isCurrentlyTrading(); } public String status(){ return "In our waiting method"; } public String status; Data c = new Data(); private Script s; @SuppressWarnings("unused") private Player me; @SuppressWarnings("unused") private Inventory inv; private Data data; @[member=Override] public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return !isTrading(); } @[member=Override] public boolean execute() throws InterruptedException { // TODO Auto-generated method stub System.out.println("We are in the wait class"); status = "We are sleeping"; data.RandomSleep(); return true; } } ^^^ Wait class package data; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.script.MethodProvider; public class Data { public Area b = new Area(1674, 3564, 1676, 3559); public Area west = new Area(1665, 3549, 1673, 3543); public Area ClayAreaN = new Area(1683, 3533, 1691, 3527); public Area ClayAreaS = new Area(1705, 3550, 1713, 3543); public Area seast = new Area(1713, 3522, 1720, 3516); public Area swest = new Area(1685, 3516, 1691, 3510); private int currentWorld = 0; public int clay = 435; private String status = "Initializing..."; public static int[] Worlds = {2, 3, 4, 5, 6, 9, 10, 11, 12, 14, 18, 19, 20, 22, 27, 28, 29, 30, 33, 34, 36, 38, 41, 42, 43, 44, 46, 50, 51, 52, 54, 58, 59, 60, 62, 67, 68, 69, 70, 74, 76, 77, 78, 86}; public static int worldCounter; public int counter; public void setCurrentWorld(int c) { currentWorld = c; } public int getCurrentWorld() { return currentWorld; } public int MinningOres = 952, SALT = 13421, STAM = 12631, STAM3 = 12627, STAM2= 12629, STAM4 = 12625, VIAL = 229; private boolean staminaUsage; private boolean worldHopUsage; /*public Constants(boolean staminaUsage, boolean worldHopUsage) { this.staminaUsage = staminaUsage; this.worldHopUsage = worldHopUsage; } */ public boolean getStaminaUsage() { return staminaUsage; } public boolean getWorldHopUsage() { return worldHopUsage; } public void sleep(int min, int max) throws InterruptedException { sleep(MethodProvider.random(min, max), max); } public void RandomSleep() throws InterruptedException { switch(MethodProvider.random(0, 4)) { case 0: MethodProvider.random(650, 1250); break; case 1: MethodProvider.random(1450, 2050); break; case 2: MethodProvider.random(2250, 2850); break; case 3: MethodProvider.random(3050, 3850); break; } } public void setStatus(String s) { if (!s.equals(this.status)) { this.status = s; } } public String getStatus() { return this.status; } } ^^ data class... Still freezes, it gives me a log saying that there is something wrong with the isTrading() validation, however ive tried nearly everything.
-
My node class! everything looks clean but not start -_-
case 0: MethodProvider.random break; ??
-
My node class! everything looks clean but not start -_-
Awesome!, I declared overrides on both of the Loop, and start. It worked however it closed once again. Ive even tried to debug it using system prints, and I cant even seem to get into my wait node. [ERROR][bot #1][10/20 03:17:14 AM]: Error in script onStart(): MuleTrader V10 java.lang.NullPointerException at data.Data.<init>(Data.java:31) at nodes.Trading.<init>(Trading.java:12) at Scripts.MuleTrader.onStart(MuleTrader.java:39) at org.osbot.rs07.event.ScriptExecutor.IiiIiiiIiiiI(gp:279) at org.osbot.rs07.event.ScriptExecutor.start(gp:30) at org.osbot.c.run(su:200) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) [iNFO][bot #1][10/20 03:17:14 AM]: Terminating script MuleTrader V10... [iNFO][bot #1][10/20 03:17:14 AM]: Thanks for running the script! [iNFO][bot #1][10/20 03:17:14 AM]: Script MuleTrader V10 has exited! [iNFO][bot #1][10/20 03:17:14 AM]: Started script : MuleTrader V10
-
My node class! everything looks clean but not start -_-
What exactly does Override do at this instances? Would it allow the loop to continue forth if a eruption has been made?
-
My node class! everything looks clean but not start -_-
Node class: package Scripts; import org.osbot.rs07.script.Script; public abstract class Node { public Script sA; public Node(Script sA){ this.sA = sA; } public String status(){ return ""; } public abstract boolean validate() throws InterruptedException; public abstract boolean execute() throws InterruptedException; } Data constants class (alot of stuff in data im not using) package data; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.script.MethodProvider; public class Data { public Area b = new Area(1674, 3564, 1676, 3559); public Area west = new Area(1665, 3549, 1673, 3543); public Area ClayAreaN = new Area(1683, 3533, 1691, 3527); public Area ClayAreaS = new Area(1705, 3550, 1713, 3543); public Area seast = new Area(1713, 3522, 1720, 3516); public Area swest = new Area(1685, 3516, 1691, 3510); private int currentWorld = 0; public int clay = 435; private String status = "Initializing..."; public static int[] Worlds = {2, 3, 4, 5, 6, 9, 10, 11, 12, 14, 18, 19, 20, 22, 27, 28, 29, 30, 33, 34, 36, 38, 41, 42, 43, 44, 46, 50, 51, 52, 54, 58, 59, 60, 62, 67, 68, 69, 70, 74, 76, 77, 78, 86}; public static int worldCounter; public int counter; public void setCurrentWorld(int c) { currentWorld = c; } public int getCurrentWorld() { return currentWorld; } public int MinningOres = 952, SALT = 13421, STAM = 12631, STAM3 = 12627, STAM2= 12629, STAM4 = 12625, VIAL = 229; private boolean staminaUsage; private boolean worldHopUsage; /*public Constants(boolean staminaUsage, boolean worldHopUsage) { this.staminaUsage = staminaUsage; this.worldHopUsage = worldHopUsage; } */ public boolean getStaminaUsage() { return staminaUsage; } public boolean getWorldHopUsage() { return worldHopUsage; } public void sleep(int min, int max) throws InterruptedException { sleep(MethodProvider.random(min, max), max); } public void RandomSleep() throws InterruptedException { switch(MethodProvider.random(0, 5)) { case 0: sleep(650, 1250); break; case 1: sleep(1450, 2050); break; case 2: sleep(2250, 2850); break; case 3: sleep(3050, 3850); break; } } public void setStatus(String s) { if (!s.equals(this.status)) { this.status = s; } } public String getStatus() { return this.status; } } Trading node class package nodes; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; import Scripts.Node; import data.Data; public class Trading extends Node{ Data c = new Data(); private Script s; @SuppressWarnings("unused") private Player me; @SuppressWarnings("unused") private Inventory inv; @SuppressWarnings("unused") private Data data; public Trading(Script sA) { super(sA); // TODO Auto-generated constructor stub } public String status(){ return "Our mule is trading with us"; } public boolean validate() throws InterruptedException{ //int count = 0; Player player = s.players.closest("L3gendsNight"); return player.isInteracting(s.myPlayer()); } public boolean execute() throws InterruptedException{ status(); Player player = s.players.closest("L3gendsNight"); player.hover(); MethodProvider.random(400, 850); player.interact("Trade with"); return false; } } Intrade node class package nodes; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.MethodProvider; import org.osbot.rs07.script.Script; import Scripts.Node; import data.Data; public class InTrade extends Node { private boolean isTrading() { return s.trade.isCurrentlyTrading(); } public String status; Data c = new Data(); private Script s; @SuppressWarnings("unused") private Player me; @SuppressWarnings("unused") private Inventory inv; @SuppressWarnings("unused") private Data data; public InTrade(Script sA) { super(sA); // TODO Auto-generated constructor stub } public String status(){ return "In trade"; } @[member=Override] public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return s.trade.isFirstInterfaceOpen() || s.trade.isSecondInterfaceOpen(); } @[member=Override] public boolean execute() throws InterruptedException { // TODO Auto-generated method stub s.trade.acceptTrade(); status =("Accepted first trade interface"); while(isTrading() && !s.trade.didOtherAcceptTrade()){ MethodProvider.random(250,800); return false; } return true; } } Wait node class: package nodes; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import Scripts.Node; import data.Data; public class Wait extends Node { public Wait(Script sA) { super(sA); // TODO Auto-generated constructor stub } public String status; Data c = new Data(); private Script s; @SuppressWarnings("unused") private Player me; @SuppressWarnings("unused") private Inventory inv; private Data data; Player player = s.players.closest("L3gendsNight"); @[member=Override] public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return !player.isInteracting(s.myPlayer()) && !s.trade.isFirstInterfaceOpen() || !s.trade.isSecondInterfaceOpen(); } @[member=Override] public boolean execute() throws InterruptedException { // TODO Auto-generated method stub status = "We are sleeping"; data.RandomSleep(); return true; } } Main class - package Scripts; import nodes.ClayMine; import nodes.InTrade; import nodes.Trading; import nodes.Wait; import org.osbot.s; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import data.Data; import java.awt.*; import java.lang.Thread.State; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; @SuppressWarnings("unused") @ScriptManifest(author = "Elvito", info = "Trades with mule", name = "MuleTrader V2", version = 1.0, logo = "Trades with mule") public class MuleTrader extends Script { public static Data data; //private SettingsGUI gui; private long lobsterCaught; private int fishExpGained; private long startTime; public String status; private Inventory inv; private List<Node> nodes = new ArrayList<Node>(); public void onStart() { //createGUI(); Collections.addAll(nodes, new Wait(this), new Trading(this), new InTrade(this)); //new ClayMine(this) If you want to add the mining clay //various checks to see if show the gui yet } public int onLoop() throws InterruptedException{ for (Node n : nodes){ if(n.validate()){ status = n.status(); if(n.execute()) { return random(200,400); } } } return random(250,400); } private void createGUI() { // TODO Auto-generated method stub //code for the GUI } private State getState() { return null; } @[member='Override'] public void onExit() { log("Thanks for running the script!"); } public final String formatTime(final long ms){ long s = ms / 1000, m = s / 60, h = m / 60; s %= 60; m %= 60; h %= 24; return String.format("%02d:%02d:%02d", h, m, s); } @[member='Override'] public void onPaint(Graphics2D g) { g.setColor(Color.MAGENTA); g.drawString("dontbuzz Karamja Lobster", 10, 40); fishExpGained = getExperienceTracker().getGainedXP(Skill.FISHING); g.setColor(Color.black); g.drawString("Status " + status, 10, 55); lobsterCaught = inv.getAmount(435); g.drawString("Ores traded " + lobsterCaught, 10, 70); final long runTime = System.currentTimeMillis() - startTime; g.drawString("Time Running " + formatTime(runTime), 10, 85); } } Have no clue why it is not starting, no logs are shown...
-
Getting back on nodes, needing some help!
Entity Ore is also giving me suggestions but not entirely sure. I fixed the random sleeps. Tyvm Chris for the extra example!. s.objects.closest(data.clay); is giving me a suggestion// error also. Tried using RS2Object also...
-
Getting back on nodes, needing some help!
Hello, I am reconstructing my script, and having just a tad of a issue with my brief code wondering if anyone has any time to give a hand or just put in your opinions on what is goiing on so I can troubleshoot it through that way. Here is the code, I will Highlight the issues that my eclipse is reading. package nodes; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.Client; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.Objects; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import data.Data; import Scripts.Node; public class ClayMine extends Node{ final int clay = 7454; final String ClayOre = "Clay"; Entity Ore = Objects.closest(data.clay); public ClayMine(Script sA) { super(sA); // TODO Auto-generated constructor stub } private Script s; private Data data; private Player me; private Inventory inv; @[member=Override] public boolean validate() throws InterruptedException { // TODO Auto-generated method stub return s.inventory.isEmpty() && data.ClayAreaN.contains(s.myPlayer()); String status = "We're at north mining area"; } @[member=Override] public boolean execute() throws InterruptedException { if(Ore != null && data.ClayAreaN.contains(s.myPlayer())){ if(!s.myPlayer().isAnimating()){ Ore.interact("Mine"); String status = "Mining ore"; } return random(250,400); } break; } } The issues are highlighted in red, I am not entirely sure why I have to create a random method when its in the script package, and also if I am declaring entity wrong because its giving me a suggestion but I am pretty sure I am doing it right. I am grabbing the Clay Int from the data class.
-
Some help if possible, trying to get script to sit idling without lag
Ahhh!!! I forgot about that, I am gonna modify it tomorrow with a scripter. I wanna make this sucker clean, nodes are easy but I have completely forgotten and lost my set up before.
-
Some help if possible, trying to get script to sit idling without lag
Having some issues with my script lagging out, its basically just going to sit there and idle until my mule starts a trade. Issues are it lags out after first trade or so. Here is the code, if you have a better structure let me know. I was thinking of using Nodes but am alittle lazy and cant seem to find a good stable skeleton for nodes that I could use with this. import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import java.lang.String; import java.text.Normalizer; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.script.Script; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.ui.Tab; import javax.swing.*; @SuppressWarnings("unused") @ScriptManifest(author = "Elvis", info = "Muler V2.7", name = "Mule Trader V2.7", version = 2.7, logo = "Trades your miner to collect the profit!") public class ClayMule extends Script{ private final Area TRADING_AREA = new Area(3185, 3437, 3181, 3434); private int claycount; private int clay = 435; private State state = State.STARTIT; private long elapsed; private String log; private boolean isRunning = true; private int world; private boolean condition; private enum State { Wait, TradeAccepted, STARTIT,Trade } @[member=Override] public int onLoop() throws InterruptedException { switch(state) { case Wait: Wait4Player(); break; case Trade: Trade(); break; case TradeAccepted: TradeAccept(); break; case STARTIT: STARTIT(); break; } return random(120, 360); } @[member=Override] public void onStart() { isRunning = true; random(18, 32); world = worlds.getCurrentWorld(); Thread runTimeThread = new Thread() { @[member=Override] public void run() { try { RunTime(); } catch (Exception e) { log(e.getMessage()); } } }; runTimeThread.start(); } private void Wait4Player() throws InterruptedException { Player player = players.closest("xxxxxxxxxx"); if(player.isInteracting(myPlayer())){ log= "We detected that our mule is trading us"; condition = true; log=("Our mule has activated one of our conditions to trade"); state =State.Trade; log=("Switching to trade method"); return; } else if(!player.isInteracting(myPlayer())){ random(500,1200); } state = State.TradeAccepted; } private void TradeAccept() throws InterruptedException { //if(isTrading()) { if(trade.isFirstInterfaceOpen()) { //log=("We are in the first trade interface"); //if(!trade.offer(435, inventory.getItem(clay).getAmount())) return; log=("We are in the first trade interface"); sleep(880, 1350); RandomizeMouse(); RandomSleep(); trade.acceptTrade(); sleep(1200, 2300); RandomizeMouse(); log=("Accepted first trade interface"); while(isTrading() && !trade.didOtherAcceptTrade()){ random(600,1200); } } if(trade.isSecondInterfaceOpen()) { RandomSleep(); trade.acceptTrade(); sleep(150, 300); RandomizeMouse(); log=("Accepted second trade interface"); while(isTrading() && !trade.didOtherAcceptTrade()){ random(600,1200); } Wait4Player(); } // STARTIT(); // } } private void Trade() throws InterruptedException { sleep(1600, 2500); if(isTrading()) { log=("We are trading"); TradeAccept(); } else { if(getWorlds().getCurrentWorld() != 383) { log=("Detected we are in not in the world of our mule, hopping to world"); worlds.hop(383); sleep(8*1000, 14*1000); return; } if(!TRADING_AREA.contains(myPlayer())) { log=("Moving to trade area"); MoveToZone(TRADING_AREA); sleep(880, 1350); return; } Player player = players.closest("xxxxxx"); if(player != null && condition == true) { if(!player.isVisible()) camera.toEntity(player); sleep(650, 2450); player.hover(); sleep(400, 850); if(player.interact("Trade with")) { log=("Trading with Mule"); condition = false; log("Our condition is now false, until mule trades us again"); sleep(1250, 1650); RandomizeMouse(); sleep(4500, 6500); return; } } } } private void STARTIT() throws InterruptedException { log=("Idling until our mule activates us..."); state = State.Wait; return; } @[member=Override] public void onExit() { isRunning = false; log="We are finished"; } @[member=Override] public void onPaint(Graphics2D g) { claycount = (int) inventory.getAmount(434); int x = getMouse().getPosition().x; int y = getMouse().getPosition().y; g.drawLine(0, y, 765, y); g.drawLine(x, 0, x, 503); DrawUpdate(g); } private void DrawUpdate(Graphics2D g) { g.setColor(new Color(0, 0, 0, 80)); g.fillRect(4, 280, 512, 58); g.setColor(Color.white); g.setFont(new Font("Consolas", Font.PLAIN, 12)); g.drawString("RunTime: " + GetRunTime(), 14, 300); g.drawString("Clay traded over " + claycount, 170, 300); g.drawString("Status: " + log, 219, 325); } private void RunTime() throws InterruptedException { long startTime = System.currentTimeMillis(); while(isRunning) { elapsed = (System.currentTimeMillis() - startTime); sleep(1000); } } /*private void LaunchGUI() { } private void CloseGUI() { } */ private void sleep(int min, int max) throws InterruptedException { sleep(random(min, max)); } private String GetRunTime() { long hours = (elapsed / (1000 * 60 * 60)) % 24; long minutes = (elapsed / (1000 * 60)) % 60; long seconds = (elapsed / 1000) % 60; return String.format("%02d:%02d:%02d", hours, minutes, seconds); } private void MoveToZone(Area zone) throws InterruptedException { walking.webWalk(zone.getRandomPosition()); } private boolean isTrading() { return trade.isCurrentlyTrading(); } private boolean isInRadius(NPC npc) { Player me = myPlayer(); int x = me.getX(), y = me.getY(); return new Area(x + 1, y + 1, x - 1, y - 1).contains(npc); } private void RandomizeMouse() { switch(random(0, 5)) { case 0: mouse.moveRandomly(); break; case 1: mouse.moveOutsideScreen(); break; case 2: mouse.moveSlightly(); break; } } private void RandomSleep() throws InterruptedException { switch(random(0, 5)) { case 0: sleep(650, 1250); break; case 1: sleep(1450, 2050); break; case 2: sleep(2250, 2850); break; case 3: sleep(3050, 3850); break; } } }