SRL Archive - Research & Development Lounge

ShowMousePosition - procedure


mrpickle

2009-05-07 07:11:35

A simple little program to display your current mouse location in the Debug box. Scar already detects this kinda stuff, and can store it itself. But maybe this can be used for fixing errors in scripts, such as screen shots of SMART autoer when they get stuck somewhere, and mouse position can be seen to aid debugging.

Well, if it's not useful, it's fun to have =D.


// ////////////
// Delay: is how long to wait (in milliseconds) before it returns to you
// another value of your mouse position
// ////////////
// Counter: is how many times you want it to run before it stops.
// ////////////
procedure ShowMousePosition(delay:integer; counter:integer);// By mrpickle
var x,y,count: integer;
begin
repeat
wait(delay);
getmousepos(x,y);
writeln (inttostr(x) + ' , ' + inttostr(y));
count := count +1
until (count = counter)
end;

begin
ShowMousePosition(250,10)
end.

There's much room for more, but I'll wait till I learn more first =).

senrath

2009-05-07 07:15:18

The lines x := x and y := y are completely pointless. All they're doing is setting x and y equal to themselves.

mrpickle

2009-05-07 07:16:16

ah, that's right. deleted that.

Da 0wner

2009-05-07 07:16:40

GetMousePos stores the pos into those variables anyway.

mrpickle

2009-05-07 07:19:45

That stores it, this shows it…

Da 0wner

2009-05-07 07:21:11

By the way
program New;
var
x, xx,y, yy : integer;
begin
repeat
GetMousePos(x, y);
Disguise(IntToStr(x) + ', ' + IntToStr(y));
if GetDebugLine(GetDebugLineCount - 1) = IntToStr(x) + ', ' + IntToStr(y) then
Continue;
Writeln(IntToStr(x) + ', ' + IntToStr(y));
until(IsFKeyDown(5));
end.

And also, I know I said that because you had x := x and y := y but it stores it.
I didn't see the script when you had that though, just saw the comment.

mrpickle

2009-05-12 06:27:13

sorry for late late reply. but urs look and works better xD.

lots major tests and projects lately. not too much time.