SRL Archive - RS3 Outdated / Broken Scripts

EastVarrockVialFiller


Sawyer

2013-01-25 00:03:13

This is my first attempt at a real script, so here it goes. I wasn't really getting enough testers at the "First Script" Section. It has been working well for me, but there is not currently any truly long tests. Start in the Varrock East Bank with empty vials viewable in your bank. No Pin support, sorry.
program EdgeVialFiller;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$i sps/sps.simba}

var
Status:String;
ToFountain:tpointarray;
ToBank:tpointarray;


procedure DeclarePlayers;
begin
Status := ('Logging in player.')
writeln('Logging in player.')
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
Active := True;
end;
end;

procedure SetupSmartClient;
begin
SRL_SixHourFix := True;
SMART_FixSpeed := True;

ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
SymbolAccuracy := 0.4;
end;

Procedure SetupBot;
begin
ClickNorth(0);
SPS_WalkPath(ToBank);
end;

Procedure Antiban; // Credit to Solidone40
Begin
Status :=('Antiban')
writeln('Antiban.')

Case Random(100) Of
1: HoverSkill('magic', False); //replace 'magic' with 'skill'
2: HoverSkill('random', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: HoverSkill('smithing', False); // replace 'smithing' with 'skill', or delete.
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
end;
mouse(658, 188, 3, 3, true);
end;

Procedure FindVials;
var
X, Y:Integer;

begin
Status :=('Opening bank and retrieving empty vials.');
writeln('Opening bank and retrieving empty vials.');
if BankScreen then
begin
if InvFull then
begin
DepositAll;
end;
FindObjCustom(x, y, ['Vial', 'Via'], [6578271, 6775650, 6051928], 2);
Mouse(x, y, 2, 2, false);
ChooseOption('All')
wait(Randomrange(500, 1000));
end;
if not BankScreen then
begin
FindObjCustom(x, y, ['Ban', 'Bank', 'Banker'], [4796471, 2889756, 3809319, 4796471, 3285286], 15);
Mouse(x, y, 2, 2, false);
ChooseOption('Bank Banker');
wait(randomrange(1500, 2000));
if InvFull then
begin
DepositAll;
end;
if FindObjCustom(x, y, ['Vial', 'Vial'], [6578271, 6775650, 6051928], 5) then
Mouse(x, y, 2, 2, false);
ChooseOption('All')
end;
begin
wait(Randomrange(500, 1000));
CloseBank;
Sps_walkpath(ToFountain);
Antiban;
end;
end;

Procedure FillVials;
var
x, y, EmptyVial, FillScreen:Integer;
begin
Status :=('Filling Vials...')
Writeln('Filling Vials...')
EmptyVial := DTMFromString('mKgEAAHic42NgYHBkYmBwA2JPIPYBYlcgtgViCyC2BmI7KN8JiN2h6kB6pBkZGEQZIbQCEKsCsQqULQnEQkDMB8TsQMwLxMpQNQkJKUBbmUjGzECSHMxIJkYFACLaBrc=');
wait(randomrange(1000, 1500));
if FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
writeln('Found Vials in inventory.');
Mouse(x, y, 2, 2, false);
ChooseOption('Use');
if not FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
writeln('Did not find vials in inventory.');
if FindObjCustom(x, y, ['Vial', 'use', 'Use', 'Foun'], [16100232, 14786173, 13800052], 5) then
Mouse(x, y, 2, 2, false);
chooseoption('Use Vial');
wait(2000);
FillScreen := BitmapFromString(32, 13, 'meJylkT0KwlAQhJsk/jTewcZ7CD' +
'aCrU0qi1SpBAtFvYGdrYWNjV5F8BBexIV9DEN29ykIXzHs/PBI6ml' +
'Z/8ZoPBHy2rKaFUCTFrVez7egF1fzFGjmlYKkJbPJGlNMuyiVTotB' +
'QHW0jylmtywUTuLI6Fon+bV1rCuFkzi6bqRtSzg1PSXzfazrakwx5' +
'7av/P9/McVc1onM+63rakwx181A4SSOrhtp2xJu2wQncXTdSNuW8D' +
'gMFU7i6LqRti3hvk9wEkfXjbRtCR8mW9lU');
wait(1000);
FindBitmapToleranceIn(FillScreen, x, y, MSX1, MSY1, MSX2, MSY2, 5);
writeln('Found Fill Screen.');
wait(randomrange(500, 1000));
mouse(x, y, 5, 5, true);
wait(randomrange(16000, 20000));
FreeBitmap(FillScreen);
FreeDTM(EmptyVial);
SPS_WalkPath(ToBank);
Antiban;
end;

procedure Bank;
var
x, y, VialOfWater:Integer;

begin
VialOfWater := DTMFromString('mPwEAAHic42dgYHBkYmDwAGIfIHaCsr2A2A2I3Zkg8rZQbAXFdkBsAcTSjAwMEkCsAMSqQKwMxDJALAzEfEDMDqVFGSFqQfIqQCwHxJUNW4G2M5GFmYEkuZiRAowGAF32B6A=');
Status :=('Banking.')
writeln('Banking.')
wait(randomrange(2000, 3500));
if FindObjCustom(x, y, ['Ban', 'Bank', 'Banker'], [4796471, 2889756, 3809319, 4796471, 3285286], 15) then
begin
Mouse(x, y, 2, 2, false);
wait(500);
ChooseOption('Bank Banker');
wait(randomrange(1000, 1250));
if FindDTM(VialOfWater, x, y, 551, 257, 724, 502) then
begin
wait(randomrange(750, 1500));
mouse(x, y, 2, 2, false);
chooseOption('All');
end;
end;
if not FindDTM(VialOfWater, x, y, 551, 257, 724, 502) then
writeln('Could Not find vials to bank in your inventory.');
FreeDTM(VialOfWater);
end;

Procedure Paths;
begin
ToFountain := [Point(126, 134), Point(126, 121), Point(115, 113), Point(100, 112), Point(87, 113), Point(76, 110), Point(69, 97)]
ToBank := [Point(62, 98), Point(72, 110), Point(86, 114), Point(99, 113), Point(115, 112), Point(126, 116), Point(128, 126), Point(127, 139), Point(125, 151)]
end;

procedure testpath;
begin
if sps_walkpath(ToFountain) then
status := 'walking to the fountain'
else begin
status :='failed walking to the fountain';
writeln(status + ' + time running:' +timerunning);
end;
writeln(status + ' + time running:' +timerunning);
end;







begin
SetupSmartClient;
SPS_Setup(runescape_other,['Varrock_East_Bank']);
Paths;
SetupBot;
//testpath;
repeat
FindVials;
FillVials;
Bank;
Until(Allplayersinactive)
end.
[ATTACH=CONFIG]18817[/ATTACH]
Use this map. Save it to Simba/Includes/sps/img/runescape_other and it should work :)

tealc

2013-01-27 18:36:25

So far its working decent I had to add a couple of semi colons and i made a couple suggestions

sometimes it walks to varrock center fountain

your missing semi-colons on a couple lines mainly after writeln()

it will sometimes withdraw vials of water instead of empty vials



if FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
writeln('Found Vials in inventory.');
Mouse(x, y, 2, 2, false);
ChooseOption('Use');
if not FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
writeln('Did not find vials in inventory.');
^^^^try using else instead of if not and 505 is out of bounds but simba auto fixes it to 502

largovich

2013-01-31 14:49:12

Are you aiming to get it flawless?

Sawyer

2013-02-01 00:36:10

Possibly. I am working on like four scripts at once now and haven't touched this one for a while… :/ I'll find time between school and wrestling :p A few more weeks and I'll have Saturdays. Most Saturdays I have nowadays I'm either at a wrestling meet or studying.

Justin

2013-02-02 23:21:11

@Sawyer

When running your script, I noticed some improvements you can implement.

When searching for empty vials, it also detects other potions in your bank, try using a DTM.

When you are searching for the 'Fill' bitmap, you are out if client boundaries. Try changing
2, 46, 510, 367
to
MSX1, MSY1, MSX2, MSY2

Script is running as of 3/02/2013 but could be improved.

Output:

SRL Compiled in 0 msec
Paired with SMART[3956]
Logging in player.
Current player:
Opening bank and retrieving empty vials.
Antiban.
Filling Vials...
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Vials in inventory.
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Fill Screen.
Antiban.
Banking.
Opening bank and retrieving empty vials.
Antiban.
Filling Vials...
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Vials in inventory.
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Fill Screen.
Antiban.
Banking.
Opening bank and retrieving empty vials.
Antiban.
Filling Vials...
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Vials in inventory.
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Fill Screen.
Antiban.
Banking.
Opening bank and retrieving empty vials.
Antiban.
Filling Vials...
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Found Vials in inventory.
Warning! You passed a wrong ye to a finder function: 505. The client has a height of 503, thus the ye is out of bounds. Setting the value to 502 (h-1) for now.
Successfully executed.
The following DTMs were not freed: [2]

Sawyer

2013-02-04 18:59:08

Alright, thanks :) i keep forgetting that there is already coords for the mainscreen and I don't have to find them :P

Gucci

2013-02-04 22:17:20

You should use else statements to remove some unnecessary code

Like change this:

if FindDTM(VialOfWater, x, y, 551, 257, 724, 502) then
begin
wait(randomrange(750, 1500));
mouse(x, y, 2, 2, false);
chooseOption('All');
end;
end;
if not FindDTM(VialOfWater, x, y, 551, 257, 724, 502) then
writeln('Could Not find vials to bank in your inventory.');

To:

if FindDTM(VialOfWater, x, y, 551, 257, 724, 502) then
begin
wait(randomrange(750, 1500));
mouse(x, y, 2, 2, false);
chooseOption('All');
end;
end else writeln('Could Not find vials to bank in your inventory.');

And this:

  if FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
writeln('Found Vials in inventory.');
Mouse(x, y, 2, 2, false);
ChooseOption('Use');
if not FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
writeln('Did not find vials in inventory.');

To:

  if FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
begin
writeln('Found Vials in inventory.');
Mouse(x, y, 2, 2, false);
ChooseOption('Use');
end else writeln('Did not find vials in inventory.');

And like Justin said change:
if FindDTM(EmptyVial, x, y, 551, 257, 724, 505)
to:
if FindDTM(EmptyVial, x, y, MSX1, MSY1, MSX2, MSY2) then

And I think the way the code is set up if it generates a number other than 1-8 then it won't to the AntiBan so change it too:

Procedure Antiban; // Credit to Solidone40
Begin
Status :=('Antiban')
writeln('Antiban.')

Case Random(100) Of
1..20: HoverSkill('magic', False); //replace 'magic' with 'skill'
21..40: HoverSkill('random', False);
41..50: Boredhuman;
51..60: Wait(2500 + random(4500));
61..70: HoverSkill('smithing', False); // replace 'smithing' with 'skill', or delete.
71..80: PickUpMouse;
81..90: RandomMovement;
91..100: RandomRClick;
end;
mouse(658, 188, 3, 3, true);
end;

Overall it's a nice first script the standards need work, good job.

rick2000sept

2013-03-14 14:22:05

I am new to simba botting, and I like your script. There are issues with it. Taking into account what everyone said, here is the version of your sccript I am using. (Note I changed SMART8 to SMART for my own personal use)

program EdgeVialFiller;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$i sps/sps.simba}

var
Status:String;
ToFountain:tpointarray;
ToBank:tpointarray;


procedure DeclarePlayers;
begin
Status := ('Logging in player.')
writeln('Logging in player.')
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
Active := True;
end;
end;

procedure SetupSmartClient;
begin
SRL_SixHourFix := True;
SMART_FixSpeed := True;

ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
SymbolAccuracy := 0.4;
end;

Procedure SetupBot;
begin
ClickNorth(0);
SPS_WalkPath(ToBank);
end;

Procedure Antiban; // Credit to Solidone40
Begin
Status :=('Antiban')
writeln('Antiban.')

Case Random(100) Of
1..20: HoverSkill('magic', False); //replace 'magic' with 'skill'
21..40: HoverSkill('random', False);
41..50: Boredhuman;
51..60: Wait(2500 + random(4500));
61..70: HoverSkill('smithing', False); // replace 'smithing' with 'skill', or delete.
71..80: PickUpMouse;
81..90: RandomMovement;
91..100: RandomRClick;
end;
mouse(658, 188, 3, 3, true);
end;

Procedure FindVials;
var
X, Y:Integer;

begin
Status :=('Opening bank and retrieving empty vials.');
writeln('Opening bank and retrieving empty vials.');
if BankScreen then
begin
if InvFull then
begin
DepositAll;
end;
FindObjCustom(x, y, ['Vial', 'Via'], [6578271, 6775650, 6051928], 2);
Mouse(x, y, 2, 2, false);
ChooseOption('All')
wait(Randomrange(500, 1000));
end;
if not BankScreen then
begin
FindObjCustom(x, y, ['Ban', 'Bank', 'Banker'], [4796471, 2889756, 3809319, 4796471, 3285286], 15);
Mouse(x, y, 2, 2, false);
ChooseOption('Bank Banker');
wait(randomrange(1500, 2000));
if InvFull then
begin
DepositAll;
end;
if FindObjCustom(x, y, ['Vial', 'Vial'], [6578271, 6775650, 6051928], 5) then
Mouse(x, y, 2, 2, false);
ChooseOption('All')
end;
begin
wait(Randomrange(500, 1000));
CloseBank;
Sps_walkpath(ToFountain);
Antiban;
end;
end;

Procedure FillVials;
var
x, y, EmptyVial, FillScreen:Integer;
begin
Status :=('Filling Vials...')
Writeln('Filling Vials...')
EmptyVial := DTMFromString('mKgEAAHic42NgYHBkYmBwA2JPIPYBYlcgtgViCyC2BmI7KN8JiN2h6kB6pBkZGEQZIbQCEKsCsQqULQnEQkDMB8TsQMwLxMpQNQkJKUBbmUjGzECSHMxIJkYFACLaBrc=');
wait(randomrange(1000, 1500));
if FindDTM(EmptyVial, x, y, 551, 257, 724, 505) then
begin
writeln('Found Vials in inventory.');
Mouse(x, y, 2, 2, false);
ChooseOption('Use');
end else writeln('Did not find vials in inventory.');
if FindObjCustom(x, y, ['Vial', 'use', 'Use', 'Foun'], [16100232, 14786173, 13800052], 5) then
Mouse(x, y, 2, 2, false);
chooseoption('Use Vial');
wait(2000);
FillScreen := BitmapFromString(32, 13, 'meJylkT0KwlAQhJsk/jTewcZ7CD' +
'aCrU0qi1SpBAtFvYGdrYWNjV5F8BBexIV9DEN29ykIXzHs/PBI6ml' +
'Z/8ZoPBHy2rKaFUCTFrVez7egF1fzFGjmlYKkJbPJGlNMuyiVTotB' +
'QHW0jylmtywUTuLI6Fon+bV1rCuFkzi6bqRtSzg1PSXzfazrakwx5' +
'7av/P9/McVc1onM+63rakwx181A4SSOrhtp2xJu2wQncXTdSNuW8D' +
'gMFU7i6LqRti3hvk9wEkfXjbRtCR8mW9lU');
wait(1000);
FindBitmapToleranceIn(FillScreen, x, y, MSX1, MSY1, MSX2, MSY2, 5);
writeln('Found Fill Screen.');
wait(randomrange(500, 1000));
mouse(x, y, 5, 5, true);
wait(randomrange(16000, 20000));
FreeBitmap(FillScreen);
FreeDTM(EmptyVial);
SPS_WalkPath(ToBank);
Antiban;
end;

procedure Bank;
var
x, y, VialOfWater:Integer;

begin
VialOfWater := DTMFromString('mPwEAAHic42dgYHBkYmDwAGIfIHaCsr2A2A2I3Zkg8rZQbAXFdkBsAcTSjAwMEkCsAMSqQKwMxDJALAzEfEDMDqVFGSFqQfIqQCwHxJUNW4G2M5GFmYEkuZiRAowGAF32B6A=');
Status :=('Banking.')
writeln('Banking.')
wait(randomrange(2000, 3500));
if FindObjCustom(x, y, ['Ban', 'Bank', 'Banker'], [4796471, 2889756, 3809319, 4796471, 3285286], 15) then
begin
Mouse(x, y, 2, 2, false);
wait(500);
ChooseOption('Bank Banker');
wait(randomrange(1000, 1250));
if FindDTM(VialOfWater, x, y, 551, 257, 724, 502) then
begin
wait(randomrange(750, 1500));
mouse(x, y, 2, 2, false);
chooseOption('All');
end;
end else writeln('Could Not find vials to bank in your inventory.');
FreeDTM(VialOfWater);
end;

Procedure Paths;
begin
ToFountain := [Point(126, 134), Point(126, 121), Point(115, 113), Point(100, 112), Point(87, 113), Point(76, 110), Point(69, 97)]
ToBank := [Point(62, 98), Point(72, 110), Point(86, 114), Point(99, 113), Point(115, 112), Point(126, 116), Point(128, 126), Point(127, 139), Point(125, 151)]
end;

procedure testpath;
begin
if sps_walkpath(ToFountain) then
status := 'walking to the fountain'
else begin
status :='failed walking to the fountain';
writeln(status + ' + time running:' +timerunning);
end;
writeln(status + ' + time running:' +timerunning);
end;







begin
SetupSmartClient;
SPS_Setup(runescape_other,['Varrock_East_Bank']);
Paths;
SetupBot;
//testpath;
repeat
FindVials;
FillVials;
Bank;
Until(Allplayersinactive)
end.


I did find that the best way to overcome the error where your script withdraws vials of water instead of empty vials is to make sure that the empty vials are closer to the bottom right corner of your bank than your water vials are. This way, the script just goes to the empty ones and doesnt try to distinguish.

I have no coding solution for this though, as I am completely new to this simba stuff.

Pat


EDIT: Ok, the placement of the vials only reduces the frequency of the script making the mistake. Trying putting the vials of water out of sight via use of bank tabs or items, and that seems to be working. lol

Sawyer

2013-03-16 18:24:40

Try creating your own custom Dtm for the vials. Go to tools? In simba and select DTM Editor. Make sure the crosshairs have been dragged onto runescape, and then put one point on the middle of the vial with a high tolerance, the other points on the black outside of the vial.

rick2000sept

2013-03-17 18:09:21

I may try that. An idea that I like better than that though is modeling the bank withdrawal like the TopicTanner where you specify in the script which bank slot you have the empty vials. Then it won't ever make a mistake.

Other problems I have with this script:
-about 1/4 of the time it doesn't actually interact with the fountain, even though it thinks that it is, so no vials get filled.
-every 10th trip or so, rather than going to the fountain, it keeps going west. My bot ends up in west varrock bank area… so I have to babysit it and put it back on track. This also happens when trying to return to the bank except the bot goes south of the fountain to the shop.

Haha I don't mean to be critical, I would just really like to have this script working 100 percent because filling vials is a great money making method. Using a powerbot script, I can fill up to 2500 per hour and profit about 30-35k per hour. I would love to see similar results from this script if possible.

Pat