SRL Archive - Outdated Tutorials

[#34/35] MouseMM


mixster

2009-06-22 19:46:03

Found in MapWalk.scar, it rotates co-ordinates taken when facing North so that they click in the same position on the minimap regardless of which direction you're currently facing, with set randomness.

procedure MouseMM(x, y, randX, randY: Integer);
x and y are the desired co-ordinates to click while randX and randY are values that add to randomness. The x and y are rotated then passed to Mouse along with randX and randY and as it is the minimap, it will always left click. It also includes a check to ensure it is a valid point for the minimap.

Should be used primarily as a walking failsafe, but can also be used in other areas, such as finding a minimap symbol, rotating the map so you face a different direction (for some reason that makes perfect sense) then using MouseMM to ensure you still click on the symbol.

An example:

if (not RadialWalk()) then
if (not FindDTM()) then
begin
MouseMM(560, 15, 3, 3);
if (FindSymbol()) then
Writeln('All other walking failed, but blind faith has saved us!')
else
Writeln('I knew we should''ve taken that last left...');
end;

As a failsafe, it should be used after all other method of walking have failed. In this example, if the radial walk and DTM fail, it uses MouseMM to click a spot and then checks afterwards to see if it managed to get to the right place (in this case, FindSymbol would be the check, so if it found the bank symbol then it succeeded in getting you to the bank).

Overall, it should be rarely used but a nice backup that doesn't require setting direction to North to ensure it works, so can just be slotted in as a one liner.

Sir R. M8gic1an

2009-06-22 19:48:56

I asked mixster to do this tut, as it was his function :) GJ.

~RM

ZephyrsFury

2009-06-22 19:50:06

I was gonna say…. WHAT PART OF DEVS ONLY DON'T YOU UNDERSTAND.

Still <3 you though mixster. :p

ShowerThoughts

2009-06-22 22:39:15

Isn't there already a BlindClick in SRL?

Naike

2009-06-23 00:53:07

Hermen hermen hermen, this is not the same as blindclick…

Quickmarch

2009-06-23 01:16:01

From: N1ke!
Hermen hermen hermen, this is not the same as blindclick…


It is it's just shortened…

ZephyrsFury

2009-06-23 06:45:20

This gets the compass angle and rotates your points so its not like blind clicking.

Blender

2009-06-23 07:05:20

Grr…

I was just making a function that returns an array of points, only rotated by a user provided degree angle.

Grr…