PDA

View Full Version : TypeSend2 - Makes Human Errors! [NEW]



FrÕzÑ_§ÕµL
03-25-2008, 10:07 AM
{************************************************* ************************************************
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);
************************************************** ***********************************************}

Added Features (7/4/2008)
Will switch around some letters.
Will backspace some letters, taking a little more time for the typer to 'think', and then write the correct one. Won't re-type the same letter ;)
Will sometimes write a messed up word again properly with a * following it.
Will not change text effects, such as glow: or wave:. (Useful! I was using a separate typing function before to not make mistakes lol.)

Please I need people to see if the typing works in SMART all the time!

Enjoy ;)

TypeSend2('this will change your text', false);
^^ thats the usage, false indicates Non-SMART script.

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;

Attachments:
TypeSend2.scar - Set debug box as your client and click run to test.

StrikerX
03-25-2008, 10:12 AM
lol nice This is gonna make jagex Shit themselves haha defiantly will use when making my first script if thats alright....

FrÕzÑ_§ÕµL
03-25-2008, 10:14 AM
Awesome ;) yea I really wanna focus on human-like now that they are being so careful and banning a ton of us.

Good luck with it.

Da 0wner
03-25-2008, 10:16 AM
Maybe add TypeSend(Text) at end? Dosen't type for me. :p

FrÕzÑ_§ÕµL
03-25-2008, 10:19 AM
Thats because the typing bit is within the {}, the thing posted is a tester lol.

ZephyrsFury
03-25-2008, 10:21 AM
Can I ask why you need the SMART boolean. SMART.scar already changes the Chr(13) into a Chr(10).

FrÕzÑ_§ÕµL
03-25-2008, 10:22 AM
Yes, but you need smartsendkeys or it won't type i find. Maybe I don't need, will test tomorrow, going to bed now.

omgnomorenames
03-25-2008, 10:46 AM
I made something almost exactly like this yesterday, you didn't happen to get the idea from me..., but looks way better then mine so cheers to you.

wired16
03-25-2008, 10:48 AM
i had this idea except with the login like... mess up the username or password ....... cuase who doesnt mis spell thier name or pass sometimes?

FrÕzÑ_§ÕµL
03-25-2008, 05:35 PM
Lol I saw your thread when I was gonna post this omgnomorenames, but I have been working on this thing for ages, used to have about 300 lines as I had 5 different options forever key on the keyboard lol!

Well wired, I don't know that Jagex really monitor logins anyway, but if it was set to a 1% screw up it may be an ok idea.

wired16
03-25-2008, 06:50 PM
yea... somthing maybe like (im not a sc;ripter so i know its wrong but youll get it
if typesend=a (random 1-2)
1.(s)
2.(q)
if typesend=b then random 1-2
1.(n)
2.(b)
but only have it do like 1 letter ..hell even have it try and login then when fails correct login...
yea i dont think they do... but if they ever do...... i came up with it first :D

FrÕzÑ_§ÕµL
03-25-2008, 06:56 PM
Totally wrong code :p lol yea you said.

Thats what mine does though, it gets where the key is on the 'keyboard', and chooses whether to stay on that keyboard line or to go up/down one (depending on position of course, since the 1234 line can't go up one), it then will choose a letter to the left center or right of where the original key was on the new line.

So
's' can return any of:
q, w, e, a, s, d, z, x, c.

Attached a compilable test version of it now.

mixster
03-25-2008, 07:07 PM
I was tempted to write a replacement for TypeSend myself, but I'm glad I didn't as your one rocks ;)
Though all it seems to be lacking is the ability to change the probability it mistypes (e.g. 10%, 5%, 1 div 20.0 etc.)

omgnomorenames
03-25-2008, 07:14 PM
Lol, glad at least you saw mine :D

You should add something to have it switch the letters around.

Example
See and Typo "ese"
Great and Typo "Graet"
Should be used on two vowels side by side.

Another one is remove a letter by "accident"

Example
Worried and Typo "Woried"
Hurry and Typo "Hury"
Words with the same letter side by side.

wired16
03-25-2008, 10:04 PM
^^^ good idea but we dont want to make it too long lol

mixster
03-25-2008, 10:12 PM
It wouldn't be too long, all you would have to do is make it randomly select 2 characters to switch around, set a var to = the one, set the other to equal the first one and voila! Actually, coding it may be easier!

function SwitchRandomChar(s: string): string;
var
TempC: char;
RC1, RC2: Integer;
begin
RC1 := Random(Length(s) - 2) + 1;
TempC := s[RC1];
RC2 := Random(2) - 1 + RC1;
s[RC1] := s[RC2];
s[RC2] := TempC;
Result := s;
end;

And that should work :)

Narcle
03-25-2008, 10:37 PM
You could go really far with this. Even as far as testing yourself how often you make mistakes typing yourself. I think the main thing that would change the accuracy just like human typing is the speed of it. The faster the typing the higher the chance to make mistakes. The slower the typing the less chance of making a mistake. If I made a full fledge Typing function like this I would have the String then the Speed to type from 1-10 or something of the sort. It would be the most simple.

TypeSend(Str:string; TypeSpeed:integer)

Something like that. I would use already predetermined % chance to mistype etc. depending on the speed.

wired16
03-25-2008, 10:54 PM
great idea narcle..... actually thats common sense

FrÕzÑ_§ÕµL
03-26-2008, 01:36 AM
Wow there are so many things I could add ^^ thank you guys, will spend a lot of time on this then :p I used to have option for percent mistake etc but there was no real need, it will be adjusted as it was just a test after all.

The other thing is that it makes mistakes in a certain order, not just randomly, so if it makes 5 in the first 10 letters then the last 10 letters wouldn't be changed.

drizzt
03-26-2008, 02:11 AM
What I think would be pretty cool make it so that if it makes a mistake, about half the time make it backspace and fix the mistake it made, because thats what i, and probably some other people do when they time. it's really good as is is though

FrÕzÑ_§ÕµL
03-26-2008, 03:00 AM
Right so list of possibles:
Backspace mistakes.
ReType mistake word with a * following it.
Mistakes based on speed.
Changing order of mistakes made.
Switching letters around (simple, just change where it inserts by -1)

I see no reason why any or all of those can't be implemented with a well designed structure, will be on my project list along with Fr0zn Hybrid.

StrikerX
03-26-2008, 05:33 AM
yo soul how much time did this take to make?

mixster
03-26-2008, 07:13 AM
3 days, 2 hours and 1 minute.

Anyway, it sounds ambitious adding all of that stuff in and still managing to keep it below 100 lines, but I guess that limit will go out the window if it was as awesome as it will be :)

EvilChicken!
03-26-2008, 01:10 PM
Right so list of possibles:
Backspace mistakes.
ReType mistake word with a * following it.
Mistakes based on speed.
Changing order of mistakes made.
Switching letters around (simple, just change where it inserts by -1)

I see no reason why any or all of those can't be implemented with a well designed structure, will be on my project list along with Fr0zn Hybrid.

Seriously, if you do all that, I can guarantee you it'll be implemented in SRL. I like the "backspacing mistakes" idea, could be useful. I think LogInPlayer would be changed to "LoginPlayer(SendText2: Boolean)" if your function gets impemented. ^_^ Best of luck!

PvH
03-26-2008, 01:43 PM
Right so list of possibles:
Backspace mistakes.
ReType mistake word with a * following it.
Mistakes based on speed.
Changing order of mistakes made.
Switching letters around (simple, just change where it inserts by -1)

I see no reason why any or all of those can't be implemented with a well designed structure, will be on my project list along with Fr0zn Hybrid.

whoah.. that would be hard scripting..
i wish i could do that :p
you got that mistake thing also in your forest frostbite right?
(not this one, but another kind of which also made mistakes)
very nice;)
rep++

mixster
03-26-2008, 06:00 PM
Most of those are actually quite easy to do, but to pull together in one script and make them coincide is where the real problems start. Afterall, what happens if all of the mistakes happen in one word? That would look very suspicious or if you backspaced a wrong word then put a *"word here". It's just thinking it all through and organising it, then making sure it all works with heavy testing and it will be great. Also, as EvilChicken said, it probably will be thrown into SRL, though I doubt for the login as I doubt Jagex would monitor login screens, especially as I know I personally have never misspelled my name when logging in and only a couple of times misspelled my password.

FrÕzÑ_§ÕµL
03-26-2008, 06:30 PM
Aye thank you all :) and yes I did use my old (300lines+) version of this in frostbite 1.5.

May be quite a hard time ahead lol, but I need just as much organization in Fr0zn Hybrid, I will manage ;) I doubt it will stay to < 100 lines though.

Thank you all for your support, wish me luck!

Edit : Just begun... holy shit this hurts :p going well though, I have separated the Text into a special Type I have made, so each word is one part of an array. Not even entirely sure what I'm gonna finish with lol...

Seperator :
Text := Padr(Padl(Trim(Text), Length(Trim(Text)) + 1), Length(Trim(Text)) + 2);
Repeat
WordArr[i].Word := Between(' ', ' ', Text);
Delete(Text, Pos(WordArr[i].Word, Text) - 1, Length(WordArr[i].Word) + 1);
i := i + 1;
Until(Text = ' ');

FrÕzÑ_§ÕµL
04-01-2008, 04:39 AM
I think I'm pretty much done on it, please PM for a test.

I'm not sure about the speed thing. Should I do it randomly or user set? Because if I use Typesend2(text, 5) it might not be implemented coz ppl wouldn't wanna write the speed each time? I know how to do it, just not wether I should.

Also what Typing speed? RandomRange(200,400) between each key is what I'm using, works pretty well but I don't have much experience.

EvilChicken!
04-01-2008, 12:59 PM
200 - 400 MS is qute much for key typing. Check what the original TypeSend has! I think its shomewhat like 30 + random(45). And, RandomRange(int, int2) is twice as slow as int + random(int); So I would reccomend int + random(int). Likewise, Inc(int) is twice as slow as int + 1;.

Edit: Mind PMing me the code, since I now made a post in your thread and all? (Trying to save time..)

JuKKa
04-01-2008, 01:21 PM
Program Test;

Function MakeError( S: String; Chance: Integer): String;
Var
KeyBoard: Array [1..3] Of TStringArray;
I, KBx1, KBy1: Integer;
Begin
KeyBoard[1] := ['q','w','e','r','t','y', 'u', 'i', 'o', 'p'];
KeyBoard[2] := ['a','s','d','f','g','h', 'j', 'k', 'l'];
KeyBoard[3] := ['z','x','c','v','b','n', 'm'];
If(Chance > 100)Then
Chance := 100-Random(100);
For I:= 1 To Length(S) Do
If(Chance >= Random(100))Then
Begin
For KBx1 := 1 To 3 Do
For KBy1 := 0 To High(KeyBoard[ KBx1 ] ) Do
Begin
If(Lowercase(S [ i ]) = KeyBoard[KBx1][KBy1])Then
Begin
Try
Result := Result + KeyBoard[KBx1 + Random(2)][KBy1 + Random(2)];
Except
Try
Result := Result + KeyBoard[KBx1 - Random(2)][KBy1 - Random(2)];
Except
Result := Result + S [ I ];
End;
End;
End;
End;
End Else
Begin
Result := Result + S [ I ];
Continue;
End;
End;

Begin
Writeln(MakeError('abcdefghijklmnopqrstuvwxyz', 10));
End.

ehhhh´, i suckkk but thats somewhat how i would create it.

FrÕzÑ_§ÕµL
04-01-2008, 06:07 PM
No Jukka lol, I'm sure it works just as well as mine did, but mine now has all those extra things.

:duh: damit so I can't use RandomRange either :p used to use inc till I read raymonds post that they were slower...

JAD
04-02-2008, 12:44 AM
Hmm... Nice function, but I believe SRL made one that does the exact same thing except it doesn't press the enter key:


{************************************************* ******************************
function SendText2(Text: String): Boolean;
By: RSN | Modded By: Spky
Description: Types text humanlike making mistakes, returns true if mistake has
been made.
************************************************** *****************************}

function SendText2(Text: string): Boolean;
var
i, j, w: Integer;
S: string;
begin
for i := 1 to Length(Text) do
begin
S := Text[i];
if (Random(5) + 1 = 1) and (w < 3) then
begin
w := w + 1;
Result := True;
j := Ord(S[1]);
if (j <> 13) then
S := Chr(j + (Random(5) + 1));
if (S = Chr(13)) then
S := 'l';
end;
SendKeys(S);
Wait(50 + Random(100));
end;
end;


Correct me if yours does something different.

Nice though :)

FrÕzÑ_§ÕµL
04-02-2008, 02:56 AM
Jad the SRL one is hardly anything like this, it types any letter near one, so s could be like qrstuv, but thats no where near human like, plus mine backspaces and correct mistakes.

P1nky
04-02-2008, 03:16 AM
forsure gonna use this! in my script

FrÕzÑ_§ÕµL
04-02-2008, 03:37 AM
^^ thanks p1nky, enjoy mate.

StrikerX
04-02-2008, 10:35 AM
haha Checked new version out :) Rep++

it was ment to right

Strikerx25 Rocks He is a n00b Scripter ATM but will someday Rule Ze World

But instead

strikerx25 rocks he is a n00b scripter atm but will sosmeday rulw ze world
rule*

So to use this just replace typesend('') With typesend2('') <----Noob Question

FrÕzÑ_§ÕµL
04-02-2008, 06:10 PM
Yes TypeSend in your script becomes TypeSend2('text', false);, or if you are using SMART then TypeSend2('text', true);.

Ultra
04-02-2008, 08:30 PM
Hey, i seen this in your script - Forest Frostbite, yes this is awsome.

MWHAHAHAHA How are you gonna deal with this now jaghax! :).

FrÕzÑ_§ÕµL
04-02-2008, 10:41 PM
Lol yea script uses my old one, doesn't have the 3+ new features ^^ totally pwning jagex hehe.

StrikerX
04-03-2008, 05:35 AM
hey just wondering sometimes it backspaces even when it is correct is this ment to happen?

FrÕzÑ_§ÕµL
04-03-2008, 06:05 AM
:p ya I know lol, gonna have to fix that then eh ^^

MylesMadness
04-06-2008, 12:25 AM
Okay this kick ass

Edit:500th post!

FrÕzÑ_§ÕµL
04-06-2008, 11:53 PM
:p thanks man, you reckon this could be put in SRL?

PvH
04-07-2008, 07:07 AM
i think this might become a srl thingie
its awsome man:D
very nice done;)

FrÕzÑ_§ÕµL
04-07-2008, 08:14 AM
Thanks ;) I fixed the problem with it backspacing and replacing with the same letter now, so its sweet as. Gonna see what Wizzup? thinks.

Narcle
04-07-2008, 08:29 AM
:p thanks man, you reckon this could be put in SRL?

Devs are very picky.

FrÕzÑ_§ÕµL
04-07-2008, 09:28 AM
Yea I ain't really expecting anything lol... especially not with it taking up so many lines :( oh well.

JuKKa
04-07-2008, 02:33 PM
Procedure Typesendmistake(txt: String; Chance: Integer);
Var
Key: String;
KeyBoard: Array [0..3] Of TStringArray;
KBx1, KBy1, I: Integer;
Begin
I := 1;
KeyBoard[0] := ['1','2','3','4','5','6','7','8','9','0'];
KeyBoard[1] := ['q','w','e','r','t','y', 'u', 'i', 'o', 'p'];
KeyBoard[2] := ['a','s','d','f','g','h', 'j', 'k', 'l'];
KeyBoard[3] := ['z','x','c','v','b','n', 'm'];
While( I <= Length( txt ) ) Do
Begin
If(Random(100) <= Chance)Then
Begin
For KBx1 := 0 To 3 Do
For KBy1 := 0 To High(KeyBoard[ KBx1 ] ) Do
If(Lowercase(txt [ i ]) = KeyBoard[KBx1][KBy1])Then
Try
Key := KeyBoard[KBx1 + Random(2)][KBy1 + Random(2)];
Except
Try
Key := KeyBoard[KBx1 - Random(2)][KBy1 - Random(2)];
Except
Key := Txt[i];
End;
End;
End Else Key := Txt[i];

TypeByte(GetKeyCode(StrGet(Key, 1)));
Wait(40 + Random(40));
If(Key = txt[i])Then
Inc(I)
Else
Begin
Wait(200+Random(200));
TypeByte(VK_BACK);
Wait(200+Random(200));
End;
End;
TypeByte(GetKeyCode(Chr(13)));
End;

heres another one i created.

NiCbaZ
04-22-2008, 10:04 AM
ty useing this in script if thats ok!

FrÕzÑ_§ÕµL
04-22-2008, 07:14 PM
:) No prob nic, it's what its here for.