Jump to content

Herb Cleaning


Recommended Posts

Posted

@

Fuck off it's not terrible, Don't just try to post shit when you don't even understand.

No other methods to check items quantity else than that.

If you really feel confident in yourself then let's see what other methods you have.

 

bro it's not necessary to check item quantity. he just needs to make an inventoryslotdestination and click on it. part of learning is understanding new abilities and adapting to them and using them when necessary. in this case, it's more efficient to use an inventoryslotdestination bro.

 

also i fixed the issue on skype i think

Posted

@

Fuck off it's not terrible, Don't just try to post shit when you don't even understand.

No other methods to check items quantity else than that.

If you really feel confident in yourself then let's see what other methods you have.

Stupid ass arrogant grey name..

 

First of all, if he were to use that poor code of yours, it would only work so long as he has either 28, or over 28 grimy herbs in the bank. Which is stupid. On-top of that, it doesn't check whether or not the inventory is even empty.

 

Oh and I don't understand? Weird how I have a scripter rank and you don't. Pleb.

		if (bank.isOpen() && inventory.isEmpty()) {
			Item herby = bank.getItem("grimyHerb");

			if (bank.contains("grimyHerb")) {
				if (herby.getAmount() >= 28) {
					bank.withdraw("grimyHerb", 28);
				} else if (herby.getAmount() < 28 && herby.getAmount() > 0) {
					bank.withdraw("grimyHerb", herby.getAmount());
				} else {
					stop();
				}

				new ConditionalSleep(5000) {

					@[member=Override]
					public boolean condition() throws InterruptedException {
						return inventory.contains("grimyHerb");
					}
				}.sleep();
			}
		}
Posted (edited)
		if (bank.isOpen() && inventory.isEmpty()) {
			Item herby = bank.getItem("grimyHerb");

			if (bank.contains("grimyHerb")) {
				if (herby.getAmount() >= 28) {
					bank.withdraw("grimyHerb", 28);
				} else if (herby.getAmount() < 28 && herby.getAmount() > 0) {
					bank.withdraw("grimyHerb", herby.getAmount());
				} else {
					stop();
				}

				new ConditionalSleep(5000) {

					@[member='Override']
					public boolean condition() throws InterruptedException {
						return inventory.contains("grimyHerb");
					}
				}.sleep();
			}
		}

 

Alright, Thanks for that bro.

Btw I was just giving him suggestions!

Sorry for bothering!

Edited by Mr Pro Pop
Posted (edited)

 

Stupid ass arrogant grey name.. emote3.png

 

 

IMO that code has pointless checks and this code is cleaner.

Comments explain my thoughts on the get amount checks and why they aren't needed.

 

if (bank.isOpen() && inventory.isEmpty()) {
			
			// Note to newbies, if you had this check in the parent 'if' statement
			// And did 'else stop();' it would stop if the bank wasn't open or inventory wasn't empty.
			if(bank.contains("grimyHerb")) 
			{
				/* 
				 * Regardless of how many you have it will withdraw the most you can
				 * Therefore there is no need to check how many you have and withraw that many,
				 * Just withdraw all. If you have 21 it will withdraw 21 if you have 1 million
				 * It will withdraw as many as your inventory can fit.
				*/
				bank.withdrawAll("grimyHerb"); 
				
				new ConditionalSleep(5000) {

					@[member='Override']
					public boolean condition() throws InterruptedException {
						return inventory.contains("grimyHerb");
					}
				}.sleep();
			}
		}

also kek at this thread feels.png

Edited by venetox
Posted

 

IMO that code has pointless checks and this code is cleaner.

Comments explain my thoughts on the get amount checks and why they aren't needed.

 

if (bank.isOpen() && inventory.isEmpty()) {
			
			// Note to newbies, if you had this check in the parent 'if' statement
			// And did 'else stop();' it would stop if the bank wasn't open or inventory wasn't empty.
			if(bank.contains("grimyHerb")) 
			{
				/* 
				 * Regardless of how many you have it will withdraw the most you can
				 * Therefore there is no need to check how many you have and withraw that many,
				 * Just withdraw all. If you have 21 it will withdraw 21 if you have 1 million
				 * It will withdraw as many as your inventory can fit.
				*/
				bank.withdrawAll("grimyHerb"); 
				
				new ConditionalSleep(5000) {

					@[member='Override']
					public boolean condition() throws InterruptedException {
						return inventory.contains("grimyHerb");
					}
				}.sleep();
			}
		}

just because your version is more simplistic, it doesn't necessarily mean it's better. :doge:

the checks are also objective, you pronounce it tomato, i pronounce it tomatoe, etc

i'd rather not spam the player's game chat with "you do not have enough inventory space for that".

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...