Jump to content

TheGreatests

Lifetime Sponsor
  • Posts

    332
  • Joined

  • Last visited

  • Feedback

    100%

Everything posted by TheGreatests

  1. 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();
  2. 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();
  3. ^^ the wanna be police up in the club. everybody get him a donut!
  4. Yup, it hasnt fixed the lag at all. Anyone else know a reason why its lagging out?
  5. 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?
  6. 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.
  7. 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
  8. What exactly does Override do at this instances? Would it allow the loop to continue forth if a eruption has been made?
  9. 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...
  10. 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...
  11. 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.
  12. 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.
  13. 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; } } }
  14. Sounds good, I might be using a node structure for this soon. I just dont got time atm.
  15. Uhh, having endless struggles with my damn code. If anyone has any time, the issues ive been running with is 1. First code( Script accepted everything, and went through the loop fine. However once it accepted it would lag out to 56% CPU 2. Second Code(Script accepted everything, and went through the loop fine. However once a second trade was iniated, it would get stuck in the TradeAccept() method. 3. I got to this last editting, and it is now not starting. If anyone can give me a good code structuor to go with would help me. Got a headache, and going to bed but will be on tomorrow!. Code - 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; Player player = players.closest("Mule_name"); 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, 160); } @[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("Mule_name"); 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; } 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()); } if(trade.isSecondInterfaceOpen()) { RandomSleep(); trade.acceptTrade(); sleep(150, 300); RandomizeMouse(); log=("Accepted second trade interface"); while(isTrading() && !trade.didOtherAcceptTrade()); 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("MuleName"); lets try this 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; } } }
  16. Used - Player player = players.closest("Mule name!"); if(player.isInteracting(myPlayer())){ log= "We detected that our mule is trading us"; condition = true; Thinking this will be fine, I have a Wait4Player Method that returns a state also. - State that starts the trade/ EDIT: The first code structure I had was nearly using 50 of the CPU power, I just reconstructed the code, and now I am at 6%. Glad I am getting back to the programming I use to be on.
  17. Anyone know any good ways to properly code a widget to look for the "someone wishes to trade with you" dialog?
  18. Can you also add the imports. I keep getting issues, such as e needing to be a variable.
  19. Im catching up at it again, up to whoever if they wanna get some cash... i'll probably be all golden within a few days so whoever actually wants to make money let me know.
  20. Yea thats cool, you guys down to teach me a few things or did you guys get on my topic for fun? Got the cash, just need somebody with the time and experience.
  21. hahaha ;) ;) No I got pictures/eclipse logs though, just need to pick up again at everything. Its not easy remembering everything and anything. Considering alot of things has happened in my life that would put most people in a blind sight of view towards memory.
  22. Looking to hire a scripter who is experienced, and would be able to teach me the features he uses, and how he uses it. I have btc, so its straight cash, no refunds, no hassles. Wont pay first, the only way we will do it is with a MM, I was a MM at a different site but forgot my username, and pass. I had 370+ FB, and was a VMM. (Offsite mentions hidden)
  23. Do you have some time to give me a few logic pointers. I am starting to script up again, ive had previous experience. (First Advertising other bots isn&#39;t allowed. tab maker) but I forgot all about it. Started to direct my life towards other things so I seriously forgot almost everything and anything.
×
×
  • Create New...