SCAR Code:
Type
TextType = Record
NWord, OWord : String;
ChangeType : Integer;
end;
{*************************************************************************************************
Procedure TypeSend2(Text: String; SMART : Boolean);
By: FrÕzÑ_§ÕµL.
Description: Types Text Human-like, pressing random keys around the original.Will not mess up words such as red: or wave:
as long as there is no space before the :. Will type in SMART if needed.
Use: TypeSend2('i want to change this text', false);
SMART use: TypeSend2('i want to change this text', true);
*************************************************************************************************}
Procedure TypeSend2(Text: String; SMART : Boolean);
var
i, j, k, l, DP : integer;
WordArr : Array [0..100] of TextType;
Keys : Array [0..3] of String;
Begin
i := 0;
Text := Padr(Padl(Trim(Text), Length(Trim(Text)) + 1), Length(Trim(Text)) + 2);
Repeat
WordArr[i].OWord := Between(' ', ' ', Text);
WordArr[i].NWord := WordArr[i].OWord;
Delete(Text, Pos(WordArr[i].OWord, Text) - 1, Length(WordArr[i].OWord) + 1);
i := i + 1;
Until(Text = ' ');
for i := 0 to 100 do
Begin
WordArr[i].ChangeType := -1;
if Random(100) < 10 then
if Pos(':', WordArr[i].OWord) < 1 then
WordArr[i].ChangeType := Random(3);
end;
i := 0;
Repeat
Repeat
if WordArr[i].ChangeType = -1 then
Begin
i := i + 1;
if i > 100 then
Break;
end;
until(WordArr[i].ChangeType >= 0);
if Length(WordArr[i].OWord) = 0 then
Break;
j := Random(Length(WordArr[i].OWord)) + 1;
if WordArr[i].ChangeType = 1 then
DP := Pos(Copy(Lowercase(WordArr[i].OWord), j, 1), WordArr[i].OWord);
Keys[3] := '1234567890';
Keys[2] := 'qwertyuiop';
Keys[1] := 'asdfghjkl';
Keys[0] := 'zxcvbnm';
Repeat
for k := 3 downto 0 do
Begin
l := Pos(Copy(Lowercase(WordArr[i].OWord), j, 1), Keys[k]);
if l > 0 then
Break;
end;
if l = 0 then
Begin
i := i + 1;
if (i > 100) then
Break;
end;
until(l > 0);
if (i > 100) then
Break;
case k of
0 : k := k + Random(1);
1, 2 : k := k - 1 + Random(2);
3 : k := k - 1 + Random(1);
end;
case l of
1 : l := 1 + Random(1);
Length(Keys[k]) : l := Length(Keys[k]) - 1 + Random(1);
else
l := l - 1 + Random(2);
end;
if (Random(100) > 70) or (WordArr[i].ChangeType = 1) then
Begin
Delete(WordArr[i].NWord, j, 1);
Insert(Copy(Keys[k], l, 1), WordArr[i].NWord, j);
end else
Insert(Copy(Keys[k], l, 1), WordArr[i].NWord, j - 1 + Random(1));
i := i + 1;
Until(i = 101);
for i := 0 to 100 do
Begin
for l := 1 to Length(WordArr[i].NWord) do
Begin
if Pos(Copy(WordArr[i].NWord, l, 1), '~!@#$%^&*()_+{}|:"<>?') > 0 then
Begin
KeyDown(VK_SHIFT);
Wait(100 + Random(100));
end;
if SMART then
SmartSendKeys(Copy(WordArr[i].NWord, l, 1))
else
TypeByte(GetKeyCode(StrGet(WordArr[i].NWord, l)));
Try
if Not(Pos(Copy(WordArr[i].NWord, l + 1, 1), '~!@#$%^&*()_+{}|:"<>?') > 0) then
KeyUp(VK_SHIFT);
Except
end;
Wait(100 + Random(100));
if (WordArr[i].ChangeType = 1) and (l = DP) then
if (Copy(WordArr[i].NWord, l, 1) <> Copy(WordArr[i].OWord, DP, 1)) then
Begin
Wait(200 + Random(200));
TypeByte(VK_BACK);
Wait(200 + Random(200));
if SMART then
SmartSendKeys(Copy(WordArr[i].OWord, DP, 1))
else
TypeByte(GetKeyCode(StrGet(WordArr[i].OWord, DP)));
Wait(200 + Random(200));
end;
end;
if Length(WordArr[i].NWord) = 0 then
Break;
if SMART then
SmartSendKeys(' ')
else
TypeByte(VK_SPACE);
end;
if SMART then
SmartSendKeys(chr(10))
else
TypeByte(GetKeyCode(chr(13)));
for l := 0 to 100 do
if WordArr[l].ChangeType = 2 then
if WordArr[l].OWord <> WordArr[l].NWord then
Begin
for i := 1 to Length(WordArr[l].OWord) do
Begin
if SMART then
SmartSendKeys(Copy(WordArr[i].OWord, i, 1))
else
TypeByte(GetKeyCode(StrGet(WordArr[l].OWord, i)));
Wait(100 + Random(100));
end;
if WordArr[l].OWord = '' then
Exit;
KeyDown(VK_SHIFT);
Wait(100 + Random(100));
if SMART then
SmartSendKeys('*')
else
TypeByte(GetKeyCode('8'));
Wait(200 + Random(200));
KeyUp(VK_SHIFT);
Wait(100 + Random(100));
if SMART then
SmartSendKeys(chr(10))
else
TypeByte(GetKeyCode(chr(13)));
Exit;
end;
end;