SRL Archive - Other Scripts

Average Ms Per Key Hold.


XxKanexX

2006-07-02 00:27:06

Records How long you hold each key down for and records an works out at the end.


//Type and it will record, To view the results press Control.

Const Display = True;

var a: String;

function HeldFor(c: Char): Integer;
var e: Integer;
begin
e:= GetSystemTime;
while (IsKeyDown(c)) do Wait(1);
Result:= (GetSystemTime-e);
end;

procedure WaitForKeys;
var i, c, g: Integer;
begin
repeat
for i:= 1 to Length(a) do
begin
if (not(IsKeyDown(StrGet(a, i)))) then c:= c + 1;
end;
if (c >= Length(a)) then Exit;
g:= g + 1;
until(g >= 5);
end;


var i, t: Integer;
var Ct: array of Integer;
var s: string;
begin
a:= 'abcdefghijklmnopqrstuvwxyz ';
SetarrayLength(Ct, 1);
WaitForKeys;
ClearDebug;
repeat
for i:= 1 to Length(a) do
begin
if (IsKeyDown(strget(a, i))) then
begin
Ct[GetarrayLength(Ct)-1]:= HeldFor(Strget(a, i));
if (Display) then Writeln('Held ' + Strget(a, i) + ' For ' + Inttostr(Ct[GetarrayLength(Ct)-1]) + ' Ms.');
SetarrayLength(Ct, GetarrayLength(Ct) + 1);
Status('Last Pressed ' + Strget(a, i));
s:= s + Strget(a, i);
end;
end;
until(IsFunctionKeyDown(1));
for i:= 0 to GetarrayLength(Ct)-1 do
begin
t:= t + Ct[i];
end;
if (Display) then Writeln(' ');
Writeln('Typed ' + s);
Writeln('Average Key Hold ' + Inttostr(t/GetarrayLength(Ct)-1) + ' Ms p/Key.');
end.

Cheesehunk

2006-07-02 00:34:48

You make the most useless, cool, awesome scripts.:)

Don't stop.. Ever!
Edit: What is FunctionKey(1)?:o

XxKanexX

2006-07-02 01:28:23

Function Key 1's Control, lol ;)

Freddy1990

2006-07-02 04:17:23

omg, wonderfull, i'm going to use this every day :eek: :p

Sjoe

2006-07-02 06:22:22

yeah right, who would use this every day :p

But this will come in handy :)

Nice job kane

Jagex_Fagex

2006-07-02 06:39:20

as far as i can see, this is not rubbish/useless this wld be usefull for antiban kinda stuf me thinks.. work out the average key hold and then in the typing functions base each letter arround this

NICE JOB :)

Energizer TK

2006-07-02 13:42:54

Can you make 1 for mouse clicks?

Cheesehunk

2006-07-02 15:16:36

Also, but about grammar, "{}/?.>,<;:'][\|=-" Etc..