SRL Archive - Devs' Corner

Random solvers!


Naike

2010-12-02 07:57:06

Working Randoms
  • Leo - Working!
  • Mime - Working!
  • Molly - Working!
  • Demon - Working!
  • Certer - Working!
  • Pillory - Working!
  • Pinball - Working!
  • Sandwich lady - Working!
  • CapNArnav - Working!
  • Quiz - Working! (Needs to keep checking for new IDs)
  • Beekeeper - Working! (Needs some small testing and patching up)
  • EvilBob - Working! (Says it's going to bank items? still solves)
  • Forester - Working! (Test needed, re-wrote some, should work)
  • Abyss - Working! (New InRandom added, needs testing)

Potentially working randoms
  • Frog - Patched error I think… testing
  • Maze - Works great, just needs some patches for paths and a solid InRandom function (or an overhaul on our InRandom) (Should be tested on all paths!)

Broken or partially broken:
  • Mordaut - Works but confirmed items are missing since recent update
  • PrisonPete - Once we get proper model IDs to match the balloons, this is solved!

Naike

2010-12-02 09:42:09


Added rewards.simba and added some template code, it's all going to be improved!

Cstrike

2010-12-02 11:50:33

Prison is going to suck, but it's pretty much almost done

Cstrike

2010-12-02 19:24:36

Updated again

Cstrike

2010-12-02 21:36:56

Frog solver is nerfed…

EDIT: It's REALLY screwed up. My solver is a piece of crap, needs to be remade. Going to remake it soon tomorrow, RL won't allow it tonight :(

Coh3n

2010-12-03 03:48:19

From: cstrike
Frog solver is nerfed…

EDIT: It's REALLY screwed up. My solver is a piece of crap, needs to be remade. Going to remake it soon tomorrow, RL won't allow it tonight :(

Is that one of the ones you've already rewritten?

Cstrike

2010-12-03 07:08:54

From: Coh3n
Is that one of the ones you've already rewritten?


Yeah :(

I need to re-write it again.
I found the best way to solve random is break it into phases, and have it work it's way to a new phase. That way the account will *always* solve it, and will support even the laggiest of computers. Frog was one of the first ones I did, and I feel I can do a better job now that my experience writing randoms has increased leaps and bounds ;)

Cstrike

2010-12-03 15:18:01

{*******************************************************************************
function R_InFrogCave: Boolean;
by: Cstrike
Description: Checks if in Frog Random.
*******************************************************************************}
function R_InFrogCave: Boolean;
begin
Result := ValidNPC('Frog herald');
end;

{*******************************************************************************
function R_FrogChattingInterfaceOpen : Boolean;
by: Cstrike
Description: If there's an interface up, return true, else false.
*******************************************************************************}
function R_FrogChattingInterfaceOpen : Boolean;
var
ValidFrogInterfaces : TIntegerArray;
i : Integer;
begin
ValidFrogInterfaces := [64, 65, 66, 67, 68, 241, 242, 243, 244, 245];
for i:=0 to high (ValidFrogInterfaces) do
begin
if (ValidInterface(ValidFrogInterfaces[i])) then
begin
Result := True;
Exit;
end;
end;
end;

{*******************************************************************************
procedure R_FrogTalkToHerald;
by: Cstrike
Description: Talks to Frog at start
*******************************************************************************}
procedure R_FrogTalkToHerald;
var
NPCs : TNPCArray;
i, j: Integer;
TP : TPoint;
begin
if not R_LoggedIn then
Exit;
for j:=1 to 2 do
begin
if R_FrogChattingInterfaceOpen then
begin
R_Debug ('Already talking to frog herald.','Frog');
While R_ClickToContinue do
Wait(1000+Random(1000));
end else
begin
NPCs := GetNPCsNull;
if high (NPCs) < 0 then
begin
R_Debug ('No frog herald found...','Frog')
Exit;
end;
for i:=0 to high (NPCs) do
begin
if NPCs[i].ID = 2472 then
begin
TP := TileToMS(NPCs[i].Tile, 0);
Mouse (TP.X, TP.Y, 0, 0, false);
wait (250+random(250));
R_ChooseOptionMulti (['eral']);
end;
end;
end;
end;
end;

{*******************************************************************************
function R_FrogFindClickPrincess: Boolean;
by: Cstrike
Description: Finds princess and selects her
*******************************************************************************}
function R_FrogFindClickPrincess : Boolean;
var
NPCs: TNPCArray;
I, iTime, NPCTime : Integer;
TP : TPoint;
begin
Result := False;
MarkTime(iTime);
SetAngle(True);
repeat
NPCs := GetNPCsNull;
for I:=0 to high(NPCs) do
if (NPCs[I].Height = 278) then
begin
MarkTime(NPCTime);
R_Debug('[Reflection] Found correct frog!','Frog');
if TileOnMS(NPCs[I].Tile, 0) then
begin
R_Debug('[Reflection] Frog tile on mainscreen','Frog');
TP := TileToMS (NPCs[I].Tile, 0);
Mouse(TP.x, TP.y, 0, 0, false);
if WaitOption('alk-', 250+Random(100)) then
begin
Wait(400+Random(200));
Flag;
repeat
wait (100+random(100));
if (GetInterfaceText (243,3) = 'Frog Princess')or(GetInterfaceText (243,3) = 'Frog Prince') then
begin
result := true;
R_Debug ('Interacting with frog..','Frog');
Exit;
end;
until (TimeFromMark(NPCTime) > 10000)
R_Debug('Took too long interact with the frog','Frog');
end;
end else
begin
WalkToTile(NPCs[I].Tile, 0, 0);
Continue;
end;
end;
until (TimeFromMark(iTime) > 60000)
R_Debug ('Error finding frog! Time > 1 min','Frog');
end;

{*******************************************************************************
function R_FrogPrincessChat : Boolean;
by: Cstrike
Description: Continues chat with frog princess as to exit the random. Call this
procedure after you know you're interacting with the princess. Needs failsafe.
*******************************************************************************}
function R_FrogPrincessChat: Boolean;
begin
R_Debug('Finishing off talking...','Frog');
If (GetInterfaceText(243, 7) = 'Click here to continue')then
While Not (Pos('you so much', (GetInterfaceText(243, 4))) > 0) do
begin
ClickToContinue;
Wait(600+Random(300));
end;
R_Debug ('Last click!','Frog');
R_ClickToContinue;
wait (1000+random(2000));
R_ClickToContinue;
Wait(4000+Random(1500));
Result := Not r_InFrogCave;
end;

{*******************************************************************************
function R_SolveFrogCave : Boolean;
by: Cstrike
Description: Attempts to solve frog random, returns true if successful.
*******************************************************************************}
function R_SolveFrogCave : Boolean;
var
TimedCount, ChatTimeOut : Integer;
begin
if Not R_InFrogCave then
Exit;

// Talk to frog herald
R_FrogTalkToHerald;
wait (1000+random(2500));

// While talking, shut him up
MarkTime(ChatTimeOut);
While (GetInterfaceText(242, 6) = 'Click here to continue')do
begin
Wait(600+Random(300));
R_ClickToContinue;
if ChatTimeOut > 12000 then Break;
end;

// Just in case anything random happens... it will catch all other interfaces
MarkTime(ChatTimeOut);
While (R_FrogChattingInterfaceOpen)do
begin
Wait(600+Random(300));
R_ClickToContinue;
if ChatTimeOut > 12000 then Break;
end;

// Talk to and solve princess
MarkTime (TimedCount);
repeat
if R_FrogFindClickPrincess then
Result := R_FrogPrincessChat;
until (TimeFromMark(TimedCount) > 120000)or(Result)
end;

This is the new frog code that I just ripped from the old one because mine doesn't work as well as this.

Basically some mark time's were missing, and ClickToContinue should not be used because the mouse keeps hovering over the blue stuff, and then it ends up jamming and sitting in an infinite loop :(
R_ClickToContinue FTW

This worked for me, but NEEDS TESTING
Also converted to R_Debug as well
Also added a 2x repeating loop in talking to frog herald

DID NOT COMMIT, tell me what you think

Cstrike

2010-12-03 17:43:10

For some reason it randomly thought it was in beekeeper (when it definitely wasnt, I was watching the screen) and it returned false even though it wasnt in the random.

Therefore I think I'm going to edit all the R_Solve*Randomhere* to have this

begin
Result := True;
if not R_In*RandomHere* then
Exit;
Result := False;
//...
end;

Prevent false positives

Cstrike

2010-12-03 23:42:54

N1KE:


GREAT JOB ON BLUE PATH.
Literally the last door is off by a tile or two, needs to be east one or two (I think two, could be one… based on how he's standing I say X + 2).

Solved it beautifully almost, one tinker w/ it and it should be good.

Cstrike

2010-12-05 17:03:33

Quiz is broken, but this is the new update:

ComponentID's instead of ModelZoomID's which jagex erased:

thinFi FatFis
Fish: 6189, 6190
shovel, ?
Farming: 6195, 6196
necklace, ring
Jewellry: 6198, 6197,
LongS medhelm baxe ?
Swords: 6191, 6193, 6192, 6194


Thats our new database. It's actually more complete than RSBot/iBot somehow…

EDIT: I just solved the quiz :) Committed

Cstrike

2010-12-09 19:31:49

Ugh Mordaut is broken. Not happy.

Wizzup?

2010-12-10 04:03:30

You could've just used the Colour Quiz Solver, AFAIK it works perfect and doesn't need object ID updates… :)

Naike

2010-12-10 04:22:50

From: Cstrike
Ugh Mordaut is broken. Not happy.

What part?


From: Wizzup?
You could've just used the Colour Quiz Solver, AFAIK it works perfect and doesn't need object ID updates… :)

It's bugging, as Jagex made the objects showing into minimal size..
And we aim to solve them with reflection :p

Wizzup?

2010-12-10 04:29:32

In that case I'd like an account in the Quiz too, because solving the Quiz is trivial; I'll (hopefully) just have to update the info.

Cstrike

2010-12-10 13:13:43

From: Naike
What part?

Items (like new models…etc), Jagex did an overhaul, I got 2-3 wrong in a row, tried getting ID's and stuff but didn't help. Will have to use other methods.

Cstrike

2010-12-11 16:18:22

Prison is working BUT the ID's for the model retrieval are wrong, therefore its broken for now. Honestly it's so close to being finished… god damn ID's…ffs