Jump to content

close bank whilst moving toward inventory.position[i]


Goaks

Recommended Posts

I have the code fully set up to:

 

  • move mouse to invent spot
  • then close bank using Esc key.
     

However, I want to move the mouse to position whilst pressing Esc key. Im under the belief that threads is the way to go with this, start a thread which moves the mouse and the next line will close the bank. However, Im having trouble implementing:

 

all this is in the same class:

static Thread moveMouse;	
@Override
	public void run() {
		getMouse().move(getInventory().getMouseDestination(0), false);	
	}
//other code above here				
else if (inventory.getAmount("item") == 14){
	bank.depositAll("item");
        bank.withdrawAll("item 2");
	moveMouse = new Thread(new scriptName());
	moveMouse.start();
	getKeyboard().typeKey((char) 27);
}

any help appreciated.

Link to comment
Share on other sites

As far as I know scripts are single threaded meaning either you make a thread yourself or just deal with it doing a single task at a time. But why are you doing this?

 

ahh fair enough, ill keep looking. 

And just to remove the bot like actions. As a person, Id close the bank whilst moving my mouse to the destination. With bots, it appears that it's one action at a time. Such that:

 

  • move mouse to inv spot
  • close bank with esc key

when a real human would move mouse while pressing esc key

Link to comment
Share on other sites

I have things very similar to this in my Hotkey API

 

What I'd do is:

1. Create a MoveMouseEvent or ClickMouseEvent

2. Set the event to run asynchronously (setAsync)

3. Get the distance to the destination

4. Execute the event

5. ConditionalSleep until event finished or remaining mouse distance is less than 30-50% of original distance

6. Hit the hotkey

7. Wait until event finishes (if not already finished)

Link to comment
Share on other sites

ahh fair enough, ill keep looking. 

And just to remove the bot like actions. As a person, Id close the bank whilst moving my mouse to the destination. With bots, it appears that it's one action at a time. Such that:

 

  • move mouse to inv spot
  • close bank with esc key

when a real human would move mouse while pressing esc key

 

How would you know that every human that plays will move their mouse while pressing the ESC key? 

Link to comment
Share on other sites

How would you know that every human that plays will move their mouse while pressing the ESC key? 

 

It is an assumption I made. It is a personal script, thus resulting in 100% of the people using it will move whilst pressing the 'Esc' key.

It also makes far more sense in my head to do it this way to reduce botlike actions.

Edited by Goaks
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   0 members

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