SRL Archive - General Botting Help

something weird after banking


Spaceblow

2014-09-05 18:58:17

Hello, it's me again. I have an annoying problem in the script I've released that I can't figure out. Appearantly, bankScreen.open(BANK_NPC_BLUE) isn't working anymore so I had to replace it by mainscreen.findObject. Everything goes well, the player runs to the bank, opens the bank, deposits its stuff and closes the bank. After that it just has to continue its journey back to where it came from, but it doesn't do that right away. A second after it closes the bank it tries to open the backpack or something, I made a little video about it so you could know what I'm talking about. I really have no idea what could be wrong in my procedure. This is my full procedure and underneath it you can see the text that comes in the debug window. In the debug window it says something about opening tab number 2 (the backpack) but I didn't put anything in that procedure to make it do that. I hope anyone could help me out with this, thanks in advance! :)

procedure bankRedberries();
var
bankTimer: TTimeMarker;
pathFail: TPointArray;
x, y, findFails: integer;

begin
if not isLoggedIn() then
exit;

if not tabBackpack.isFull() then
exit;

minimap.setAngle(MM_DIRECTION_SOUTH);
mainScreen.setAngle(MS_ANGLE_HIGH);

pathFail := [Point(118, 133), Point(118, 169)]; //in case the player somehow didn't got in the bank, but outside of it
findFails := 0;

repeat
mainscreen.findObject(x, y, 5910088, 11, colorSetting(2, 0.42, 0.59), mainscreen.playerPoint, 30, 50, 50, ['ank'], MOUSE_RIGHT); //bankScreen.open(BANK_NPC_BLUE) wasn't working
if not chooseOption.select(['ank']) then
begin
inc(findFails);
if SPS.walkPath(pathFail) then
minimap.waitPlayerMoving();
end;
_waitBankOrPinscreen(10000);
until (bankScreen.isOpen) or (findFails > 5);

if bankScreen.isOpen() then
begin
bankTimer.start();
writeLn('--------------------------------------------------------------------------- Succesfully opened the bank. (' + theTime + ')');
repeat
begin
wait(randomRange(600, 900));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomRange(600, 900));
bankScreen.close();
writeLn('--------------------------------------------------------------------------- Succesfully closed the bank. (' + theTime + ')');
end;
until(tabBackpack.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 7000);

if tabBackpack.isEmpty() then
begin
writeLn('--------------------------------------------------------------------------- Succesfully banked Redberries. (' + theTime + ')');
inc(LoadsDone);
wait(randomRange(750, 1250));
writeLn('--------------------------------------------------------------------------- Running to redberries. (' + theTime + ')');
end;
end else
begin
inc(BankFails);
if (BankFails > 5) then
begin
writeLn('--------------------------------------------------------------------------- Still didn''t find bank, terminating the script. (' + theTime + ')');
terminateScript
end;

writeLn('--------------------------------------------------------------------------- Could not open bank, trying to find it. (' + theTime + ')');
wait(randomRange(750, 1000));

if SPS.walkPath(pathFail) then
minimap.waitPlayerMoving();

wait(randomRange(750, 1000));
bankRedberries();
end;

if tabBackpack.isEmpty() then
begin
exit;
end else
bankRedberries();
end;

-- TRSMainscreen.findObject()
---- Colors found: 715
---- Possible objects found: 6
---- isMouseOverText()
------ Current mouse-over text: ""
------ Current mouse-over text: ""
------ Current mouse-over text: "Bank Banker"
------ Found "ank" in mouse-over string: "Bank Banker"
---- isMouseOverText(): True
---- Successfully mouse'd object
-- TRSMainscreen.findObject(): True
-- TRSChooseOption._select():
---- Options found: [Bank Banker, Talk-to Banker, Collect Banker, Walk here, Examine Banker, Cancel]
---- Found option "ank" in "Bank Banker"
-- TRSChooseOption.select() result = true
--------------------------------------------------------------------------- Succesfully opened the bank. (12:35:48 AM)
---- bankScreen.quickDeposit(): Clicked quick deposit id 0
--------------------------------------------------------------------------- Succesfully closed the bank. (12:35:50 AM)
-- TRSGameTabs.openTab(2)
---- Opening tab via gametab navigation bar
-- TRSGameTabs.openTab(2): result = False
-- TRSGameTabs.openTab(2)
---- Opening tab via gametab navigation bar
---- Succesfully freed SMART[3388]
---- Freeing gametabs bitmaps...
Successfully executed.

Hoodz

2014-09-05 19:29:29

I read it very fast but i believe whats causing this, is that you check if your inventory is empty right after you closed the bank. Thats why it will open the inventory

Spaceblow

2014-09-06 04:23:06

From: hoodz
I read it very fast but i believe whats causing this, is that you check if your inventory is empty right after you closed the bank. Thats why it will open the inventory
I also thought that would be causing the problem but appearantly it was something else. The problem was that the icons weren't arranged correctly, so Simba kind of messes it up. I fixed the issue by choosing the old school preset. Thanks for your help though, I appreciate it. :)

How it should be:

How it shouldn't be:

The Mayor

2014-09-06 06:16:06

From: Spaceblow
I also thought that would be causing the problem but appearantly it was something else. The problem was that the icons weren't arranged correctly, so Simba kind of messes it up. I fixed the issue by choosing the old school preset. Thanks for your help though, I appreciate it. :)

How it should be:

How it shouldn't be:


Tab order has got noting to do with the error. GameTabs work using bitmaps so order doesn't matter. Your script tries to open the backpack because, well, you tell it to :p


repeat
begin
wait(randomRange(600, 900));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomRange(600, 900));
bankScreen.close();
writeLn('--------------------------------------------------------------------------- Succesfully closed the bank. (' + theTime + ')');
end;
until(tabBackpack.isEmpty()) or (not isLoggedIn()) or (bankTimer.getTime() > 7000);

Right after you close the bank, it hits the first clause in your until statement, which is…. tabBackpack.isEmpty(). You can see that function, like most SRL6 interface functions checks that the interface is actually open before continuing with the function:


function TRSTabBackpack.isEmpty: boolean;
begin
if (not self.open()) then
exit(false);

result := (not (self.getBounds().colorExists(ITEM_OUTLINE_BLACK)));
end;

A better way to write your loop would be to use bankScreen.getPackCount(), and close the bank only when the pack is actually empty:


repeat
wait(randomRange(600, 900));
bankScreen.quickDeposit(QUICK_DEPOSIT_INVENTORY);
wait(randomRange(600, 900));
until(bankScreen.getPackCount() = 0) or (not isLoggedIn()) or (bankTimer.getTime() > 7000);

bankScreen.close();


Spaceblow

2014-09-06 06:23:28

From: The Mayor
Tab order has got nothing to do with the error. GameTabs work using bitmaps so order doesn't matter. Your script tries to open the backpack because, well, you tell it to :p
But then I'm wondering, if it has nothing to do with the order, then why doesn't it try to open the backpack when it's placed as first?

The Mayor

2014-09-06 06:32:19

From: Spaceblow
But then I'm wondering, if it has nothing to do with the order, then why doesn't it try to open the backpack when it's placed as first?


I just watched your little video. Now I suspect it's something else (although what I said above still stands).

Go to C:\Simba\Includes\srl-6\lib\interfaces\gametabs and open gametabs.simba. Go down to GameTabs.__initTabs() (approx line 150) and and paste here what you have for the backpack tab. E.g.:


with self.tabs[TAB_BACKPACK] do
begin
_bmp := bitmapFromString(3, 8, 'meJxTss0x7d3Co2xpndScv+dpUudq/drpSrY5FrnrgSL8YkHCMrlABlANUAoo7lo5JWHDYaA4J58akARqBCIgAwC+OReT');
_navBarId := NAV_BUTTON_GEAR;
_navBarBoxIndex := 1;
end;

Spaceblow

2014-09-06 06:56:46

From: The Mayor
I just watched your little video. Now I suspect it's something else (although what I said above still stands).

Go to C:\Simba\Includes\srl-6\lib\interfaces\gametabs and open gametabs.simba. Go down to GameTabs.__initTabs() (approx line 150) and and paste here what you have for the backpack tab. E.g.:


with self.tabs[TAB_BACKPACK] do
begin
_bmp := bitmapFromString(3, 8, 'meJxTss0x7d3Co2xpndScv+dpUudq/drpSrY5FrnrgSL8YkHCMrlABlANUAoo7lo5JWHDYaA4J58akARqBCIgAwC+OReT');
_navBarId := NAV_BUTTON_GEAR;
_navBarBoxIndex := 1;
end;
I guess I have the same stuff like you.

  with self.tabs[TAB_BACKPACK] do
begin
_bmp := bitmapFromString(3, 8, 'meJxTss0x7d3Co2xpndScv+dpUudq/drpSrY5FrnrgSL8YkHCMrlABlANUAoo7lo5JWHDYaA4J58akARqBCIgAwC+OReT');
_navBarId := NAV_BUTTON_GEAR;
_navBarBoxIndex := 1;
end;

The Mayor

2014-09-06 07:05:11

From: Spaceblow
I guess I have the same stuff like you.

  with self.tabs[TAB_BACKPACK] do
begin
_bmp := bitmapFromString(3, 8, 'meJxTss0x7d3Co2xpndScv+dpUudq/drpSrY5FrnrgSL8YkHCMrlABlANUAoo7lo5JWHDYaA4J58akARqBCIgAwC+OReT');
_navBarId := NAV_BUTTON_GEAR;
_navBarBoxIndex := 1;
end;


That's the outdated one :p Ian updated those a few days back, but they are only in the new simba. Replace it with:


with self.tabs[TAB_BACKPACK] do
begin
_bmp := bitmapFromString(10, 2, 'meJzjktQQlLJTdu4AIgHJICCbi1lZwsjLJnuiqGIBkAtBSq5ZQARUAyRB6lOqgIoBZmsMmA==');
_navBarId := NAV_BUTTON_GEAR;
_navBarBoxIndex := 1;
end;

Actually, quite a few of your tabs will be outdated then. I think I posted my gametabs.simba on the last page of my VEB miner of you wanna use that.

Spaceblow

2014-09-06 08:29:40

From: The Mayor
That's the outdated one :p Ian updated those a few days back, but they are only in the new simba. Replace it with:
I really appreciate your help The Mayor, but I think I'm going to wait until the next stable Simba will be released. The bug gives the script a delay of about 7 seconds everytime it banks, it banks about 4 times per hour, so that would be 28 seconds delay per hour, so it's just a little bug. The procedure is for the people using my script. If I would update the gametab.simba file, then it would be only having an effect on me. Otherwise I would have to tell the script users to download even a file more (they already need 3 files) and that would be kind of annoying for them. The bug doesn't really have an impact on the profit unless someone runs the script for 24 hours straight. And I don't think it's possible to override 'with self.tabs[TAB_BACKPACK] do' by using a procedure , right?

Is Wizzup? the Ian you're talking about? And do you have any idea on when the next stable release will be? I definitely can wait patiently, I'm just asking this because I'm probably going to make another script which needs several stuff that are broken at the moment, and also just out of curiosity. :)