Note: Not fair to call the whole function yours, after just shortening it.
Got an "Closing parenthesis expected in script", fixed it.. Look under
SCAR Code:
{*******************************************************************************
procedure TypeSendEx(Text: string; PressEnter: Boolean);
By: Shuttleu
Description: Sends human like text.
*******************************************************************************}
procedure TypeSendEx(Text: string; PressEnter: Boolean);
var
S: string;
I: Integer;
D: Byte;
A, B, C: Boolean;
begin
S:= 'ABCDEFGHIJKLMNOPQRSTUVWXZ' + '~!@#$%^&*()_+{}|:"<>?';
for I:=0 to Length(Text) do
begin
A:= (Pos(Text[i], S) > 0);
if (not(I = Length(Text))) then
B:= (Pos(Text[I+1], S) > 0);
if (not(I = 0)) then
C:= (Pos(Text[I-1], S) > 0);
D := GetKeyCode(Text[i]);
if ((not(C)) and (A)) then
begin
KeyDown(VK_SHIFT);
Wait(40 + Random(40));
end;
TypeByte(D);
Wait(40 + Random(40));
if (not(B))or(I = Length(Text)) then // This line had the error.
begin
KeyUp(VK_SHIFT);
Wait(40 + Random(40));
end;
end;
if (not(PressEnter)) then Exit;
D := GetKeyCode(Chr(13));
TypeByte(D);
end;
Than I tested the function with this
Note: The slight name change is to get rid of errors..
SCAR Code:
program New;
{.include SRL/SRL.scar}
{*******************************************************************************
procedure TypeSendEx(Text: string; PressEnter: Boolean);
By: Shuttleu
Description: Sends human like text.
*******************************************************************************}
procedure n_TypeSendEx(Text: string; PressEnter: Boolean);
var
S: string;
I: Integer;
D: Byte;
A, B, C: Boolean;
begin
S:= 'ABCDEFGHIJKLMNOPQRSTUVWXZ' + '~!@#$%^&*()_+{}|:"<>?';
for I:=0 to Length(Text) do
begin
A:= (Pos(Text[i], S) > 0);
if (not(I = Length(Text))) then
B:= (Pos(Text[I+1], S) > 0);
if (not(I = 0)) then
C:= (Pos(Text[I-1], S) > 0);
D := GetKeyCode(Text[i]);
if ((not(C)) and (A)) then
begin
KeyDown(VK_SHIFT);
Wait(40 + Random(40));
end;
TypeByte(D);
Wait(40 + Random(40));
if (not(B))or(I = Length(Text)) then
begin
KeyUp(VK_SHIFT);
Wait(40 + Random(40));
end;
end;
if (not(PressEnter)) then Exit;
D := GetKeyCode(Chr(13));
TypeByte(D);
end;
begin
SetupSRL;
Wait(2000);
n_TypeSendEx('abcdefghijlgmnlopqrstouwz', False);
end.
But I got "[Runtime Error] : Out of string range in line 19 in script" while running it.
Sorry for being such a killer..