SRL Archive - SRL Snippets

TypeSendMultiRandom


Sin

2012-02-23 10:04:15

It's perfect for antiban usages and such.
You can call it in an Antiban procedure


case random(200) of
0:TypeSendMultiRandom('','','');
2: ~~~~

function TypeSendMultiRandom(tX,tY,tZ:String):Boolean;
begin
case random(3) of
0: TypeSend(tX);
1: TypeSend(tY);
2: TypeSend(tZ);
end;
Result := True;
end;

Kyle Undefined

2012-02-23 10:07:01

I would suggest making it a procedure, and I don't see it being included. Would make a good addition to the SRL Snippets though :)

Sin

2012-02-23 10:11:32

From: Kyle Undefined
I would suggest making it a procedure, and I don't see it being included. Would make a good addition to the SRL Snippets though :)


Damn it, shoulda posted it there then o.o
Can someone move this?

Flight

2012-02-23 10:17:25

Gimme a second, I think I can modify this just a bit.

Edit:
Here ya go bud. At this moment in time I'm quite busy but this should do exactly what you want but with unlimited strings:

function TypeSendMultiRandom(Texts: TStringArray):Boolean;
var
i,H: Integer;
begin
for i := 0 to High(Texts) do
if InStrArr(Texts[i], Texts, True) then
Inc(H);

TypeSend(Texts[Random(H)]);
Result := True;
end;

putonajonny

2012-02-26 07:35:52

Why not just:
Procedure TypeSendMultiRandom(Texts: TStringArray);
begin
TypeSend(Texts[Random(GetArrayLength(Texts))]);
end;

Home

2012-02-26 07:41:02

From: putonajonny
Why not just:
Procedure TypeSendMultiRandom(Texts: TStringArray);
begin
TypeSend(Texts[Random(GetArrayLength(Texts))]);
end;


Use "Length" Instead of GetArrayLength :P


~Home

putonajonny

2012-02-26 08:27:58

From: Home
Use "Length" Instead of GetArrayLength :P


~Home


I read somewhere that it was good practice to use Length for strings and GetArrayLength for arrays

Home

2012-02-26 08:33:23

From: putonajonny
I read somewhere that it was good practice to use Length for strings and GetArrayLength for arrays


That's true : )


And looking good mate!

~Home