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.
