I am not sure if something like this exists so here we go.
Lets say I have x number of procedures and I would like to lunch them all but in random order. Is there a function or a easy way (without case randoming infinite amount of permutation)?
I am not sure if something like this exists so here we go.
Lets say I have x number of procedures and I would like to lunch them all but in random order. Is there a function or a easy way (without case randoming infinite amount of permutation)?
Oh Hai Dar
I know there is a WaitFunc method, where you'd do WaitFunc(@Something, 100);, so I'm sure I'm sure there's a way. You could look at how MSI does something kinda on topic with full scripts being able to be called in DeclarePlayers I think.
I am not sure on what you mean
This is my problem:
For example lets say I have like 300 types of antiban (not my case) and I would like to use them all in random order.
All I can think of is maybe put them in branches of case random, but I think a more efficient way would exist.
Something like:
Randomize:
1:P1;
2:P2;
3:P3;
4:P4;
...etc
If something like that doesn't exist, maybe we can create something like that? It does not have to be like that above but it would be nicetoo bad there isn't array of procedures (or is there?).
Last edited by Main; 11-10-2010 at 05:17 AM.
Oh Hai Dar






The is an array of procedure or an array of function. But this requires all your procedures/functions to have the same parameters.
You could do something like this:
SCAR Code:var ProcArray: array of procedure;
ProcArray := [@P1, @p2, @p3, @p4];
//to call a random proc
ProcArray[Random(Length(ProcArray))]();
That should work. You still need to define each procedure nomrally, then put each handle into the ProcArray.
If you want all procedures to be done, try this...
Simba Code:Procedure ExecuteProcedures;
var
IntArr: TIntegerArray;
Number, Count, I: Integer;
begin
SetArrayLength(IntArr, NumberOfProcedures);
//from here...
while InIntArray(NumberOfProcedures, 0) do
begin
Number := Random(NumberOfProcedures);
if InIntArray(NumberOfProcedures, Number) then
IntArr[Count] := Number;
Inc(Count);
end;
//...to here
//creates an array of unique integers
for I := 0 to High(IntArr) do
//Optionally instead of High(IntArr) use the amount of procedures you want to do, minus 1
Case IntArr[I] of
0 : Proc1;
1 : Proc2;
2 : Proc3;
3 : Proc4;
{and so on}
end;
end;
That should also help me do something, thanks for making me get that idea...
Last edited by Bad Boy JH; 11-11-2010 at 03:20 AM.
Current Script Project
Pot of flour gatherer - 95% done
Can't get Simba to work? Click here for a tutorial
There are currently 1 users browsing this thread. (0 members and 1 guests)