SRL Archive - SRL Archives

RTypeSend - Awesome, simple procedure.


Pancakes

2007-10-03 02:18:22

Well this is a simple procedure that could be used for autoresponders etc.

Basically, you provide it with an array of strings, and it will pick one of them and 'typesend' it.


procedure RTypeSend(TypeList : TStringArray);
var i : Integer;
begin
i := Random(GetArrayLength(TypeList));
TypeSend(TypeList[i]);
end;

So you could call it like this:

RTypeSend(['hehe', 'heh', 'ha', 'hah', 'hihi', 'rofl', 'lol', 'loll', 'haha', 'lolz', 'lol/']);

This simple procedure could be very useful for autoresponders, and the idea could be implemented in many different ways.

Cheers, Pancakes.

Santa_Clause

2007-10-03 02:50:35

Nice, nice.

procedure RTypeSend(TypeList : TStringArray);
begin
TypeSend(TypeList[Random(GetArrayLength(TypeList) - 1)]);
end;

Pancakes

2007-10-03 03:15:02

Shorter isn't always better :p

Santa_Clause

2007-10-03 03:28:16

I think it just makes it faster :)

nielsie95

2007-10-03 04:07:51

Simple, but useful. :)
You don't need the -1 after the GetArrayLength ;)

Starblaster100

2007-10-03 07:12:55

From: Santa_Clause
I think it just makes it faster :)


Not always :p

Freddy1990

2007-10-03 08:00:15

In this case shorter is better and you don't need the -1 indeed, that just makes it not work perfectly

Bobarkinator

2007-10-03 08:09:44

Simple but yet ingenious.

Lorax

2007-10-03 08:24:21

Lol, as an advice, don't use an auto talker, just respond.. (originally by Wizzy)

Pancakes

2007-10-03 08:55:22

From: Lorax
Lol, as an advice, don't use an auto talker, just respond.. (originally by Wizzy)


Could also be useful for autoresponders… :) Removed the -1, been working with KYAB paths too much lol.

Santa_Clause

2007-10-03 09:09:27

From: Freddy1990
In this case shorter is better and you don't need the -1 indeed, that just makes it not work perfectly


How can you tell if it makes a difference or not?

Starblaster100

2007-10-03 13:39:30

[php]
n := GetArrayLenght(array);
For i := 0 to n-1 do
[/php]

is better than

[php]
for i := 0 to GetArrayLength(Array) -1 do
[/php]

n3ss3s

2007-10-03 13:44:04

Is it faster?

Because if it is even 1 millisecond faster, I will reapply my mining procs in pwnaz0r's competition…

Pancakes

2007-10-03 19:30:13

From: Starblaster100
[php]
n := GetArrayLenght(array);
For i := 0 to n-1 do
[/php]

is better than

[php]
for i := 0 to GetArrayLength(Array) -1 do
[/php]


True, otherwise for every loop it gets the length of the array.

Johura

2007-10-04 00:34:11

Sweet. I might use this for auto responding. But then again, what else would you use it for ? :p

Santa_Clause

2007-10-04 10:53:36

Trying to get banned, undetectably :D

R0b0t1

2007-10-04 18:06:16

Bloody hell mate!