PDA

View Full Version : funtion TypeHuman(Test:String;MilisecondPerLett:Integer):S tring;



Daniel
12-28-2007, 12:34 AM
I don't think this has been created before, but it allows the user to input how many milliseconds they type per each letter so it equals less bannage of players. I really do hope this gets into SRL, i am always trying and hoping so my includes would :)

Information:
{************************************************* ******************************
function TypeHuman(Text:String;MillisecondPerLetter:Integer ):String;
By: IP-Drowner
Description: Types text human-like. Set MillisecondPerLetter to how many
many milliseconds it takes for you to type 1 letter in a word.
************************************************** *****************************}

Usage:
TypeHuman('Hello', 30);

The Code:
function TypeHuman(Text:String;MillisecondPerLetter:Integer ):string;
var
i: Integer;
begin
i:= 1;
repeat
Wait(Random(MillisecondPerLetter) + 50);
SendKeys(Copy(Text, i, 1));
i:=i+1;
until(i>Length(Text));
end;

Well, how do you guys like it. Feedback is appreciated ;)

A G E N T
12-28-2007, 12:52 AM
Good work, but don't you think TypeSend is safe enough?

Daniel
12-28-2007, 03:08 AM
Good work, but don't you think TypeSend is safe enough?
Yes, but this one you can set the typing speed. So, instead of slower typing, somebody could input their own millisecond per letter so it types just like them :)

LordGregGreg
12-28-2007, 03:17 AM
tat is not how mumans type. there is a ryhtm and patern bassed upon were the keys are located. there are also diferent lengths of pauses before words, and even sentances, depending on what is next. and also for most peope., there is a specific pattern of backspaces and misspellings form mispressing certain keys wrong.

but, ignorning all of this, it's not a bad method, good job.

also, your miliisecond per letter input is not accurate. as it is really 50, and the random part is your input.


Wait(Random(MillisecondPerLetter) + 50);
i would have at least done something like


Wait(
Random(
(MillisecondPerLetter / 4)
)
+ (MillisecondPerLetter-(MillisecondPerLetter/8))
);
;

that way it will wait the milliseconds plus or minus 25%.

bullzeye95
12-28-2007, 03:52 AM
Just to let you know, SendKeys pushes the key down and releases it faster than any human ;)

LordGregGreg
12-28-2007, 05:20 PM
mind doing the research and tell us exactly what the miliseconds is?

because i dont belive that, if it really was faster than ANY human, every typing scar script wold be banned by now.

A G E N T
12-28-2007, 07:20 PM
Just to let you know, SendKeys pushes the key down and releases it faster than any human ;)

Yes, but TypeSend() is somewhat slower; I did a little test and for the phrase "The quick brown fox jumps over the lazy old dog.",
TypeSend took 7359 ms, and SendKeys returned 0 ms!

bullzeye95
12-28-2007, 08:07 PM
mind doing the research and tell us exactly what the miliseconds is?

because i dont belive that, if it really was faster than ANY human, every typing scar script wold be banned by now.

What script are you talking about, that uses SendKeys?

King of Knives
12-28-2007, 10:17 PM
I think he's asking you to test the speed of "SendKeys". If I get this right, Greg believes that TypeSend uses SendKeys. Which it doesn't. TypeSend is almost 100% safe. It has random times between clicks, and has a random timing between pressing down a key and releasing it.

-Knives

R0b0t1
12-29-2007, 12:38 AM
I went and looked at TypeSend for all of you, and it doesn't use SendKeys. Why would it? It uses the SRL function TypeByte, and that uses KeyDown/KeyUp with a wait in between. (The function SendText uses SendKeys though... Its by RSN)


What our friend here is trying to re-create is the function TypeSend, but with a variable added to it to improve un-detectability.

Heres my version, with all the fixes applied to his. (When you compile a "for" loop, the compiler makes it a while loop anyway. In this code, you could forget the "I:= 1" at the beginning and just put "Inc(I)" at the beginning.)


function TypeHuman(Text: String; WaitTime: ShortInt): String;
var
I, B: Byte;
NeedShift: Boolean;
begin
I:= 1;
B:= Length(Text);
while (I <= B) do
begin
NeedShift := (Text[i] = ':') or (Text[I] = '!') or (Text[I] = '+') or
(Text[I] = '?') or (Text[I] = '<') or (Text[I] = '>') or
(Text[I] = '@') or (Text[I] = '#') or (Text[I] = '$') or
(Text[I] = '&') or (Text[I] = '%') or (Text[I] = '*');
if (NeedShift) then KeyDown($10);
(*This part presses the key*)
KeyDown(GetKeyCode(Text[I]));
Wait(20 + random(WaitTime));
KeyUp(GetKeyCode(Text[I]));
Wait(20 + random(WaitTime));
(*-------------------------*)
if (NeedShift) then
begin
KeyUp($10);
Wait(20 + random(50));
end;
Wait(WaitTime + random(500));
KeyDown($D);
Wait(random(WaitTime) + random(20));
Inc(I);
end;
end;


I used a a Byte because no line is more than 255 characters, and you can't type that many characters into runescape anyway.


EDIT: And creating a method to randomly generate a new person's typing is unconventional. TypeSend has proved itself, yes? It would be more work than the result is worth to create a system like that. Even if you simply include all of the factors from the key's closeness, still takes more work than you could possibly get from its result.


EDIT:

Excerpt from Text.scar


{************************************************* ******************************
procedure TypeByte(k: Byte);
By: Mutant Squirrle
Description: Types one char.
************************************************** *****************************}

procedure TypeByte(k: Byte);
begin
KeyDown(k);
Wait(10 + Random(50));
KeyUp(k);
end;

{************************************************* ******************************
procedure TypeSend(Text: String);
By: Mutant Squirrle
Description: Types text humanlike using random timeing on keys.
************************************************** *****************************}

procedure TypeSend(Text: string);
var
i: Integer;
Shift: Boolean;
begin
for i := 1 to Length(Text) do
begin
Shift := (Text[i] = ':') or (Text[i] = '!') or (Text[i] = '+') or
(Text[i] = '?') or (Text[i] = '<') or (Text[i] = '>') or
(Text[i] = '@') or (Text[i] = '#') or (Text[i] = '$') or
(Text[i] = '&') or (Text[i] = '%') or (Text[i] = '*');
if (Shift) then
begin
KeyDown(VK_Shift);
Wait(5 + Random(20));
end;
TypeByte(GetKeyCode(Text[i]));
if (Shift) then
begin
KeyUp(VK_Shift);
Wait(5 + Random(20));
end;
Wait(50 + Random(120));
end;
Wait(200 + Random(500));
TypeByte(13);
end;

LordGregGreg
12-29-2007, 04:37 PM
Greg believes that TypeSend uses SendKeys. Which it doesn't. this is true, sorry for the mishap XD

n3ss3s
12-29-2007, 04:49 PM
@Robot: Aaaand all that can be solved by changing the wait value in your own TypeByte in SRL :rolleyes:


EDIT: Btw


Wait(10 + Random(50));


That is from TypeByte and its just fine.

10ms is a really quick hit of the button, but 59ms then again is a lot slower.

We are doing just fine atm :p

JuKKa
12-29-2007, 07:10 PM
And i highly doubt that jagex goes around marking for how long our key presses are.

R0b0t1
12-29-2007, 11:50 PM
I dunno, I've seen flash games that do it.

osmm
12-30-2007, 03:14 AM
Yea guess lol. If you haven't checked out TypeSend it does exactly this...It does random 50-100miliseconds per letter. Well at least I'm prety sure thats wht it does. I forgot, I'v looked at it before. I'm too lazzy to check if I'm right.

Negaal
12-30-2007, 05:32 AM
And i highly doubt that jagex goes around marking for how long our key presses are.

How does Jagex bans/mutes peoples?

Lottery?

EDIT:
Of course their not, but they do got system what's detects autotyping...
I mean, some peoples have got muted for bad bad exe autotalkers...
or it's just me...haven't sleeped like 15 hours...uhmmm I got really bad sleeping traditions, I waked up at 3 or 4 pm yesterday...

err...player reports? :duh:

nething
12-30-2007, 06:30 AM
Somebody should do some kind of test to see how long a human really holds down a key while they are typing. I know SendKeys is instant which is why it gets you banned because they have a system to detect it. I have used a .exe autotyper that sent instantly and I never got banned but maybe I'm just lucky.

(well... I got muted twice for spamming with it but thats because I was spamming random things like "red:wave2:........................................ ......*" While I was fishing and a couple people got mad...)

osmm
12-30-2007, 06:40 AM
When I was telling my mod friend about an auto spamer (spamming a website) he is like ill brt. Within 2mins (before the mod came) it got muted. He said it was probably our new system that blocks those kinda people. Just some info.

R0b0t1
12-30-2007, 08:53 PM
Screen shots or it didn't happen ;)

n3ss3s
12-30-2007, 09:06 PM
If I could be sure that my army would be only muted, not banned, I would go SendKeys a bit so they couldn't blame me of not responding to "mining lvlz?" :p

osmm
12-31-2007, 05:30 PM
Accidently double posted.
Read post below.

osmm
12-31-2007, 05:32 PM
R0b0t1, ight, I'll talk to him again about it. This time I'll even try and get more information WITH ss.

Daniel
01-04-2008, 04:45 AM
But for newbie people, they wouldn't understand how to open that file and what to edit. While TypeHuman includes that millisecond plus a random amount of milliseconds after that. But i highly doubt that each key pressed is monitored. If it is, then stick with KeyDown and KeyUps.

Also, thanks R0bot1 as another way to do this function.