osrunescapegold
Members-
Posts
9 -
Joined
-
Last visited
-
Feedback
0%
Profile Information
-
Gender
Male
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
osrunescapegold's Achievements
Newbie (1/10)
3
Reputation
-
Will upload a version that will allow user to use their own password
-
You don't it will generate them automatically and you will get them in output.
-
Will upload a better version soon
-
Progressive woodcutter with GE and mysql stats
osrunescapegold replied to osrunescapegold's topic in Scripting Help
Thanks for the comment guys and about code formatting in my IDE it looks good (I often use code reformat in intellij) but for some reason it pasted not so nicely here. -
Thanks:)
-
My first script(started learning java few days ago) Looking for some feedback what you would improve/change ignore the log texts import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import java.awt.*; import org.osbot.rs07.api.Bank; import org.osbot.rs07.api.GrandExchange; import org.osbot.rs07.api.Inventory; import org.osbot.rs07.api.Walking; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.api.model.*; import org.osbot.rs07.api.ui.Skill; import org.osbot.rs07.api.util.ItemContainer; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; import org.osbot.rs07.utility.ConditionalSleep2; import org.osbot.rs07.api.map.Area; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.ui.EquipmentSlot; import org.osbot.rs07.api.ui.Tab; import java.*; import static java.lang.Math.toIntExact; import java.awt.*; import java.io.IOException; import java.net.HttpURLConnection; import java.net.URL; import java.rmi.UnexpectedException; import java.sql.Connection; import java.sql.DriverManager; @SuppressWarnings("Duplicates") @ScriptManifest(author = "trees", info = "trees", name = "trees", version = 0, logo = "") public class tree extends Script { //private Area bankAreaTrees = new Area(new Position(0, 0, 0), new Position(0, 0, 0)); private Area trees = new Area(new Position(0, 0, 0), new Position(0, 0, 0)); private Area oak = new Area(new Position(0, 0, 0), new Position(0, 0, 0)); private Area yew = new Area(new Position(0, 0, 0), new Position(0, 0, 0)); //private Area ge = new Area(new Position(0, 0, 0), new Position(0, 0, 0)); //private long startTime; private int bankDeposit = 0; private long startTime; @Override public void onStart() throws InterruptedException { startTime = System.currentTimeMillis(); //getWalking().webWalk(yew); String playerUsername = myPlayer().getName(); log("Player username: " + playerUsername); try { mysql(playerUsername, 0); log("Player username added to database"); } catch (Exception e) { log("Problem adding player username to database"); } int woodCuttingLvlstart = getSkills().getDynamic(Skill.WOODCUTTING); log("Current woodcutting level : " + woodCuttingLvlstart); long hasAxe = getInventory().getAmount(1355); log("do we have axe"+hasAxe); } @Override public int onLoop() throws InterruptedException { int woodCuttingLvl = getSkills().getDynamic(Skill.WOODCUTTING); String playerUsername2 = myPlayer().getName(); long hasAxe = getInventory().getAmount(1355); log("do we have axe loop:"+hasAxe); try{ lvlDbUpdate(playerUsername2,woodCuttingLvl); log("Updated lvl"); } catch (Exception e){ log("Error updating lvl"); } //lvlDbUpdate(woodCuttingLvl); //woodCuttingLvl = 40; if (woodCuttingLvl < 15) { if (getInventory().getEmptySlotCount() >= 1) { log("Inventory NOT full, going to find trees"); if (trees.contains(myPlayer())) { log("We are at Trees location"); //find tree new ConditionalSleep(70000) { @Override public boolean condition() { return !myPlayer().isAnimating() && !myPlayer().isMoving(); } }.sleep(); RS2Object tree = getObjects().closest("Tree"); // continue when tree found if (tree != null) { tree.interact("Chop down"); //wait until tree cut new ConditionalSleep(20000) { @Override public boolean condition() { return !myPlayer().isAnimating() && !myPlayer().isMoving(); } }.sleep(); } } else { log("Not at tree location going now"); getWalking().webWalk(trees); } } else { // inventory is full we must deposit log("Walking to bank)"); getWalking().webWalk(Banks.VARROCK_EAST); NPC bank = getNpcs().closest("Banker"); bank.interact("Bank"); new ConditionalSleep(15000) { @Override public boolean condition() { return getBank().isOpen(); } }.sleep(); getBank().depositAllExcept("Bronze axe"); String playerUsername = myPlayer().getName(); try { mysql(playerUsername, 27); log("Amount of trees farmed updated in database"); } catch (Exception e) { log("Cant update amount of trees farmed"); } } } else if (woodCuttingLvl >= 15 && woodCuttingLvl < 21) { //code if lvl higher or equal to 15 if (getInventory().getEmptySlotCount() >= 1) { log("Inventory NOT full, going to find Oak"); log(woodCuttingLvl); if (oak.contains(myPlayer())) { log("We are at Oak location"); //find tree new ConditionalSleep(70000) { @Override public boolean condition() { return !myPlayer().isAnimating() && !myPlayer().isMoving(); } }.sleep(); RS2Object oak = getObjects().closest("Oak"); // continue when tree found if (oak != null) { oak.interact("Chop down"); //wait until tree cut new ConditionalSleep(25000) { @Override public boolean condition() { return !myPlayer().isAnimating() && !myPlayer().isMoving(); } }.sleep(); } } else { log("Not at Oak location going now"); getWalking().webWalk(oak); } } else { // inventory is full we must deposit log("Walking to bank)"); getWalking().webWalk(Banks.VARROCK_EAST); NPC bank = getNpcs().closest("Banker"); bank.interact("Bank"); new ConditionalSleep(14000) { @Override public boolean condition() { return getBank().isOpen(); } }.sleep(); getBank().depositAllExcept("Bronze axe"); String playerUsername = myPlayer().getName(); try { mysql(playerUsername, 27); log("Amount of Oak farmed updated in database"); } catch (Exception e) { log("Cant update amount of Oak farmed"); } } } else if (woodCuttingLvl >= 21) { //code if lvl higher or equal to 21 log(woodCuttingLvl); log("xxxxx"); new ConditionalSleep(15000){ @Override public boolean condition(){ return getInventory().contains("Mithril axe"); } }.sleep(); boolean mithrilAxeInInventory = getInventory().contains("Mithril axe"); long getAxe2 = getInventory().getAmount(1355); if (getAxe2 >= 1) { log("we have axe"); //lets cut more trees because we already have mithril axe log("Using Mithril axe"); if (getInventory().getEmptySlotCount() >= 1) { log("Inventory NOT full, going to find Oak"); log(woodCuttingLvl); if (oak.contains(myPlayer())) { log("We are at Oak location"); //find tree new ConditionalSleep(70000) { @Override public boolean condition() { return !myPlayer().isAnimating() && !myPlayer().isMoving(); } }.sleep(); RS2Object oak = getObjects().closest("Oak"); // continue when tree found if (oak != null) { oak.interact("Chop down"); //wait until tree cut new ConditionalSleep(25000) { @Override public boolean condition() { return !myPlayer().isAnimating() && !myPlayer().isMoving(); } }.sleep(); } } else { log("Not at Oak location going now"); getWalking().webWalk(oak); } } else { // inventory is full we must deposit log("Walking to bank)"); getWalking().webWalk(Banks.VARROCK_EAST); NPC bank = getNpcs().closest("Banker"); bank.interact("Bank"); new ConditionalSleep(14000) { @Override public boolean condition() { return getBank().isOpen(); } }.sleep(); getBank().depositAllExcept("Mithril axe"); String playerUsername = myPlayer().getName(); try { mysql(playerUsername, 27); log("Amount of Oak farmed updated in database"); } catch (Exception e) { log("Cant update amount of Oak farmed"); } } } else { // walk to ge and sell logs then buy mithril axe log("Walking to GE"); getWalking().webWalk(Banks.GRAND_EXCHANGE); if (Banks.GRAND_EXCHANGE.contains(myPlayer())) { // ADD BETTER CONDITIONAL SLEEP SINCE ON BIG POPULATION SERVER ISSUES log("Arrived at GE"); //find banker deposit all,withdraw logs,sell logs ge NPC bankerGE = getNpcs().closest("Banker"); bankerGE.interact("Bank"); log("issue here"); new ConditionalSleep(60000) { @Override public boolean condition() { return getBank().isOpen(); } }.sleep(); log("Walking to 2GE"); if (getBank().isOpen()) { getBank().depositAll(); log("Deposited everything to bank"); getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE); log("Walking to 3GE"); new ConditionalSleep(50000) { @Override public boolean condition() { return getBank().getWithdrawMode() == Bank.BankMode.WITHDRAW_NOTE; } }.sleep(); log("Walking to 4GE"); long hasAxe4 = getInventory().getAmount(1355); log("zero axes"+hasAxe4); if (getInventory().getAmount(1355) <= 0) { // note mode enabled,lets withdraw logs(id 1511) log("issue 22"); log("no axe must buy"); getBank().withdrawAll(1511); // check if maybe not have this in bank getBank().withdrawAll(995); new ConditionalSleep(40000){ @Override public boolean condition(){ return getInventory().contains(1512) || getInventory().contains(995); } }.sleep(); if (getInventory().contains(1512)) { log("we have logs in inventory lets sell them"); NPC geClerk = getNpcs().closest("Grand Exchange Clerk"); geClerk.interact("Exchange"); new ConditionalSleep(50000) { @Override public boolean condition() { return getGrandExchange().isOpen(); } }.sleep(); getGrandExchange().sellItem(1512, 2, 500); getBank().enableMode(Bank.BankMode.WITHDRAW_ITEM); new ConditionalSleep(50000) { @Override public boolean condition() { GrandExchange.Status statusSale = getGrandExchange().getStatus(GrandExchange.Box.BOX_1); return statusSale == GrandExchange.Status.FINISHED_SALE; } }.sleep(); log("Logs(1512) sold"); getGrandExchange().collect(); new ConditionalSleep(50000) { @Override public boolean condition() { return getInventory().getAmount(995) > 300; } }.sleep(); long currentGold = getInventory().getAmount(995); log("Current gold in inventory : "+currentGold); getGrandExchange().buyItem(1355, "mithril axe", toIntExact(currentGold), 1); getBank().enableMode(Bank.BankMode.WITHDRAW_ITEM); new ConditionalSleep(50000) { @Override public boolean condition() { GrandExchange.Status statusSale = getGrandExchange().getStatus(GrandExchange.Box.BOX_1); return statusSale == GrandExchange.Status.FINISHED_BUY; } }.sleep(); for(int i = 1;i < 10;i++){ getGrandExchange().collect(); } log("got axe"); new ConditionalSleep(50000) { @Override public boolean condition() { return getInventory().contains("Mithril axe"); } }.sleep(); //mithrilAxeInInventory = true; } else { getBank().withdraw(1511, 200); log("Waxxxxlking to GE"); } } else { getWalking().webWalk(oak); log("Walking to XGE"); } getBank().close(); } } else { log("Walking again to GE"); getWalking().webWalk(Banks.GRAND_EXCHANGE); log("Walking to GExx"); } } } return 600; } @Override public void onExit() throws InterruptedException { super.onExit(); } @Override public void onPaint(Graphics2D g) { } public final int 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); return (int) (s); } private void mysql(String name, int treefarmed) throws Exception { if (treefarmed > 0) { String url2 = "http://0.0.0.0/get.php?name=" + name + "&amount=" + treefarmed; URL obj2 = new URL(url2); HttpURLConnection con = (HttpURLConnection) obj2.openConnection(); con.setRequestMethod("GET"); con.setRequestProperty("User-agent", "Mozilla/6.0"); int responseCode = con.getResponseCode(); log("Sending URL request to : " + url2); log("Response code : " + responseCode); } else { String url = "http://0.0.0.0/get.php?name=" + name; URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); con.setRequestProperty("User-agent", "Mozilla/5.0"); int responseCode = con.getResponseCode(); log("Sending URL request to : " + url); log("Response code : " + responseCode); } } private void lvlDbUpdate(String name,int lvl) throws Exception { String url = "http://0.0.0.0/get.php?name=" + name+"&lvl="+lvl; URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("GET"); con.setRequestProperty("User-agent", "Mozilla/5.0"); int responseCode = con.getResponseCode(); log("Sending URL request to : " + url); log("Response code : " + responseCode); } }
-
How would I go to check if the account is banned or not?
-
I am testing out some free credits on amazon for VPS,I have a 8 core 16gb ram server running and its running 9 clients at 90% cpu power I believe I could run up-to 11 clients on this server I want to know what kind of server is required to run 50-80 clients per VPS?
-
Please add random character look and try to use words in username instead of just random letters/numbers