SRL Archive - OSR Help

Backspace?


DeSnob

2010-05-13 19:42:56

How can i have the script delete what it typed out?

Such as, it types "my wc is 20.", but doesn't press enter and instead "presses" backspace to take it out

Note: Need it for my antiban procedure below:


4: begin
a := 0+random(150);
b := 0+random(100);
c := a / b;
if c < 20 then
begin
case random(10) of
0: text := 'i pwn you all';
1: text := 'rs is so cool!!1!';
2: text := 'i am a wc pro.';
end;
TypeSendEx(text, False);
end else
begin
Writeln('INFO/ANTIBAN: Number was larger than 20; doing other antiban.');
if GameTab(30) then
begin
Mmouse(x, y, 10, 10);
wait(100+random(1500));
GameTab(25);
end else
Writeln('INFO: **Error** Unable to open friends list; exiting.');
FindNormalRandoms;
end;
end;
.

Sex

2010-05-13 20:21:19

Well, after TypeSendEx just use:
procedure BackspaceText(s : string; delay : integer);
var
i, l : integer;
begin
l := length(s);
if l = 0 then
exit;
for i := 1 to l do
begin
TypeByte(VK_BACK);
Wait(delay + random(20));
end;
end;
Or some shit like that.

x[Warrior]x3500

2010-05-13 20:22:02

1. detect length of string, put value as int A

2. make an "for i:=0 to A do" loop, incrementing "i" each time the backspace key is pressed (ch8 - i believe) (just TypeSendEx it)

MylesMadness

2010-05-13 20:26:55

TypesendEx(Replicate(Chr(VK_Back), 8), False);
Change 8 to the number of times to hit backspace

Sex

2010-05-13 20:29:12

Oh, you could also use this :p:
procedure BSText(s : string);
begin
TypeSendEx(s + replicate(chr(VK_BACK), length(s)), False);
end;

DeSnob

2010-05-13 22:46:22

From: Sex
Oh, you could also use this :p:
procedure BSText(s : string);
begin
TypeSendEx(s + replicate(chr(VK_BACK), length(s)), False);
end;


Exactly what i wanted Ty :D