XxKanexX
2006-04-03 02:44:17
I knows theres alot of SendText's. Just made this for fun and to see what everone thinks.
It will randomly make mistakes and randomly correct them based on how high or low the parametre, "MisRate" is. The higher it is, the less mistakes it will make. The lower, the more.
MisRate can be a number between 1 and 5.
The mistake is a key relevently close to the normal key it would have sent. Based on the Qwerty method. :)
This dosn't have to go in SRL if there is to many already ;) Depends on opinions.
A test script you can try:
Just press "control" to end it.
It will randomly make mistakes and randomly correct them based on how high or low the parametre, "MisRate" is. The higher it is, the less mistakes it will make. The lower, the more.
MisRate can be a number between 1 and 5.
The mistake is a key relevently close to the normal key it would have sent. Based on the Qwerty method. :)
function LetterCorrospond(c: string): string;
var Qwert: string;
i, pl: Integer;
begin
Qwert:= 'qwertyuiopasdfghjklzxcvbnm';
if (c = Chr(13)) then
begin
result:= chr(13);
exit;
end;
for i:= 1 to Length(Qwert) do
begin
if (copy(Qwert, i, 1) = c) then
begin
if (Random(2) = 1) then
pl:= i + Random(5)
else
pl:= i - Random(5);
if (pl < 1) or (pl > length(Qwert)-1) then
pl:= i;
result:= StrGet(Qwert, pl);
end;
end;
end;
procedure SendTextMis(s: string; MisRate: integer);
var i, m, mrate: integer;
begin
if (MisRate > 5) or (MisRate < 1) then
MRate:= 2
else
MRate:= MisRate;
for i:= 1 to length(s) do
begin
if (Random(MRate*2) = Random(MRate*2)) and (m < (Length(s)/2)) then
begin
SendKeys(LetterCorrospond(copy(s, i, 1)));
m:= m + 1;
if (Random(MRate*2+(MRate/2)) = Random(MRate*2+(MRate/2)))then
begin
Wait(350 + random(130));
SendKeys(chr(8));
Wait(70 + random(70));
SendKeys(copy(s, i, 1));
end;
end else
SendKeys(copy(s, i, 1));
Wait(70 + random(60));
end;
end;
This dosn't have to go in SRL if there is to many already ;) Depends on opinions.
A test script you can try:
begin
repeat
SendTextMis('hello' + chr(13), 3);
until(isfunctionkeydown(1));
end.
Just press "control" to end it.