Jump to content

Khal Utilities


Khaleesi

Recommended Posts

On 9/13/2023 at 1:20 PM, Khaleesi said:

I can take a look at it

Thanks!

For the Home Teleport, it would be useful to do a 30 second countdown when the webwalker gets stuck, then activate the Home Teleport.

This allows you to escape from rooftops, Ferox Enclave, minigames, etc.

Edited by dotherobot
Link to comment
Share on other sites

  • 2 weeks later...
5 hours ago, Khaleesi said:

No, shouldn't that be some script logic in whatever you are running?

What were to happen if I were to run this script, telling it to equip agility set, then do something else afterwards, on an account without the agility set. Will it move on to the next action or will it stop the script?
Just because I have a lot of accounts and I get them mixed up sometimes, it would be nice just to put them all together without having to identify which one is which.

Edited by mariokiller64
Link to comment
Share on other sites

6 hours ago, mariokiller64 said:

What were to happen if I were to run this script, telling it to equip agility set, then do something else afterwards, on an account without the agility set. Will it move on to the next action or will it stop the script?
Just because I have a lot of accounts and I get them mixed up sometimes, it would be nice just to put them all together without having to identify which one is which.

There is an option you can turn on/off at every items to skip the item if you don't have them :)
ZWLBPt6.png

Edited by Khaleesi
  • Like 1
Link to comment
Share on other sites

Any option to just clear the GE? Like an option just to open GE and clear out any buy and sell offers?

I got AI to make me a quick script to do this for me but if your script has all of this, I'd rather just use yours. Something like this, kind of can't believe AI wrote this for me though 😂

	// A custom method that opens the grand exchange and clears any pending offers
	public void clearGrandExchange() throws InterruptedException {
		// Check if the grand exchange is not open
		if (!getGrandExchange().isOpen()) {
			// Check if the player is in the grand exchange area
			if (GRAND_EXCHANGE.contains(myPlayer())) {
				// Find the nearest grand exchange clerk using the OSbot API method getNpcs()
				NPC clerk = getNpcs().closest("Grand Exchange Clerk");
				// Check if the clerk is not null
				if (clerk != null) {
					// Right click the clerk and hit exchange using the OSbot API method interact()
					clerk.interact("Exchange");
					// Add a sleep to control the script's speed
					sleep(random(min, max));
				}
			} else {
				// Walk to the grand exchange area using the OSbot API method getWalking()
				getWalking().webWalk(GRAND_EXCHANGE);
				// Add a sleep to control the script's speed
				new ConditionalSleep(random(2000, 4000)) {
					@Override
					public boolean condition() throws InterruptedException {
						return !myPlayer().isMoving();
					}
				}.sleep();
			}
		}
		// Check if the grand exchange is open
		if (getGrandExchange().isOpen()) {
			// Abort all offers using your custom method
			abortOffers();
			sleep(random(min, max));
			// Declare a boolean variable to store the result of the check
			boolean ExchangeCleared = true;
			// Loop through all the grand exchange boxes using the OSbot API enum
			// GrandExchange.Box
			for (GrandExchange.Box box : GrandExchange.Box.values()) {
				// Get the status of the current box using the OSbot API method
				// getGrandExchange().getStatus()
				GrandExchange.Status status = getGrandExchange().getStatus(box);
				// Check if the status is not empty
				if (status != GrandExchange.Status.EMPTY) {
					// Set the variable to false
					ExchangeCleared = false;
				}
			}
			// Check if all the boxes are empty before closing the grand exchange
			if (ExchangeCleared) {
				// Close the grand exchange using the OSbot API method getGrandExchange()
				getGrandExchange().close();
				sleep(random(min, max));
				// Log the action
				log("Closed the grand exchange");
			} else {
				// Log a message that there are still pending offers
				log("There are still pending offers in the grand exchange");
			}

		}
	}
	
	// A custom method that aborts all offers in the grand exchange
	private void abortOffers() throws InterruptedException {
		// Loop through all the grand exchange boxes using the OSbot API enum
		// GrandExchange.Box
		for (GrandExchange.Box box : GrandExchange.Box.values()) {
			// Get the status of the current box using the OSbot API method
			// getGrandExchange().getStatus()
			GrandExchange.Status status = getGrandExchange().getStatus(box);
			// Check if the status is not empty
			if (status != GrandExchange.Status.EMPTY) {
				// Get the list of widgets containing "Abort offer" as an action using the OSbot
				// API method getWidgets()
				List<RS2Widget> widgets = getWidgets().containingActions(465, "Abort offer");
				// Loop through all the widgets in the list
				for (RS2Widget widget : widgets) {
					// Interact with each widget using "Abort offer" as the action
					widget.interact("Abort offer");
					// Log the attempt to abort each offer
					log("Attempted to abort an offer in box " + box);
					// Add a sleep to control the script's speed
					sleep(random(min, max));
				}
			} else {
				ExchangeCleared = true;
			}
			// Check if there is anything to collect in the box using the OSbot API method
			// getGrandExchange().getAmountToTransfer()
			if (getGrandExchange().getAmountToTransfer(box) > 0) {
				// Collect from the box using the OSbot API method getGrandExchange().collect()
				getGrandExchange().collect();
				// Log the attempt to collect from each box
				log("Attempted to collect from box " + box);
				// Add a sleep to control the script's speed
				sleep(random(1250, 1750));
			}
		}
	}

 

Edited by mariokiller64
Link to comment
Share on other sites

9 hours ago, mariokiller64 said:

Any option to just clear the GE? Like an option just to open GE and clear out any buy and sell offers?

I got AI to make me a quick script to do this for me but if your script has all of this, I'd rather just use yours. Something like this, kind of can't believe AI wrote this for me though 😂

	// A custom method that opens the grand exchange and clears any pending offers
	public void clearGrandExchange() throws InterruptedException {
		// Check if the grand exchange is not open
		if (!getGrandExchange().isOpen()) {
			// Check if the player is in the grand exchange area
			if (GRAND_EXCHANGE.contains(myPlayer())) {
				// Find the nearest grand exchange clerk using the OSbot API method getNpcs()
				NPC clerk = getNpcs().closest("Grand Exchange Clerk");
				// Check if the clerk is not null
				if (clerk != null) {
					// Right click the clerk and hit exchange using the OSbot API method interact()
					clerk.interact("Exchange");
					// Add a sleep to control the script's speed
					sleep(random(min, max));
				}
			} else {
				// Walk to the grand exchange area using the OSbot API method getWalking()
				getWalking().webWalk(GRAND_EXCHANGE);
				// Add a sleep to control the script's speed
				new ConditionalSleep(random(2000, 4000)) {
					@Override
					public boolean condition() throws InterruptedException {
						return !myPlayer().isMoving();
					}
				}.sleep();
			}
		}
		// Check if the grand exchange is open
		if (getGrandExchange().isOpen()) {
			// Abort all offers using your custom method
			abortOffers();
			sleep(random(min, max));
			// Declare a boolean variable to store the result of the check
			boolean ExchangeCleared = true;
			// Loop through all the grand exchange boxes using the OSbot API enum
			// GrandExchange.Box
			for (GrandExchange.Box box : GrandExchange.Box.values()) {
				// Get the status of the current box using the OSbot API method
				// getGrandExchange().getStatus()
				GrandExchange.Status status = getGrandExchange().getStatus(box);
				// Check if the status is not empty
				if (status != GrandExchange.Status.EMPTY) {
					// Set the variable to false
					ExchangeCleared = false;
				}
			}
			// Check if all the boxes are empty before closing the grand exchange
			if (ExchangeCleared) {
				// Close the grand exchange using the OSbot API method getGrandExchange()
				getGrandExchange().close();
				sleep(random(min, max));
				// Log the action
				log("Closed the grand exchange");
			} else {
				// Log a message that there are still pending offers
				log("There are still pending offers in the grand exchange");
			}

		}
	}
	
	// A custom method that aborts all offers in the grand exchange
	private void abortOffers() throws InterruptedException {
		// Loop through all the grand exchange boxes using the OSbot API enum
		// GrandExchange.Box
		for (GrandExchange.Box box : GrandExchange.Box.values()) {
			// Get the status of the current box using the OSbot API method
			// getGrandExchange().getStatus()
			GrandExchange.Status status = getGrandExchange().getStatus(box);
			// Check if the status is not empty
			if (status != GrandExchange.Status.EMPTY) {
				// Get the list of widgets containing "Abort offer" as an action using the OSbot
				// API method getWidgets()
				List<RS2Widget> widgets = getWidgets().containingActions(465, "Abort offer");
				// Loop through all the widgets in the list
				for (RS2Widget widget : widgets) {
					// Interact with each widget using "Abort offer" as the action
					widget.interact("Abort offer");
					// Log the attempt to abort each offer
					log("Attempted to abort an offer in box " + box);
					// Add a sleep to control the script's speed
					sleep(random(min, max));
				}
			} else {
				ExchangeCleared = true;
			}
			// Check if there is anything to collect in the box using the OSbot API method
			// getGrandExchange().getAmountToTransfer()
			if (getGrandExchange().getAmountToTransfer(box) > 0) {
				// Collect from the box using the OSbot API method getGrandExchange().collect()
				getGrandExchange().collect();
				// Log the attempt to collect from each box
				log("Attempted to collect from box " + box);
				// Add a sleep to control the script's speed
				sleep(random(1250, 1750));
			}
		}
	}

 

That AI needs some improvements , but ya I can take a look to add something like that! :)

  • Like 1
Link to comment
Share on other sites

3 minutes ago, Khaleesi said:

That AI needs some improvements , but ya I can take a look to add something like that! :)

Oh yeah, for sure, but it was just bing chat unfortunately. I'm still surprised something like that wrote something like this though, not even an actual developer AI, just some chat box for searches 😂 The script is definitely a little messy, but it works

  • Like 1
Link to comment
Share on other sites

5 hours ago, mariokiller64 said:

The mule isn't checking the bank for some reason, I have check bank items checked for the bot, there isn't a check bank for the mule that I see anywhere though, so he just keeps trading my bots without getting anything from his bank to give to them.

The mule isn't really designed to check the bank tbh. Have the items in your inventory :)
The last thing you want it walking around with your mule and getting yourself killed/delay trades or whatever 😉

Edited by Khaleesi
  • Like 1
Link to comment
Share on other sites

On 4/25/2023 at 5:23 PM, botimusprime said:

ill do this for now but it would be good to be able to specify items like starts with "ring of dueling(" not too important for ring of dueling as they are cheap but other items really need it (ring of wealth ect).

Could use this in the script too, would like my players to use teleports of any charge to go anywhere. Mainly want to use ring of wealth of any charge to go to GE.

I was actually hoping I could add all the charges to the list and it would just end up with one of them equipped but he kept repeating the equips. What I would like to do is have priority equips or just not equip after he already equipped it and move on to the next equip in the list.
Because if I have an account with a graceful set, but a few of them have the Smithing cape, I would have to change the inventory, when instead I could just have it on the list as
Graceful Cape
Smithing Cape
An easy fix, Equip graceful cape, move on, equip smithing cape, move on and don't try to equip graceful cape again. as it would.
A more complicated fix would be 
If this item is in bank, don't withdraw that item.
But yeah, would also fix the whole charge thing but then they'd be equipping like 5 different ring of dueling or something in one equip sequence lol

Could have Priority lists in the equipment setup tab along with specific slot equipping, like if Priority 1 doesn't have this item in the bank for the cape slot, go to priority 2 cape slot, if it does, skip the rest of the priority lists for that slot. Would be a bit more advanced but would be super modular and would work for any charges of equipment.
Like this or something, if item 1 exist, skip rest of items
Bc1fgVS.png

Also was in rogue's den and I told it to walk to closest bank and it completely walked right past the bank in there to go to Falador lol
 

Edited by mariokiller64
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   1 member

×
×
  • Create New...