Jump to content

xVirtus

Members
  • Posts

    73
  • Joined

  • Last visited

  • Feedback

    100%

Posts posted by xVirtus

  1. Just now, Rare scripts said:

    I had to read this over twice 😂
    Can u try with my snippet? This never failed for me personally.

    -Rare.

    haha, basically i figured out that it would enter the last else if statement, before running the previous one when using else if, rather than if. I will try using your snippet later and see if it works the same. Then probrably keep using that later. Only been messing with this since last night, and already made a functioning kebab buyer with GE selling 😛 

    • Like 1
  2. 9 minutes ago, Rare scripts said:
    
    if (!getInventory().contains("Kebab")) {
    	if (getBank().isOpen()) {
    		getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE);
    			if (getBank().contains("Kebab")) {
    				getBank().withdrawAll("Kebab");
    					if (getBank().close()) {
    						Sleep.sleepUntil(() -> !getBank().isOpen(), 9000);
    					}
    			}
    		} else {
    			if (getBank().open()) {
    				Sleep.sleepUntil(() -> getBank().isOpen(), 9000);
    			}
    		}
    		} else {
    			NPC n = npcs.closest("Grand Exchange Clerk");
    				if (n != null) {
    					if (n.interact("Exchange")) {
    						Sleep.sleepUntil(() -> getGrandExchange().isOpen(), 9000);
    					}
    			}
    	}

    I'm sorry if its messy, dont got a IDE here to make it look clean 😛 CTRL + SHIFT + F on eclipse would clean this for u.

    U can wrap around another boolean for if the grand exchange is open on this :)

     

    
     Sleep.sleepUntil(() -> (geClerk.interact("Exchange")), 5000);

    Here u do a interact in a sleep, i dont think that is possible (or would be accepted as a good way of making scripts)

    Best of luck buddy! :)

    -Rare.

    I did something sort of like this, and that worked and i finally figured out how to work the GE too, so my script is fully working right now. Dont know if i should release it or whatever, its still lacking stuff that could be improved, but it works. Buys kebabs untill out of cash in inventory then sells it on the GE

    This is what i ended up doing. Else-ifs were causing some errors, due to later statements would be executed out of order

    if (!getBank().isOpen()) {
        getBank().open();
        if(!getInventory().isEmpty()) getBank().depositAll();
        getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE);
    }
    if (getBank().contains("Kebab")) {
        getBank().withdrawAll("Kebab");
        Sleep.sleepUntil(() -> !getBank().contains("Kebab"),5000);
    }
    if(getInventory().contains("Kebab")){
            getBank().close();
    }
    
    instasell("Kebab");

     

     

    private void instasell(String item){
        NPC geClerk = npcs.closest("Grand Exchange Clerk");
    
        if (getInventory().contains(item) && geClerk != null && geClerk.interact("Exchange")) {
            Sleep.sleepUntil(() -> (getGrandExchange().isOpen()), 5000);
        }
    
        if (getInventory().contains(item) && getGrandExchange().isOpen()){
            Sleep.sleepUntil(() -> getInventory().getItem(item).interact("Offer"), 5000);
     .....
    • Like 1
  3. 33 minutes ago, BravoTaco said:

    You need to check if the kebabs are in your inventory before opening the exchange i believe what is happening is that if the bank is not open than you open the bank and than run the next code that would be opening the exchange. So it closes out of the bank before grabbing the kebabs. So something like this.

    If(getInventory().contains("kebabs") && geClerk != null && geClerk.interact("Exchange"))

    Take note of the order of which you are checking as well. If the check for null and the check for the ininteraction is before the kebabs it will still exit the bank and try to interact with the clerk.

    Again sorry for the formating still only have access to my phone atm.

    ah of course, i'm a bit new to "async" programming like this botting API stuff, so i appreciate the help :). It does withdraw the kebabs without the GE code, which is why i was confused

  4. I tried doing this

    if (!getBank().isOpen()) {
        getBank().open();
        getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE);
    } else if (getBank().contains("Kebab")) {
        getBank().withdrawAll("Kebab");
        Sleep.sleepUntil(() -> !getBank().contains("Kebab"),5000);
    } else if(getInventory().contains("Kebab")){
            getBank().close();
    }
    
    
    NPC geClerk = npcs.closest("Grand Exchange Clerk");
    
    
    if (geClerk != null && geClerk.interact("Exchange")) {
        Sleep.sleepUntil(() -> (getGrandExchange().isOpen()), 5000);
    } else if (getGrandExchange().isOpen()){
        getGrandExchange().sellItem(1971, 1, (int) getInventory().getAmount("Kebab"));
        Sleep.sleepUntil(this::canCollect, 5000);
    }
    

    But it still skips over the withdrawal of the kebabs from the bank. It seems to skip over the 

    Sleep.sleepUntil(() -> !getBank().contains("Kebab"),5000);

    statement

  5. Hello, im quite new to writing these scripts, and just been messing with it this evening.

    I quickly stumbled into a problem when trying to script selling an item to the grand exchange, and i could not find any example on how to do this, so i experimented.

     

    My issue is, that an item does not get withdrawn from the bank properly, because of lack of sleeps or whatever, im not completely sure. 

     

    if (!getBank().isOpen()) {
                getBank().open();
                getBank().enableMode(Bank.BankMode.WITHDRAW_NOTE);
            } else if (getBank().contains("Kebab")) {
                Sleep.sleepUntil(() -> (getBank().withdrawAll("Kebab")), 5000);
                getBank().close();
            }
    
    
            NPC geClerk = npcs.closest("Grand Exchange Clerk");
    
            if (geClerk != null) {
                Sleep.sleepUntil(() -> (geClerk.interact("Exchange")), 5000);
            }

     

    If i have the code above, the kebabs will not be withdrawn when i have the geClerk interact line. Without it, it gets withdrawn fine, but with that line, it skips over the withdrawal and instantly opens the GE window instead. 

     

    Hope i explained my issue well enough, and someone can give a helping hand.

    (if anyone has a code snippet that just grabs whatever item in a Note and lists it on GE for insta-sell price then that would be perfect too)

     

  6. 3 hours ago, Darren said:

    Please refrain from any explicit chat; this is not a dating website. Thankyou.

    u sure about that, it should be one. imagine the answer when people ask how people met.

  7. 2 hours ago, guer said:

    What the fuck.

    OP is scamming people, and you congratulate him? This community is dead, OP is admitting to stealing people money, and yet he isnt banned.

    Wake up people. Unless you are under 16, get your shit straight. Stealing is pure evil and should not be allowed.

     

     

    we are not exactly on a forum that follows the rules, but i do agree that its a scummy thing. 

×
×
  • Create New...