Log in

View Full Version : How to: "No click zone"?



Taylor
10-10-2012, 04:24 PM
Is it possible to create a sort of "no click zone", where when active the script can't click in this certain area?

I know the script should only be doing what I tell it, but I'm having some some issues with lag and I've determined this to be the best solution.

I want an area to be completely off limits to the script, how would I do this?

BraK
10-10-2012, 04:29 PM
What Kind of area are you talking. Yeah It's easily done.

Taylor
10-10-2012, 04:33 PM
Well, specifically I wouldn't want any clicks being sent anywhere but the inventory/menu tabs, avoiding the minimap and game screen(as not to walk anywhere)

I would tell it to check whether the coords it's going to click are there, but because of what I'm trying to avoid(lag) I'm afraid this wont work.

I was hoping there is some sort of hard coded way to do it, so that even during a spike of lag, the script *can't* actually click there, even if it sent the click there.

Edit: In theory, I want to do this:

The script sends a click to 100,100 - this area is off limits and because of this, the click does nothing. 100,200 is not off limits and sending a click there will work fine

Kyle Undefined
10-10-2012, 04:44 PM
You could use the PointInBox method to check the area before clicking. I'd make a custom mouse wrapper for this, would make it easier and you could call it throughout your script without having to repeat code all over the place.

litoris
10-10-2012, 04:47 PM
Before every click procedure, add "if not PointInBox(...) then Exit;"
Put the coordinates for the area you want clicked there(the inventory etc basically) and the mouse coords and you are set

Runaway
10-10-2012, 05:27 PM
You could use the PointInBox method to check the area before clicking. I'd make a custom mouse wrapper for this, would make it easier and you could call it throughout your script without having to repeat code all over the place.

^ That. Definitely the most efficient method. You can also make the wrapper a function to let you know whether it was in bounds or not.