Jump to content

Override client settings for random/user input handling


Recommended Posts

Posted

It's because I'm using a mouse listener to to add user input to the event queue so that they will not interrupt the script logic.

 

I wish you wouldn't assume the worst about my intentions, especially considering I typically make scripts for my own personal use.

I would like to see an answer to this as well. The bots over obfuscation really limits script flexibility for fully automated farms. 

Posted (edited)

I don't see any reason why it's hindering you.

 

Break handler in the way? Make your own

Login Handler override? It's possible

Dismiss randoms? Enable it once, quit client, restart and it's on until the next time you disable it, or write your own

Capture user input? Paint a canvas sized element that is transparrent and captures clicks

...

 

 

 

Edited by Abuse
  • Like 1
Posted (edited)

From what I understand you want to capture if a user clicks somewhere, and add it to the event queue to the bot will execute that sometime in the future. Capturing the user input is actually easier than you'd think:

private BotMouseListener listener = new BotMouseListener() {
    // Required funcs
    @ Override
    public void mouseReleased(MouseEvent e) {}
    @ Override
    public void mousePressed(MouseEvent e) {}
    @ Override
    public void mouseExited(MouseEvent e) {}
    @ Override
    public void mouseEntered(MouseEvent e) {}
    @ Override
    public void mouseClicked(MouseEvent e) {
        if (e.getPoint().equals(getMouse().getPosition()))
            return; // The bot generated this click, ignore it
        
        if (getClient().isHumanInputEnabled())
           return; // Ignore incase they have human input enabled
        
        // Queue human interaction or w/e
    }
}
 
// Then add these lines to script startup
getBot().getCanvas().addMouseListener(listener);

// Then add these lines to script stop
getBot().getCanvas().removeMouseListener(listener);
 

From here you can make a queue that your script can process when it is ready.

 

Edit: Also in the future, its usually easier to explain your end-game (in this case queuing user actions to be performed by the bot). Tends to get more possible solutions quicker.

Edit2: OSBot don't like my "@ Override" (references some banned dude lol), so had to add spaces. Heres a pastebin: http://pastebin.com/kVzsuAba

Edited by Lemons

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...