Shuttleu
2009-06-25 03:03:27
this is shorter and from what i can see it should still work just as well
~shut
EDIT: also while looking through the current TypeSendEx it doesnt wait between typing capitals
{*******************************************************************************
procedure TypeSendEx(Text: string; PressEnter: Boolean);
By: Shuttleu
Description: Sends human like text.
*******************************************************************************}
procedure TypeSendEx(Text: string; PressEnter: Boolean);
var
I: Integer;
Char: Byte;
ThisOne, NextOne, LastOne: Boolean;
begin
for I:=1 to Length(Text) do
begin
ThisOne:= (Uppercase(Text[I]) = Text[I]);
if (not(I = Length(Text))) then
NextOne:= (Uppercase(Text[I+1]) = Text[I+1]);
if (not(I = 1)) then
LastOne:= (Uppercase(Text[I-1]) = Text[I-1]);
Char := GetKeyCode(Text[i]);
if ((not(LastOne)) and (ThisOne)) then
begin
KeyDown(VK_SHIFT);
Wait(40 + Random(40));
end;
TypeByte(Char);
Wait(40 + Random(40));
if (not(NextOne))or(I = Length(Text)) then
begin
KeyUp(VK_SHIFT);
Wait(40 + Random(40));
end;
end;
if (not(PressEnter)) then Exit;
Char := GetKeyCode(Chr(13));
TypeByte(Char);
end;~shut
EDIT: also while looking through the current TypeSendEx it doesnt wait between typing capitals