SRL Archive - S.M.A.R.T. Questions and Answers.

Smart KeyDownProblems.


weequ

2010-07-13 13:56:15

Ok… Im trying to create a fast text sender procedure for smart since it doesn't have one.

I need a procedure Like SendKeys in scar. SendKeys in smart is way too slow for my purpose.
So only things I can use are KeyDown and KeyUp. Well everthing worked good until I had to use keys like / and \ that are accessed through shift and combination of alt and ctrl.


This procedure works fine without smart in scar but has problems in smart.
procedure SendTextSmartFast(S: String);
var
I: Integer;
begin
for I := 1 to Length(S) do
begin
if InStrArr(S[I], ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'Q','X', 'Y', 'Z', '!', '"', '#',
'¤', '%', '&', '/', '(', ')', '*', '_', ':', ';', '>', '½', '?'], true) then KeyDown(VK_Shift);
if InStrArr(S[I], ['\', '[', ']', '{', '$', '@', '£', '|'], true) then
begin
KeyDowN(VK_CONTROL);
Wait(5);
KeyDown(VK_Menu);
end;
KeyDown(GetKeyCode(S[I]));
Wait(5);
KeyUp(GetKeyCode(S[I]));
KeyUp(Vk_Shift);
KeyUp(VK_CONTROL);
KeyUp(VK_MENU);
end;
KeyDown(13);
Wait(10);
KeyUp(13);
end;

i luffs yeww

2010-07-13 14:14:45

Add randomness to the waits btw :p

And for Simba, to enter isn't it KeyDown(#13 + #10); KeyUp(#13 + #10);? I'm not at a computer to test with atm, sorry.

Also, I think that pressing shift doesn't make ? from /. I think you need the actual KeyCode for those, if that makes sense.

Shuttleu

2010-07-13 14:20:05

From: i luffs yeww
Add randomness to the waits btw :p

And for Simba, to enter isn't it KeyDown(#13 + #10); KeyUp(#13 + #10);? I'm not at a computer to test with atm, sorry.

Also, I think that pressing shift doesn't make ? from /. I think you need the actual KeyCode for those, if that makes sense.


you will need the keycode, but if you hold down shift then it will look less suspicious to fagex

~shut

weequ

2010-07-13 18:10:21

Like I said my procedure works with scar but not in smart. So I think the keycodes etc are right?

And I think Enter is eighter KeyDown(13) or KeyDown(VK_RETURN)

And btw I don't need random timing etc for this script. It only pm's people in different clan chats using runescape lobby. (advertising)

i luffs yeww

2010-07-13 18:47:55

Wait what's the point of this again? TypeSend works just fine with SMART..

weequ

2010-07-14 08:37:38

The point is to type fast unlike typesend or sendkeys in smart.

i luffs yeww

2010-07-14 12:50:55

Just take TypeSend and change the wait time? :p Change it in your SRL if this is a private script or change the name to MyTypeSend or something and just change the wait.

weequ

2010-07-14 14:07:12

From: i luffs yeww
Just take TypeSend and change the wait time? :p Change it in your SRL if this is a private script or change the name to MyTypeSend or something and just change the wait.
Well I could try that but Im almost 100% sure that it wont let me send letters like \ etc..

Edit: Here is srl typesend and it doesn't even have support for pressing alt.
procedure TypeSendEx(Text: string; PressEnter: Boolean);
var
S: string;
I, L: Integer;
Shift: Boolean;
begin
S:= 'ABCDEFGHIJKLMNOPQRSTUVWXZ' + '~!@#$%^&*()_+{}|:"<>?';
L := Length(Text);
for I := 1 to L do
begin
Shift := (Pos(Text[i], S) > 0);
if (Shift) then
begin
KeyDown(VK_SHIFT);
Wait(40 + Random(40));
while (Pos(Text[i], S) > 0) and (I <= Length(Text)) do
begin
TypeByte(GetKeyCode(Text[I]));
Wait(40 + Random(40));
Inc(I);
if (I > Length(Text)) then Break;
end;
end;
if (Shift) then
KeyUp(VK_SHIFT);
Wait(40 + Random(40));
if (I <= Length(Text)) then
begin
TypeByte(GetKeyCode(Text[I]));
Wait(40 + Random(40));
end;
end;
if (PressEnter) then
TypeByte(GetKeyCode(Chr(13)));
end;

i luffs yeww

2010-07-14 17:54:03

>_> So simply add it? :p

Sex

2010-07-14 18:04:10

In SMART character #10 is return.

weequ

2010-07-15 18:04:34

From: Sex
In SMART character #10 is return.

Im confused… It still worked with 13 though?