SRL Archive - First Scripts

OSRS color bank skilling


saml1991

2021-03-17 08:44:45

Hi All,

I've gotten back into OSRS after over a decade leave. I've been making 'quick and dirty' scripts for things like fletching and mess hall cooking.

I've been playing in modern resizeable mode in the runelite client and was wondering if there was a better way to adapt SRL for this (or if I should be doing this at all?) I adapted them by copy and pasting into my code and changing the location of the inventory to match.

Also will the way I've written it be very detectable? I babysit it while its running and stop it if it looses position somehow.










program new;
{$i SRL/osr.simba}

const
PLAYERS_NAME = '';
PLAYERS_PASSWORD = '';
ignoreSlots: Tintegerarray = [0];
startbox: integer = 0;
items:integer=8000;
var
circles: tpointarray;
groupedcircles: t2dpointarray;
window, negbox,fbounds: tbox;
w, h, i, fpx, fpy, x, y,counter: integer;
Antiban: TAntiban;
FSlots: TBoxArray;
begin
with Players.New() ^ do
begin
LoginName := PLAYERS_NAME;
Password := PLAYERS_PASSWORD;
IsActive := True;
IsMember := True;
end;
FBounds := [1461, 722, 1616, 967];
FSlots := fbounds.Partition(7, 4, - 2);
for i := 0 to High(FSlots) do
begin
FSlots[i].x1 += 3;
FSlots[i].x2 -= 3;
end;
Players.SetCurrent(0);
activateclient();
getclientdimensions(w, h);
window := inttobox(0, 0, w - 1, h - 1);
Antiban.Init(SKILL_STRENGTH);
Antiban.AddTask([@ Antiban.LOSEFOCUS, ONE_MINUTE, 1]);
repeat
mouse.click([880,790,910,815],1); //zoom in and position bank over deposit all button
waitex(850,200);
mouse.click([880,790,910,815],1); //deposit all button
waitex(850,200);
mouse.click([865,748,894,773],1); //log slot
waitex(850,200);
presskey(VK_ESCAPE);
waitex(850,200);
mouse.click(FSLOTs[0],1); //knife slot
waitex(850,200);
mouse.click(FSLOTs[4],1); //log slot
waitex(850,200);
presskey(vk_space);
WAITEX(8000,500);
counter:=counter+1;
repeat
wait(10);
Antiban.DoAntiban(True);
until (NOT FINDCOLOR(X,Y,16777215,1382,9,1419,21)); //xp popup window
waitex(1000,1000);
until (counter>round(items/28))
end.

My NMZ script, it just pray flicks before the end of every minute then I manually go to inventory and top up absorption and potions. My HP kept going over 1 when using antiban so I changed to mouseoffclient
program new;
{$i SRL/osr.simba}

const
PLAYERS_NAME = '';
PLAYERS_PASSWORD = '';
var
circles: tpointarray;
groupedcircles: t2dpointarray;
window, negbox: tbox;
w, h, i, fpx, fpy, x, y,timerr,mousss: integer;
Antiban: TAntiban;
begin
// srl.Setup([]); c
with Players.New() ^ do
begin
LoginName := PLAYERS_NAME;
Password := PLAYERS_PASSWORD;
IsActive := True;
IsMember := True;
end;
Players.SetCurrent(0);
activateclient();
getclientdimensions(w, h);
window := inttobox(0, 0, w - 1, h - 1);
Antiban.Init(SKILL_STRENGTH);
Antiban.AddTask([@ Antiban.LOSEFOCUS, ONE_MINUTE, 1]);
repeat

if(findcolortolerance(x,y,344499,inttobox(1597,759,1629,790), 42)) then
begin
mouse.click(inttobox(1603,765,1623,783),1);
waitex(200,100);
mouse.click(mouse_left);

timerr:=gettimerunning() + (one_second * 40);
mousss := randomrange(0,10);
waitex(500,9000);
repeat
wait(10);
if(findcolortolerance(x,y,344499,inttobox(1597,759,1629,790), 42)) then
if (mousss <4) then
begin
srl.mouseoffclient(3);
mousss:=5;
end;
//Antiban.DoAntiban(True);
until (gettimerunning() > timerr);
wait(round(srl.SkewedRand(0, 10000, 19000)));
end;
until (0)
end.

Dynamite

2021-03-18 06:26:04

I haven't looked at the SRL include in probably 10 years, so my feedback may be outdated…

I would suggest that yes the way you're doing it currently is very detectable as there's not much tolerance to movement at all.

There's also no failsafes - now you did say that you sit and monitor it so maybe that's not an issue for yourself, but if you want the script used by people, you'll need to implement some failsafes. Currently 1 small change on screen can kill the script and you'll be stuck in an infinite loop.

Even just starting with a simple failsafe that catches 5 failed tries and then quits. So if it can't find your button/target 5 times then it will kill the script.


But overall, great work! A script does what it needs to do for the user - so if it works for you, well done!

saml1991

2021-03-18 14:10:08

Thanks a lot for the feedback. I get what you mean about the fail safes and can add that in there (the uptext library doesnt work in this 'modern resizeable' mode but have managed to get teseract to work for some bits which would also help with making sure its clicking the right thing).

In terms of tolerance for movement, in a scenario such as cleaning herbs it only needs to click on deposit all and then a bank item what sort of additional movement would you add?
Such as in the screenshot it clicks the right green box area to open bank, clicks the same spot to also deposit inventory, then clicks the grimy herbs to put in inventory then closes with esc button and clicks first inventory slot.

[ATTACH=CONFIG]28752[/ATTACH]