Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.*;
- import org.rsbot.script.wrappers.*;
- @ScriptManifest(authors = {"TT Production"}, keywords = {"Cowhide Tanner"}, name = "TT Tanner", description = "A Cowhide Tanner", version = 0.1)
- public class TTTanner extends Script{
- RSTile tannerTile = new RSTile (3276,3191);
- RSTile bankTile = new RSTile (3270,3166);
- int cowhide = 1739;
- int gold = 995;
- int Inventory = 0;
- int bankerID = 496;
- int tannerID = 2824;
- int leatherID = 1743;
- int leatherGot;
- int cowhideprice;
- int leatherprice;
- long starttime;
- private boolean restCheck;
- private boolean antibanCheck;
- @Override
- public boolean onStart() {
- return true;
- }
- public void bank() {
- RSNPC banker = npcs.getNearest(bankerID);
- if (restCheck == true) {
- rest();
- }
- if (bank.isOpen() && inventory.contains(leatherID))
- bank.depositAllExcept(gold);
- Inventory = inventory.getCount(leatherID);
- leatherGot += Inventory;
- sleep(500, 750);
- if (bank.isOpen() && inventory.getCount(gold) < 1000);
- log ("gold check");
- bank.withdraw(gold, 10000);
- sleep(500, 750);
- if (bank.isOpen() && !inventory.contains(leatherID)) {
- bank.withdraw(cowhide, 27);
- sleep(500, 750);
- bank.close();
- } else {
- if(banker != null) {
- if(banker.isOnScreen())
- banker.doAction("Bank Banker");{
- } sleep(1800, 2100);
- } else {
- walking.getPath(bankTile).traverse();
- }
- }
- }
- public void tan(){
- RSNPC tanner = npcs.getNearest(tannerID);
- if (tanner != null) {
- if(tanner.isOnScreen())
- tanner.doAction("Trade Ellis");{
- sleep(800, 1100);
- mouse.click(205,108,false);
- sleep(350, 500);
- mouse.click(205,198,true);
- } sleep(500, 800);
- }
- }
- public boolean atBank(){
- RSArea BankArea = new RSArea(new RSTile(3265, 3160),
- new RSTile(3272, 3273));
- return BankArea.contains(getMyPlayer().getLocation());
- }
- public boolean atTanner(){
- RSArea TannerArea = new RSArea(new RSTile(3270, 3189),
- new RSTile(3277, 3194));
- return TannerArea.contains(getMyPlayer().getLocation());
- }
- private void rest() {
- if(restCheck == true);
- if(walking.getEnergy() < 30)
- walking.rest(random(70,95));
- }
- private void antiBan() {
- int t = random(0, 10);
- int r = random(0, 15);
- if (t == 7);
- if (r == 2) {
- mouse.moveSlightly();
- sleep(500, 800);
- }
- if (r == 3) {
- mouse.moveRandomly(10, 50);
- }
- if (r == 5) {
- camera.moveRandomly(random(350, 650));
- }
- if (r == 6) {
- camera.moveRandomly(random(450, 750));
- }
- if (r == 8) {
- camera.moveRandomly(random(150, 450));
- }
- if (r == 10) {
- camera.moveRandomly(random(750, 1250));
- }
- if (r == 12) {
- mouse.moveOffScreen();
- }
- if (r == 14) {
- camera.moveRandomly(random(500, 900));
- }
- }
- public int loop() {
- if(atBank() && !inventory.contains(cowhide)){
- bank();
- log ("1");
- }
- if(atBank() && inventory.contains(leatherID)){
- bank();
- log ("2");
- }
- if(atTanner() && inventory.contains(cowhide)){
- tan();
- log ("3");
- }
- if(!atTanner() && inventory.contains(cowhide)){
- walking.walkTo(tannerTile);
- log ("4");
- }
- if(!atBank() && !inventory.contains(cowhide)){
- walking.walkTo(bankTile);
- log ("5");
- if(antibanCheck == true) {
- antiBan();
- }
- }
- return random(500, 1500);
- }
- @Override
- public void onFinish() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment