SRL Archive - OSR Outdated / Broken Scripts

Gilded Altar Bot - BETA - [SMART]


Ryutoh

2013-05-04 13:06:24

This is my first bot I've made and released, it was originally for a friend and I but I've decided I'd release it to the public. It's still in beta and has bugs that need sorting out. Currently I haven't enabled any random detection or anti-bans.

To summarize what the bot does, it essentially will run to the portal in Yanille, enter the designated house, and find the altar to use the bones with. It currently has difficulty finding the altar, be sure to only use this in a house where the altar is in the room beside the portal, otherwise it'll get stuck. After there's no bones left, it will proceed to find the portal and walk to the bank, and then loop over again. The walking can be buggy at times, and the road color constantly changes, so occasionally it will have issues with this part.

I plan to allow this bot to be open source, so feel free if anyone would like to contribute to its development. Further information on how to set it up is in the configuration. Good luck, enjoy, and be sure to post any errors. :)


EDIT: Because of errors, and the problem of the script not being consistent I decided to just release a small utility script. It'll use the bones on the altar for you, and then end. Simply go bank manually and return to the altar and run again.
program new;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\SmartGraphics.simba}

var
X, Y: integer;
altarlocation, altarangle:Boolean;

const
bonecolor = 11711164; //Custom bone colors if you wish
bonecolor2 = 4342343;
bonecolor3 = 10329514;

procedure Altar;
begin
repeat
if FindObjEx(X, Y, ['ltar', 'ray', 'se'], [9405829, 1355193, 1687772, 1351091, 9669000, 1888494, 11977670, 4510942], 2, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
if altarangle = false THEN
begin
SMART_DrawBox(intToBox(X-32, Y-5, X+35, Y+25));
altarangle := true;
altarlocation := true;
writeln('Altar found! Using bones on altar...')
Mouse(X, Y, 5, 5, 0);
wait(100+ random(50))
if ChooseOptionMulti(['ltar']) then
begin
ChooseOptionMulti(['ltar'])
wait(200+ random(50))
SetAngle(SRL_ANGLE_HIGH);
end;
SMART_ClearCanvasArea(IntToBox(MSX1, MSY1, MSX2, MSY2))
end
else
begin
SMART_DrawBox(intToBox(X-32, Y-5, X+35, Y+25));
altarlocation := true;
writeln('Altar found! Using bones on altar...')
Mouse(X, Y, 5, 5, 0);
wait(100+ random(50))
if ChooseOptionMulti(['ltar']) then
begin
ChooseOptionMulti(['ltar'])
wait(200+ random(50))
end;
SMART_ClearCanvasArea(IntToBox(MSX1, MSY1, MSX2, MSY2))
end
end
else
begin
writeln('Altar not found! Looking around...')
altarlocation := false;
SetAngle(SRL_ANGLE_LOW);
altarangle := false;
wait(500+random(200))
makecompass(randomrange(0, 360))
wait(400+random(200))
end;
until(altarlocation = true);
end;
procedure SelectBone;
begin
adjustmousespeed(2, 10, 20)
if (not FindColorTolerance(X, Y, bonecolor, MIX1, MIY1, MIX2, MIY2, 25)) THEN
begin
writeln('No bones found, exiting...');
terminatescript;
end else
if FindObjEx(X, Y, ['ur', 'one'], [bonecolor, bonecolor2, bonecolor3], 25, 50, MIX1, MIY1, MIX2, MIY2) THEN
begin
Mouse(X, Y, 5, 5, 0);
wait(100+ random(50))
if ChooseOptionMulti(['se']) then
begin
ChooseOptionMulti(['se'])
wait(100+ random(50))
Altar;
end else
Mouse(644, 187, 5, 5, 1);
end
end;
begin
SetupSRL();
ActivateClient;
WriteLn('Starting...')
MouseSpeed := 25;
gametab(tab_Inv)
MakeCompass('N')
setangle(0)
wait(1000)
begin
begin
repeat
SelectBone;
until (false);
end
end;
end.

StickToTheScript

2013-05-04 13:30:19

Im kinda on a time crunch, but I took a quick glance at it. Looks alright, but i did make it a bit easier on the eyes. I spaced things out and made them a bit easier to read.

Here is what it currently looks like:

//////////////////////////////////////////////////
// (Beta Version)Script by Ryutoh //
// //
// 1. Set your bones in top left bank corner //
// 2. Set house name and other user info //
// 3. Start in Yanille bank or house //
//////////////////////////////////////////////////

program new;
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
{$i SRL-OSR\SRL\misc\debug.simba}

var
X, Y, i: integer;
Portal, altarlocation, altarangle:Boolean;


const
housename = 'housename'; //Name of the host
nickname = 'nickname'; //Nickname/Username (ign)
username = 'emailoruser'; //Email/user
password = 'pass'; //Password
bonecolor = 11447993; //Custon bone colors if you wish
bonecolor2 = 4342342;
bonecolor3 = 10329514;

//NOTE: You might need to change the road color, go below and find "RoadColor :=", set the color there

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := username;
Pass := password;
nick := nickname;
Active := True;
end;
end;

procedure Altar;
begin
repeat
if FindObjEx(X, Y, ['Altar', 'Pray', 'Use'], [9405829, 1355193, 1687772, 1351091, 9669000, 1888494, 11977670, 4510942], 2, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
if altarangle = false THEN
begin
altarangle := true;
altarlocation := true;

writeln('Altar found! Using bones on altar...')
Mouse(X, Y, 5, 5, 0);
wait(100+ random(50))
ChooseOptionMulti(['Altar', 'Pray']);
wait(100+ random(50))
SetAngle(SRL_ANGLE_HIGH);
end else

begin
altarlocation := true;

writeln('Altar found! Using bones on altar...')
Mouse(X, Y, 5, 5, 0);
wait(100+ random(50))
ChooseOptionMulti(['Altar', 'Pray']);
wait(100+ random(50))
end
end else

begin
writeln('Altar not found! Looking around...')
altarlocation := false;
SetAngle(SRL_ANGLE_LOW);
altarangle := false;
wait(500+random(200))
makecompass(randomrange(0, 360))
wait(400+random(200))
end;
until(altarlocation = true);
end;


procedure LetsWalk(path:Integer);
begin
RoadColor := 6545612;//Road color here
GetNewRoadColor(mmx1, mmy1, mmx2, mmy2, 8)
if not LoggedIn then LogInPlayer;
case path of
1: RadialWalkTolerance(RoadColor,0,45,65,5,5,12);

2: RadialWalkTolerance(RoadColor,-10,25,65,5,5,12);

3: RadialWalkTolerance(RoadColor,-30,10,65,5,5,12);

4: RadialWalkTolerance(RoadColor,-20,20,65,5,5,12);

5: RadialWalkTolerance(RoadColor,0,30,35,5,5,12);

6: if FindColor(X, Y, 5889774, MMX1, MMY1, MMX2, MMY2) THEN
begin
Mouse(X, Y, 5, 5, 1);
wait(4000);
end; //bank

7: RadialWalkTolerance(RoadColor,190,230,60,5,5,12);

8: RadialWalkTolerance(RoadColor,180,220,72,5,5,12);

9: RadialWalkTolerance(RoadColor,140,190,65,5,5,12);

10: RadialWalkTolerance(RoadColor,180,210,65,5,5,12);

11: RadialWalkTolerance(RoadColor,180,205,35,5,5,12);

12: if FindColor(X, Y, 9639252, MMX1, MMY1, MMX2, MMY2) THEN
begin
Mouse(X, Y, 7, 0, 1);
wait(4000);
end; //portal
end;
end;


procedure backtoportal;
begin
MakeCompass('E')
SetAngle(SRL_ANGLE_HIGH);
setrun(true)
gametab(tab_Inv)
Writeln('Walking to portal...');
if FindObjEx(X, Y, ['orta', 'nte'], [12010639, 11480961, 6953555, 5375801], 13, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
writeln('Portal found, moving to portal...')
Portal := true
Mouse(X, Y, 5, 5, 1);
wait(4000+random(1000))
Mouse(260, 429, 3, 3, 1);
wait(3000+random(300))
TypeSend(housename);
wait(3000+random(300))
end;

for i := 7 to 12 do
begin
Writeln('You are on Walk Number ' + IntToStr(i));
LetsWalk(i);
wait(500+random(500))
end;

repeat
if FindObjEx(X, Y, ['orta', 'nte'], [12010639, 11480961, 6953555, 5375801], 13, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
writeln('Portal found, moving to portal...')
Portal := true
Mouse(X, Y, 5, 5, 1);
wait(4000+random(1000))
Mouse(260, 429, 3, 3, 1);
wait(3000+random(300))
TypeSend(housename);
wait(3000+random(300);
end else

begin
writeln('Portal not found, rotating...')
Portal := false
SetAngle(SRL_ANGLE_LOW);
wait(500+random(200))
makecompass(randomrange(0, 360))
wait(400+random(200))
end;
until(Portal = true);
end;


procedure bank;
var
obank: Boolean;

begin
if FindObjEx(X, Y, ['ank', 'ooth'], [7443106, 3107720, 542302], 2, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
obank := true
Mouse(X, Y, 5, 5, 1);
wait(500+random(200))
if Bankscreen = false THEN
begin
bank;
wait(1500+random(500))
end else

begin
writeln('Found bank...')
Withdraw(0, 0, 28);
wait(1000+random(500))
CloseBank;
wait(1000+random(200))
backtoportal;
end;
end else

begin
MakeCompass('E')
SetAngle(SRL_ANGLE_HIGH);
setrun(true)
gametab(tab_Inv)
Writeln('Walking to bank...');
for i := 1 to 6 do
begin
Writeln('You are on Walk Number ' + IntToStr(i));
LetsWalk(i);
wait(500+random(500))
end;
repeat
if FindObjEx(X, Y, ['ank', 'ooth'], [7443106, 3107720, 542302], 2, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
obank := true
Mouse(X, Y, 5, 5, 1);
wait(500+random(200))
if Bankscreen = false THEN
begin
bank;
wait(1500+random(500))
end else

begin
writeln('Found bank...')
Withdraw(0, 0, 28);
wait(1000+random(500))
CloseBank;
wait(1000+random(200))
backtoportal;
end;
end else

begin
obank := false
writeln('Bank not found, looking around...')
SetAngle(SRL_ANGLE_HIGH);
wait(500+random(200))
makecompass(randomrange(0, 360))
wait(400+random(200))
end;
until obank = true;
end;
end;


procedure start;
var
i : integer;

begin
if FindObjEx(X, Y, ['ank', 'ooth'], [7443106, 3107720, 542302], 2, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
bank;
end else

begin
if (not FindColor(X, Y, bonecolor, MIX1, MIY1, MIX2, MIY2)) THEN
begin
writeln('No bones found, looking for portal...')
repeat
if FindObjEx(X, Y, ['orta', 'nte'], [12010639, 11480961, 6953555, 5375801], 13, 50, MSX1, MSY1, MSX2, MSY2) and not FindObjEx(X, Y, ['arroc', 'alado', 'haryrl', 'umbridg'], [12010639, 11480961, 6953555, 5375801], 13, 50, MSX1, MSY1, MSX2, MSY2) THEN
begin
writeln('Portal found, moving to portal...')
Portal := true
Mouse(X, Y, 5, 5, 1);
wait(5000+random(1000))
bank;
end else

begin
writeln('Portal not found, rotating...')
Portal := false
SetAngle(SRL_ANGLE_LOW);
wait(500+random(200))
makecompass(randomrange(0, 360))
wait(600+random(200))
end;
until(Portal = true);
end else

begin
writeln('Looking for bones in inventory...')

if FindObjEx(X, Y, ['ur', 'one'], [bonecolor, bonecolor2, bonecolor3], 5, 50, MIX1, MIY1, MIX2, MIY2) THEN
begin
writeln('Bones found! Looking for altar...')
Mouse(X, Y, 5, 5, 0);
wait(100+ random(50))
ChooseOptionMulti(['Use']);
wait(100+ random(50))
Altar;
end;
end;
end;
end;


begin
disguise('Gilded Altar')
SetupSRL();
ActivateClient;
WriteLn('Starting...')
SelectWorld(330)
DeclarePlayers;
SRL_CombatRandoms := False;

repeat
if (not LoggedIn) then
begin
LogInPlayer;
setrun(true)
MouseSpeed := 25;
MakeCompass('N')
SetAngle(SRL_ANGLE_HIGH);
gametab(tab_Inv)
wait(1500+random(500))
writeln('Ready!')
end;

if (LoggedIn) then
begin
start;
end;
until(false);
end.


Now, I did not compile or run it, nor did I look for other errors. The spacing just really got to me, so I quickly fixed that a little. And, while i was spacing it, i noticed that you used a lot of FindObjEx. I know its your first script, but why not try learning TPAs or FindColorToloerance. (Just a recommendation)

Anyways, nice job! Congratz on the release. Maybe if I have time later today, I will try it out and look for those little errors that could show up! :D

Ryutoh

2013-05-04 13:38:01

Aha, thanks. I updated it under the attachments. I still get so many issues with the roads and minimap changing colors, it's frustrating.

jcarson1994

2013-05-04 14:54:01

Ill try as soon as i see someone post a proggy.

a nubs life

2013-05-05 16:34:18

The only issue I have is the walking. Once outside the portal, it just stands there as the Walk Numbers increase. It then angles camera attempting to find the bank, even though I actually haven't moved at all.

jman1208

2013-05-05 18:24:24

It would be easier to make a gilded altar for your own personal altar. Not everyone's house is the same, it will be extremely difficult to make it find an altar when they are in different places.

Ryutoh

2013-05-14 02:39:03

Could never get this to work perfectly right, so released a simpler script that'll do the fun job of clicking and using the bones on the altar instead.

bmitch5150

2013-05-20 17:32:27

Thanks

kpvols

2013-05-23 02:47:35

anyway to make it do dag bones?

Ryutoh

2013-05-25 01:59:59

From: kpvols
anyway to make it do dag bones?

Change bone color

bob_dole

2013-05-25 14:19:19

I made a script like this for teleport tablets. To get around the walking you need 50 construction and rings of dueling. Tele to castlewars, bank, tele home, exit portal, enter other guys home and go from there. Not only do you get around walking but it also saves loads of time. My teleport tablet script was able to run for hours and averaged 600k/hr.

As stated before, finding altars inside other people's houses is the main issue and will likely need customization by the user.

Seanx123

2013-06-02 23:04:45

[Error] (1:1): period ('.') expected at line 0
Compiling failed.

Any help with ths?

Brandon11214

2013-06-26 01:03:54

[Error] C:\Simba\Includes\SRL-OSR\SRL\misc\SmartGraphics.simba(22:3): Unknown identifier 'SmartSetDebug' at line 21
Compiling failed.


anyhelp with this?

xCamelx

2013-07-01 04:10:02

Just keeps changing camera angles after it right clicks on a bone lol.
Altar not found! Looking around…

Gestapo

2013-07-15 10:26:24

is this still working for burying bones?

samerdl

2013-07-15 11:03:32

ShatteredHand has an excellent G altar script on tribot, totally worth checking.


Also i don't see any Burner detection? i mean something simple like this


function FindBurners: boolean;
var
b,TmpCTS:integer;
tempTpa,TPA: tpointarray;
ATPA: T2DPointArray;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.20, 0.70);

FindColorsTolerance(TPA, 5795954,60, 50, 400, 250, 6)


ColorToleranceSpeed(TmpCTS);
setColorSpeed2Modifiers(0.2, 0.2);




if (length(tpa) <= 0) then exit;

SplitTPAWrap(tpa,100,atpa);
b := GetArrayLength(atpa);

writeln(b);



// writeln(length(atpa));
if ((b) >= 2) then
begin




result := true;

end;

end;

Tried it on low angles and it would work, just would sometimes give false positive when players were standing around with similar colors, nothing too bad tho just needs a better color for the burners smoke.