SRL Archive - Reflection Development

RSBOT: settings.getSetting --> Reflection?


Cstrike

2010-10-27 22:20:02

I'm trying to solve Cap'n Arnav, but Jagex are smart and have managed to make it impossible with RSBot's interface explorer to get the ID's of the model that is currently up.

So RSBot does this:
1) Sets them all to "coins"
2) Detects name (this I can do)
3) Moves them appropriately (this I can do)


I just have no idea how "settings.getSetting(803)" could be applied to reflection. Could it be a hook or something we're missing?


Their code is
        if (interfaces.get(185).isValid()) {
log("Setting default position. Coins Coins Coins!");
while (!firstColFound) {
while (!thirdColFound) {
startValue3 = settings.getSetting(809);
sleep(random(500, 700));
mouse.click(random(295, 315), random(13, 33), true);
sleep(random(800, 1000));
currValue3 = settings.getSetting(809);
if (currValue3 < startValue3) {
thirdColFound = true;
}
}
Interface 185 is the interface for moving the stuff around. There is no interface 809 (i tried that). Everyhting else is do-able, just I'm stuck on what data they get with that one line of code. Once I get that, I can solve this random probably in 10-15 minutes no problem.


This is sort of an important command for ScapeRune bob cat's island thing as well. Without it, we would have no choice AFAIK but to go to color.

i luffs yeww

2010-10-27 22:23:03

I wouldn't suggest doing it like that. :/ I know it'll make it much more difficult, but they can catch on to things like this very easily.

Cstrike

2010-10-27 22:37:37

From: i luffs yeww
I wouldn't suggest doing it like that. :/ I know it'll make it much more difficult, but they can catch on to things like this very easily.


How would it be more detectable? I don't know much about the GetSetting
It seems like I have no choice but to use it in ScapeRune evil bob: (


Also my internet is probably dying, it keeps crashing :@ MUST RESET ROUTER

BTW I'm dumb, the include with this code solves it perfectly when I tested it, so sort of disregard this thread.
function R_InArnav: boolean;
begin
Result := ValidNPC('Arnav');
end;

function R_ChestOpen: boolean;
begin
Result := ValidInterface(185);
end;

function R_TalkToArnav: boolean;
var
NPC: TNPC;
P: TPoint;
t: integer;
begin
if not FindNPC('Arnav', NPC)then Exit;
if not TileOnMS(NPC.Tile, NPC.Height * 2 / 3)then
begin
SetAngle(true);
if not TileOnMS(NPC.Tile, NPC.Height * 2 / 3)then
if not WalkToTile(NPC.Tile, 0, 0)then
Exit;
end;
P := TileToMS(NPC.Tile, NPC.Height * 2 / 3);
Mouse(P.x, P.y, 3, 3, false);
Result := R_ChooseOption('Talk-to');
if Result then
begin
MarkTime(t);
While ((not FindNPCText('click here to')) and (TimeFromMArk(t) < 5000))do
begin
if charactermoving then
MarkTime(t);
wait(100+Random(100));
end;
end;
end;

function R_HandleArnav: boolean;
var
Arnav: TNPC;
begin
if not R_LoggedIn then Exit;
Result := R_ChestOpen;
if Result then Exit;
While not R_ChestOpen do
begin
if not FindNPC('Arnav', Arnav)then Exit;
if (( not InteractingWithMe(Arnav)) and (not FindNPCText('ready to try'))
and (not R_ClickToContinue))then
R_TalkToArnav;
R_ClickToContinue;
if(FindNPCText('ready to try'))then
begin
Mouse(247, 436, 15, 3, true);
wait(800+Random(2000));
end;
end;
end;

function R_GetGoal: String;
begin
if not R_ChestOpen then Exit;
Result := trim(lowercase(GetInterfaceText(185, 31)));
end;

procedure R_SetToCoins;
var
sValue, nValue, i: integer;
rowDone: Boolean;
P: TPoint;
begin
if not R_ChestOpen then Exit;
for i := 1 to 3 do
begin
case i of
1: P := Point(123, 25);
2: P := Point(210, 25);
3: P := Point(303, 25);
end;
while not rowDone do
begin
sValue := GetSetting(809);
wait(500+Random(200));
Mouse(P.x, P.y, 10, 10, true);
wait(800+Random(200));
nValue := GetSetting(809);
rowDone := (nValue < sValue);
end;
rowDone := false;
end;
end;

procedure R_ChangeSelection(Dir: String; Count: Integer);
var
x, y, i, z: integer;
begin
if not R_ChestOpen then Exit;
case lowercase(dir) of
'up': y := 25;
'down': y := 305;
end;
for i := 0 to 2 do
begin
x := 125 + (i * 88);
for z := 1 to Count do
begin
Mouse(x, y, 10, 10, true);
wait(800+Random(200));
end;
end;
end;

function R_SolveArnav: boolean;
var
Goal: String;
t: integer;
NPC: TNPC;
PT: TTile;
P: TPoint;
begin
if not R_InArnav then Exit;
while(R_InArnav)do
begin
R_HandleArnav;
R_SetToCoins;
Goal := R_GetGoal;
while(R_ChestOpen)do
begin
case Goal of
'ring': R_ChangeSelection('down', 1);
'bowl': R_ChangeSelection('up', 1);
'bar': R_ChangeSelection('up', 2);
end;
Mouse(440, 251, 20, 10, true);
MarkTime(t);
While(R_ChestOpen and (TimeFromMark(t) < 4000))do
wait(100+Random(100));
wait(500+Random(500));
Result := FindNPCText('done it!');
if Result then
begin
R_ClickToContinue;
if not FindNPC('Arnav', NPC)then Exit;
PT := Tile(NPC.Tile.x-1, NPC.Tile.y+2);
P := TileToMS(PT, 30);
Mouse(p.x, p.y, 3, 3, false);
Result := R_ChooseOption('Enter');
while(R_InArnav and (TimeFromMark(t) < 8000))do
wait(100+Random(100));
end;
end;
end;
R_ClickToContinue;
Result := not R_InArnav;
///if Result then
//Inc(RSolved[RArnav])
//else
//Inc(RFailed[RArnav]);
end;

pyroryan

2010-10-27 22:38:18

GetSettingArray or GetSetting as found in Core.simba.
Relevant hooks are hook_static_GetSettings and hook_settingarray_GetData.

Edit: Nice job on figuring it out before I posted :)

i luffs yeww

2010-10-27 22:46:52

And it's detectable because it will most likely scroll through the correct setting for them before getting to the ring, and humans would know it did that. Jagex would be able to detect this, I'm sure. It's not that difficult.

Cstrike

2010-10-27 22:47:50

From: pyroryan
GetSettingArray or GetSetting as found in Core.simba.
Relevant hooks are hook_static_GetSettings and hook_settingarray_GetData.

Edit: Nice job on figuring it out before I posted :)


Woot :D
I'm still trying to figure out what it does/how it works D:

TomTuff

2010-10-27 22:55:37

I would do it like this
For each column of wheels, cycle through and using uptext index which wheel is what
do this for each wheel to create and index of what the wheels are
rotate wheels as necessary to line up the wheels to the proper locations for the items to line up

E: ninja'd several times >_<

Nava2

2010-10-28 00:23:40

You have a lot of ``magic numbers'' in there. Pull them out and make them constants ;)