SRL Archive - Help

How to: "No click zone"?


Taylor

2012-10-10 12:24:12

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

2012-10-10 12:29:56

What Kind of area are you talking. Yeah It's easily done.

Taylor

2012-10-10 12:33:29

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

2012-10-10 12:44:50

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

2012-10-10 12:47:25

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

2012-10-10 13:27:29

From: Kyle Undefined
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.