Tniffoc
2008-09-21 12:53:41
I think that this would shorten a lot of anti-ban procedures in scripts. It says a random thing from the array of strings in it's argument. Please post reviews/comments here! This would go in either Text.scar with TypeSend, or AutoTalk.scar which is empty!
{*******************************************************************************
procedure RandomSay;
By: King of Knives with revision by Tniffoc
Description: Says a random string from the array provided to it.
*******************************************************************************}
procedure RandomSay(toSay: array of string);
var
lengthOfArray: Integer;
begin
lengthOfArray:= Length(toSay);
if (lengthOfArray=0) then
begin
srl_Warn('RandomSay;','No strings were provided!');
Exit;
end;
if (not (toSay[Random(lengthOfArray)]='') then
TypeSend(toSay[Random(lengthOfArray)])
else
srl_Warn('RandomSay', 'The string provided in the array is empty!', -1);
end;