SRL Archive - SRL Archives

Inrandom:Boolean; (REQUEST)


Main

2009-09-03 09:28:36

This is something I'd like to see in the future. Ive never found anything like that in the previouse srl version (Except this one procedure, but it was for rev 34), I think this will be very useful.

Blumblebee

2009-09-03 09:56:10

if FindNormal Randoms will detect if you are in a random?

Main

2009-09-03 09:59:36

but that solves it.

ian.

2009-09-03 10:54:50


function InRandom: Boolean;
begin
if(Rand_GetRandomType > 0)then
Result := True;
end;

Main

2009-09-03 10:58:53

Thanks ian. I'll test it out when freddy release the new scar ^^

ian.

2009-09-03 11:00:50

He has a prerelease. Use this in Tortoise.. http://Freddy1990.com/svn/scarprerelease

marpis

2009-09-03 11:53:28

From my aircrafter

function m_FindRandoms: boolean;
var
TypeID, H, HH, I, J: integer;
B: TBox;
Rand_Music: string;
RandResult: boolean;
begin
TypeID := Rand_GetRandomType;
H := High(TeleRandoms);
for I := 0 to H do
begin
if (TypeID = TeleRandoms[I].TypeID) then
begin
if (TeleRandoms[I].IsInRandom <> nil) then
RandResult := TeleRandoms[I].IsInRandom();
if (TeleRandoms[I].IsInRandom = nil) or (RandResult) then
begin
Result := (Length(TeleRandoms[I].Texts) = 0) and (TeleRandoms[I].Music = '');
if (not(Result)) and (TeleRandoms[I].Music <> '') then
begin
if (Rand_Music = '') then Rand_Music := Lowercase(GetMusic);
Result := (Rand_Music = TeleRandoms[I].Music);
end;
if (not(Result)) and (Length(TeleRandoms[I].Texts) > 0) then
begin
HH := High(TeleRandoms[I].Texts)
for J := 0 to HH do
begin
B := TeleRandoms[I].TextBoxes[J];
Result := (FindTextTPA(TeleRandoms[I].TextColors[J], 0, B.X1, B.Y1, B.X2, B.Y2, TeleRandoms[I].Texts[J], TeleRandoms[I].TextFonts[J], Nothing));
if (Result) then
begin
players[currentplayer].Loc := TeleRandoms[I].Name; // <-- you can comment this out
Alert('Random detected!'); // <-- you can comment this out
Break;
end;
end;
end;
end;
end;
end;
FindNormalRandoms; // <-- you can comment this out
end;

ian.

2009-09-03 12:00:46

Err.. Marpis, mine will work just the same, I think. :p

ZephyrsFury

2009-09-03 14:27:09

From: ian.
Err.. Marpis, mine will work just the same, I think. :p


Nope, it will always either return 1 or 2. Never 0.

Main

2009-09-03 22:09:41

Which 1 or 2 declare that its in random? (Don't have srl atm)

JPHamlett

2009-09-03 23:43:07

From: Main_Ftw
Which 1 or 2 declare that its in random? (Don't have srl atm)


i may be totally wrong but i think 1 or 2 counts the tabs to figure out what random it is in

Home

2009-09-04 12:04:04

No idea do this even work :P

function InRandom: Boolean;
begin
Result := Rand_GetRandomType > 0;
end;

~Home :P