SRL Archive - OSR Help

Combining color randoms and reflection


Bobzilla69

2010-12-01 13:12:38

ok, so what i tried to do with my script is combine both the color and reflection randoms to try and optimally solve them.

it does not have the FindDead as my script deathwalks

this is what i have so far
function FindRandoms: Boolean; //copied findnormalrandoms from antirandoms include and edited out FindDead so i can do deathwalking.
var
I: Byte;
Cont : boolean;
begin
if (SRL_OnFindRandomCall <> nil) then
begin;
Result := SRL_OnFindRandomCall(cont);
if not Cont then
exit;
end;
for I := 1 to 8 do
begin
case I of
1: Result := SolveTeleportRandoms;
2: Respond;
3: Result := FindLamp(LampSkill);
4: Result := RC;
5: Result := FindMod;
6: if (SRL_Procs[srl_OnRandomCall] <> nil) then
SRL_Procs[srl_OnRandomCall]();
7: Result := UseRewardBox;
8: Result := R_FindRandoms;
end;
if (Result) then
begin
if (SRL_Procs[srl_OnFindRandom] <> nil) then
SRL_Procs[srl_OnFindRandom]();
Break;
end;
end;
end;

i dont think this will work as if it fails one would it not stop instead of continuing down the loop?

thought please

mormonman

2010-12-01 13:15:19

function RandomCheck : Boolean;
var I : Integer;
begin
for I := 0 to 1 do
begin
case I of
1: Result := R_FindRandoms;
2: Result := FindNormalRandoms;
end;
if Result then Exit;
end;
end;
This is what I used in an old script of mine. I would also use this as a failsafe.

if RandomCheck then
if not LoggedIn then Exit;

Bobzilla69

2010-12-01 13:18:46

ok, but i need it not to do the FindDead check thats in FindNormalRandoms, so i suppose i could just do
function FindRandoms: Boolean; //copied findnormalrandoms from antirandoms include and edited out FindDead so i can do deathwalking.
var
I: Byte;
Cont : boolean;
begin
if (SRL_OnFindRandomCall <> nil) then
begin;
Result := SRL_OnFindRandomCall(cont);
if not Cont then
exit;
end;
for I := 1 to 7 do
begin
case I of
1: Result := SolveTeleportRandoms;
2: Respond;
3: Result := FindLamp(LampSkill);
4: Result := RC;
5: Result := FindMod;
6: if (SRL_Procs[srl_OnRandomCall] <> nil) then
SRL_Procs[srl_OnRandomCall]();
7: Result := UseRewardBox;
end;
if (Result) then
begin
if (SRL_Procs[srl_OnFindRandom] <> nil) then
SRL_Procs[srl_OnFindRandom]();
Break;
end;
end;
end;

function RandomCheck : Boolean;
var I : Integer;
begin
for I := 0 to 1 do
begin
case I of
1: Result := R_FindRandoms;
2: Result := FindRandoms;
end;
if Result then Exit;
end;
end;

if RandomCheck then
if not loggedin then exit;

any reason you put r_FindRandoms before FindNormalRandoms

mormonman

2010-12-01 13:23:54

From: bobzilla69
ok, but i need it not to do the FindDead check thats in FindNormalRandoms, so i suppose i could just do
function FindRandoms: Boolean; //copied findnormalrandoms from antirandoms include and edited out FindDead so i can do deathwalking.
var
I: Byte;
Cont : boolean;
begin
if (SRL_OnFindRandomCall <> nil) then
begin;
Result := SRL_OnFindRandomCall(cont);
if not Cont then
exit;
end;
for I := 1 to 7 do
begin
case I of
1: Result := SolveTeleportRandoms;
2: Respond;
3: Result := FindLamp(LampSkill);
4: Result := RC;
5: Result := FindMod;
6: if (SRL_Procs[srl_OnRandomCall] <> nil) then
SRL_Procs[srl_OnRandomCall]();
7: Result := UseRewardBox;
end;
if (Result) then
begin
if (SRL_Procs[srl_OnFindRandom] <> nil) then
SRL_Procs[srl_OnFindRandom]();
Break;
end;
end;
end;

function RandomCheck : Boolean;
var I : Integer;
begin
for I := 0 to 1 do
begin
case I of
1: Result := R_FindRandoms;
2: Result := FindRandoms;
end;
if Result then Exit;
end;
end;

if RandomCheck then
if not loggedin then exit;

any reason you put r_FindRandoms before FindNormalRandoms


Because I wanted to use the reflection solvers, this was back when the color randoms were actually detected the majority of the time but they didn't solve them very well.

Bobzilla69

2010-12-01 13:25:08

ok cool, cheers for the help