Rich
2009-07-08 23:08:45
Here are a few functions which are sort of like AddMistakes and TypeSend in one, but with a twist.
What they do are, type the message, and randomly make mistakes, just like AddMistakes, but instead, these backspace, and correct the mistake. You have the choice of choosing the % of making a mistake, and whether you want to press enter or not. I'll leave the rest to the code:
Ok. Well I made a few more than I may have needed to, but oh well…
Comments?
What they do are, type the message, and randomly make mistakes, just like AddMistakes, but instead, these backspace, and correct the mistake. You have the choice of choosing the % of making a mistake, and whether you want to press enter or not. I'll leave the rest to the code:
{*******************************************************************************
procedure TypeMistakesExPC(Text : string; PressEnter : Boolean; PC_Chance : Integer);
By: R1ch
Description: Types Text with mistakes, then fixes them. Presses enter depending
on PressEnter. PC_Chance = % of making a mistake.
*******************************************************************************}
procedure TypeMistakesExPC(Text : string; PressEnter : Boolean; PC_Chance : Integer);
var
I, Q : Integer;
L : TStringArray;
begin
L:= ['q','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m','1','2','3','4','5','6','7','8','9','0','[',']',';','#',',','.','/','\'];
I:= Length(Text);
for I:= 1 to (High(Text) - 1) do
begin
case Random(100) of
PC_Chance..100 : TypeSendEx(Text[i], False);
0..(PC_Chance-1) : begin
Q:= Random(High(L));
if (L[Q] <> Text[i]) then
begin
TypeSendEx(L[Q], False);
Wait(250 + Random(1000));
TypeByte(VK_BACK);
Wait(RandomRange(250, 850));
end;
TypeSendEx(Text[i], False);
end;
end;
end;
TypeSendEx(Text[i], PressEnter);
end;
{*******************************************************************************
procedure TypeMistakesEx(Text : string; PressEnter : Boolean);
By: R1ch
Description: Types Text with mistakes and fixes them.
Presses enter depending on PressEnter
*******************************************************************************}
procedure TypeMistakesEx(Text : string; PressEnter : Boolean);
begin
TypeMistakesExPC(Text, PressEnter, RandomRange(4, 16));
end;
{*******************************************************************************
procedure TypeMistakesPC(Text : string; Chance : Integer);
By: R1ch
Description: Types Text with mistakes and fixes them. Presses enter.
Chance = % of making a mistake.
*******************************************************************************}
procedure TypeMistakesPC(Text : string; Chance : Integer);
begin
TypeMistakesExPC(Text, True, Chance);
end;
{*******************************************************************************
procedure TypeMistakes(Text : string);
By: R1ch
Description: Types Text with mistakes and fixes them. Presses enter.
*******************************************************************************}
procedure TypeMistakes(Text : string);
begin
TypeMistakesEx(Text, True);
end;Ok. Well I made a few more than I may have needed to, but oh well…
Comments?