PDA

View Full Version : [Tut] MouseBox(x1,y1,x2,y2,Click);



Harry
02-26-2008, 11:03 PM
~ How to use MouseBox ~

Hi, and thanks for visiting my first real tut :)
I today will teach you how to use the very useful MouseBox procedure.


First off, here is how to write it:

MouseBox(x1,y1,x2,y2, ClickType(1 = True click, 2 = False click, 3 = No click, integer);

The x1 and y1 varables can be gotten by clicking the color picking button, then clicking in the top left corner of an object. MAKE SURE THE COORDS YOU PICK ARE ACCURATE OR BAD THINGS CAN HAPPEN!
After you do that, look at the SCAR debug. It will say something like this:

Color Picked: 8388608 at (500, 262)

The numbers in the parenthesis [()] are the x1, and y1 coordinates. Plug them in in the MouseBox procedure in the x1 and y1 slot!
Repeat the above, only color pick the bottom right of the object. Then put them into the x2 and y2 variable slots. You now have your 'box' made!


Now you are almost ready to go!... One last thing though before you speed off ;):
Choose your ClickType.
If you want it to left click on the section, replace ClickType with 1.
If you want a right click, replace with a 2.
If you just want it to move the mouse to the box, then set to 3.

Note about click types:
- Left Mouse Button - The one you click on stuff a lot with, the one on the left hand side of the mouse :p On RuneScape it makes a red or white X on an object.
- Right Mouse Button - The one you click with for options to pop up, right hand side of the mouse. On RuneScape it makes an options menu pop up.


Why use MouseBox?
It is easier to set the parameters of the clicking then just Mouse(x,y,randx,randy,Click); because you set in the areas where you want.
MOUSEBOX SHOULD NOT REPLACE MOUSE(...);! It is just best used for when you are clicking on a small section on the screen that is constant (Like the Special Attack Button)
Do not try to make a script with pure MouseBoxes please. :)



Enjoy, thanks for reading my tut, good luck scripting! :)
~ Harry

Nose Smasher
02-26-2008, 11:11 PM
Sweet - good tut. So what exactly would this be used for? Is it like a DTM or somethin? Like if I wanted to click on a piece of food or somethin, this would work?

EDIT: First post ;)

Rikje
02-26-2008, 11:12 PM
Short but powerfull. :p


Hy71194 zegt:
Http://www.srl-forums.com/forum/tut-mousebox-x1-t29010.html Say I am leet
Hy71194 zegt:
Lol
- Rikje - Don't cry because it's over. Smile because it happened.' @ Lan Party zegt:
you're leet!
Hy71194 zegt:
On the thread, smart one


Dude you're leet!.

stampede10343
02-26-2008, 11:13 PM
thats pretty informal, MouseBox and Mouse is pretty much the same is you know how to use your randomness.

Harry
02-26-2008, 11:13 PM
If the food's location is always located in the same area. Just like coordinate clicking, but usually a LOT safer.
Sumilion uses MouseBox-es for doing Emotes in SRL. Look at it, he used them very well :)

@ Rickje: I know :redface:

@ stampede10343: I suppose, but it is a bit harder making the box exact using Mouse(...);.

Nose Smasher
02-27-2008, 06:44 AM
Oh ok - thats pretty kool.. Thankz!
Great job on tut! ;)

stampede10343
02-27-2008, 05:58 PM
yea Hy i knew that(I would use MouseBox over Mouse in that kind of situation) It Boggles The Mind!! lol

KoKouKo
03-23-2008, 05:42 PM
i dunno whats so good about this tut.... but i gave you rep for it -.- lol

im not saying its a bad tut.... dont flame me pl0x [/mildly off-topic]

whats the point of having it not click?

Main
01-26-2009, 05:28 AM
If i want to make it click an random place how do I do that?

ian.
01-26-2009, 05:36 AM
it does that by default..

it will click anywhere in the specified box..

Main
01-26-2009, 06:23 AM
please give show me a example script
You will be me super hero for 2009:D

noidea
01-26-2009, 06:37 AM
if FindColor(x, y, color, x1, y1, x2, y2)then
mousebox(x - 5, y - 5, x + 5, y + 5, 1);

Or mouseBox(566, 436, 556, 336, 3);

Main
01-26-2009, 06:50 AM
I want them as random value in the mainscreen/chat/inventory

when I put
MouseBox(MiX1, MiY1, MiX2, MiY2);

I get

Line 8439: [Error] (18673:33): Invalid number of parameters in script C:\Program Files\SCAR 3.15\Scripts\michael.scar

senrath
01-26-2009, 08:15 AM
I want them as random value in the mainscreen/chat/inventory

when I put
MouseBox(MiX1, MiY1, MiX2, MiY2);

I get

Line 8439: [Error] (18673:33): Invalid number of parameters in script C:\Program Files\SCAR 3.15\Scripts\michael.scar

You forgot to put 1, 2, or 3 after your Y2 coord to denote left, right, or no click.

Main
01-26-2009, 09:41 AM
MouseBox(MiX1, MiY1, MiX2, MiY2, 3);

?

senrath
01-26-2009, 10:00 AM
If you want it to just move, and not click, yes, that's what you'd use.

Main
01-26-2009, 10:12 AM
thanks

Baked0420
01-26-2009, 11:13 AM
nice tut Hy, and I've used MouseBox a few times, I thought I knew everything there was to know, I just checked this out to see how well you wrote it and it's nice, AND I actually learned something. I didn't know about 3 being no click, I just knew about 1 and 2, and I'm glad you made this tut we need one because I am so tired of seeing people do MouseBox(x1,y1,x2,y2) and totally leave out the click part (probably because when you type it in Scar, it comes up with that little box that tells you all the var's but click isn't in there just the coord var's). But good tut, rep+. and I think this should be a beginner tut, it is a very basic thing, at least it is to me anyway.



EDIT:


http://img144.imageshack.us/img144/5857/mouseboxps5.png



see it doesn't mention the click var, I think that is what messes most people up, it's so annoying to see people not use 1/2/3 (thanks again for telling me about the 3 :)).

ian.
01-26-2009, 11:34 AM
it does that because there's two MouseBox procs in srl.. one is outdated without the 1/2/3, but it doesn't show that because without the last param, it's lower alphabetically..

kinda stupid IMO that they don't change it.. but w/e :p