SRL Archive - SRL Suggestions

SlideMouse


Abu

2012-04-24 02:32:28

(*
SlideMouse
~~~~~

.. code-block:: pascal

procedure SlideMouse(cx, cy, rx, ry: Integer);

Moves the mouse 'cx' across the x axis and 'cy' along the y axis
with a randomness of rx and ry

.. note::

by abu_jwka

Example:

.. code-block:: pascal

if IsUptext('ord') then
begin
Mouse(x, y, 0, 0, false);
SlideMouse(0, 10, 0, 0,);
ChooseOption('aw all');
end'

*)

procedure SlideMouse(cx, cy, rx, ry: Integer);
var
x, y: Integer;
begin
GetMousePos(x, y);
MMouse(x + cx, y + cy, rx, ry);
end;
Advantages? It moves along the x and y axis rather than to a specific co-ordinate.

So if two items/objects are a fixed distance from each other but not necessarily always in the same place, then SlideMouse will stop you from having to try and find the second item or object.

Go this idea mainly from here: http://villavu.com/forum/showthread.php?t=80679

Imanoobbot

2012-04-24 02:35:17

Seems to be a useful MouseFunction. Will try this later =)

xtrapsp

2012-04-24 02:49:10

I can see the benefit, but i dont know if i get this correctly. So theoretically it makes a virtual line to slide between, but instead of being exact it has + cx and +cy which is pixel ofset?

I like this idea but how would it find items quicker?

Imanoobbot

2012-04-24 02:50:17

From: xtrapsp
I can see the benefit, but i dont know if i get this correctly. So theoretically it makes a virtual line to slide between, but instead of being exact it has + cx and +cy which is pixel ofset?

I like this idea but how would it find items quicker?


I thought it would be more humanlike.

Because if you look how you are moving you mouse to an object you wont do a straight line you are always going more into x or y then moving to the object. Thought the function would be a bit like that.

Abu

2012-04-24 02:55:31

From: xtrapsp
I can see the benefit, but i dont know if i get this correctly. So theoretically it makes a virtual line to slide between, but instead of being exact it has + cx and +cy which is pixel ofset?

I like this idea but how would it find items quicker?


No.
cx = amount of pixels to move across
cy = amount of pixels to move up/down

So say I put SlideMouse(10, 50, 0, 0); it will move the mouse 10 pixels across and 50 pixels down.

Also for uses, objects such as ores are fixed distances apart. So instead of having to search for the next ore, I could simply find the first ore and then SlideMouse to where the next ore is and check the uptext.

xtrapsp

2012-04-24 03:56:01

But if thats the case it would have to not have the camera angle change?

Gala

2012-04-24 03:59:56

Camera angle? I think for inventory uses this doesnt matter.

xtrapsp

2012-04-24 04:05:12

From: Gala
Camera angle? I think for inventory uses this doesnt matter.


Now it makes sense :p i was thinking MSX & MSY

Abu

2012-04-24 11:35:13

Yeh I mainly only made this function really quickly because a user had a problem with the Withdraw function and I've also had problems with it in the past.

Also, Gala just gave me a good idea, this could be used for uber-fast dropping no?

Gala

2012-04-24 12:56:44

As long as you keep it human like, why not?

Abu

2012-04-24 13:22:58

From: Gala
As long as you keep it human like, why not?


And that's why you can add randomness ;)

Gala

2012-04-24 13:31:38

Randomness isnt all of it. You cant ultra speed drop for hours while powermining. Wouldnt it work with absolute coordinates instead if relativ ones?

Abu

2012-04-24 13:37:02

From: Gala
Wouldnt it work with absolute coordinates instead if relativ ones?


Meaning?

Runaway

2012-04-24 14:41:46


GetMousePos(x, y);
MMouse(x+10, y+10, 0, 0);

//Same thing as:

SlideMouse(10, 10, 0, 0);

//?

EDIT: Whoops, that's what I get for not looking at your code first >.<

I guess I was just trying to say, what's the point of it if it only saves you 1 line? :S

Abu

2012-04-24 14:46:49

From: Runaway

GetMousePos(x, y);
MMouse(x+10, y+10, 0, 0);

//Same thing as:

SlideMouse(10, 10, 0, 0);

//?


No. That would move the Mouse to the co-ordinates (10, 10).

By doing (x+10, y+10), the mouse moves 10 pixels along the x axis and 10 pixel's up/down the y axis from it's current position.


EDIT:
I guess I was just trying to say, what's the point of it if it only saves you 1 line? :S


Well you could say that for a lot of 'Ex' functions.

Runaway

2012-04-24 14:53:46

From: abu_jwka
No. That would move the Mouse to the co-ordinates (10, 10).


You've officially confused me now, as neither of these functions:

From: Runaway

GetMousePos(x, y);
MMouse(x+10, y+10, 0, 0);

SlideMouse(10, 10, 0, 0);


Would move to (10,10)…

Abu

2012-04-24 14:55:16

AAARAGGHH, you've confused me too :(

Just know this:
In this function, the mouse moves 10 pixels along the x axis and 10 pixel's up/down the y axis from it's current position.

Kyle Undefined

2012-04-24 14:57:02

From: abu_jwka
No. That would move the Mouse to the co-ordinates (10, 10).

By doing (x+10, y+10), the mouse moves 10 pixels along the x axis and 10 pixel's up/down the y axis from it's current position.


EDIT:


Well you could say that for a lot of 'Ex' functions.


The ways that Runaway posted are exactly the same :p You're saying no to his question when yours does the same thing.

Abu

2012-04-24 15:00:57

Ok me be legitimately confused :confused:

By saying this:

GetMousePos(x, y);
MMouse(x+10, y+10, 0, 0);

//Same thing as:

SlideMouse(10, 10, 0, 0);

//?

You see I have no idea what exactly you are trying to say here.

EDIT: Yes it would be :duh:

I'm so 'tupid :p


EDIT2: The reason I was confused was because I thought you were saying it was the same as MMouse(10, 10, 0, 0), which would explain my little description.

Daniel

2012-05-02 02:20:31

I really cannot see a point in this.

Why not just find all the possible ore locations on screen (FindColorsSpiral), then mouse over each to verify if they're an ore or not? If it is, then mine, if not, move to the next. The positions of a colour found are not stored relative to the first found point, you know? :S

Abu

2012-05-02 02:22:38

From: Daniel
I really cannot see a point in this.

Why not just find all the possible ore locations on screen (FindColorsSpiral), then mouse over each to verify if they're an ore or not? If it is, then mine, if not, move to the next. The positions of a colour found are not stored relative to the first found point, you know? :S


The ore was just a really quick and weak example.

Tbh, I made it for one purpose - it is faster than ChooseOption.