Results 1 to 7 of 7

Thread: Please tell me what's wrong.

  1. #1
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Please tell me what's wrong.

    Hey guys,

    For the last few hours I've been trying to make an al-kharid dessert beer glass collector.

    It collects beer glasses (Searches the shelves) then banks them at the al kharid bank, then repeats.

    The problem is the banking part, I've tried multiple methods to locate the bank booth or the banker, I've tried DTM, colour...All don't seem to work well.

    Also, when I start the my script it will right click at the top left hand corner of the RS screen and just sit there? It's a common bug that always happens. Quite annoying and I've been trying my hardest to fix it, but I can't seem to find a valid reason.

    Anyways, here's my script so far. Please tell me what I can improve on and what a better method to locate bank is.

    Simba Code:
    program GlassGrabber;

    {$i SRL\SRL.scar}
    {$i sps/sps.simba}

    Var
    Path:TPointArray;


    Procedure DepositGlass;
    Var
    X, Y:Integer;
    Begin
      Begin
      X:=215
      Y:=160
      MMouse(X, Y, 3, 3);
      wait(RandomRange(200,100));
      Mouse(X, Y, 0, 0, False);
      ChooseOption('quickly');
      wait(RandomRange(1000,700));
      DepositAll;
      wait(RandomRange(2000,1000));
      CloseBank;
      end;
    end;

    Function GetGlass:Boolean;
    Var
    A, B:Integer;
    Begin
    SetAngle(True);
    FindObj(A, B, 'earch Shelv', 3164471 , 5);
    wait(RandomRange(500,200));
    MMouse(A, B, 5, 5);
    wait(RandomRange(500,300));
    Mouse(A, B, 0, 0, False);
    ChooseOption('alk here');
    wait(RandomRange(3000,2000));

    if FindObj(A, B, 'earch Shelv', 3164471 , 5) Then
      Begin
      MMouse(A, B, 5, 5);
      wait(RandomRange(200,90));
        if IsUpText('earch Shelv') Then
          Repeat
          wait(RandomRange(2500,1600));
          Mouse(A, B, 0, 0, True);
          until(InvFull);
          writeln('Inventory is full. Going to bank.')
      end;
    end;

    Procedure ToBank;

    Var
    Path:TPointArray;
    begin
    SPS_Setup(RUNESCAPE_SURFACE, ['12_10', '12_9']);
    Path := [Point(5089, 4084), Point(5040, 4069), Point(4980, 4058), Point(4941, 4027), Point(4921, 3996)];
    writeln('Walking to the bank! :)');
    SPS_WalkPath(Path);
    wait(randomrange(1000,800));
    End;

    Procedure ToShelves;

    Var
    Path:TPointArray;
    begin
    SPS_SETUP(RUNESCAPE_SURFACE, ['12_10', '12_9']);
    Path := [Point(4940, 4024), Point(4971, 4058), Point(5019, 4067), Point(5075, 4075), Point(5114, 4103)];
    writeln('Walking back the the shelves to get more glass! :)');
    SPS_WalkPath(Path);
    wait(randomrange(1000,700));
    end;
    Procedure StepToBooth;
    Var
    X, Y, Tile:Integer;
    begin
    Tile := DTMFromString('mggAAAHicY2NgYFBlgAB2IBYBYj4g5gJiXyCeAMRZUHklIHYG4pkloQyP9k9neHVsNhj/urwMjJmAcsxYMCMODAEAL8sPOA==');
    FindDTM(Tile, X, Y, MSX1, MSY1, MSX2, MSY2)
    MMouse(X, Y, 2, 2);
    Wait(500+random(500));
    Mouse(X, Y, 3, 3, True);
    Wait(1000+random(500));
    FreeDTM(Tile);
    end;




    begin
    SETUPSRL;
    ClickNorth(True);
    repeat
      if not InvFull then
      begin
      wait(1000+random(500));
      ToShelves;
      wait(1000+Random(500));
      Getglass;
      end;
        if InvFull Then
        begin
        wait(1000+random(500));
        ToBank;
        wait(1000+random(500));
        StepToBooth;
        Wait(1000+Random(500));
        DepositGlass;
        wait(1000+Random(500));
        end;
    until(false)


    end.

    Thanks guys Looking forward to comments.

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Check out bank.scar in SRL, it has pre-made banking functions.
    Also DTMS suck for the mainscreen most of the time, don't use them there!
    Why not find bank same way you search shelves, with FindObj?

  3. #3
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Check out bank.scar in SRL, it has pre-made banking functions.
    Also DTMS suck for the mainscreen most of the time, don't use them there!
    Why not find bank same way you search shelves, with FindObj?
    Wow, Thanks for the fast reply!

    Yeah, I've tried with FindObj, but the colours of the booth and the bankers are not unique and the surroundings usually interfere with it.

    Any idea what is causing the top left screen right click bug? Been trying to figure that out for hours would be great if you could take a look .

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Didn't read that part just glaceed.
    That happens normally if you forget a GetMousePos(X,Y) (or in your case A,B) but might be something else, try sprinkling some more of those in somewhere.

    When does this normally happen again? Within which procedure do you think?

  5. #5
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Didn't read that part just glaceed.
    That happens normally if you forget a GetMousePos(X,Y) (or in your case A,B) but might be something else, try sprinkling some more of those in somewhere.

    When does this normally happen again? Within which procedure do you think?
    It's the first thing that happens when I start the script. I think it's after the script realises that inventory is full.

    Anyways, checked out banking.scar, going to try out some of those now, they seem really cool

  6. #6
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Still not working.

    The right clicking thing went away, but now it doesn't attempt to find a banker at all.

    I'm using FindBank from banking.scar

    Simba Code:
    program GlassGrabber;

    {$i SRL\SRL.scar}
    {$i sps/sps.simba}

    Var
    Path:TPointArray;


    Procedure DepositGlass;
    Begin
      Begin
      FindBank('akb');
      wait(1000+Random(500));
      DepositAll;
      wait(RandomRange(2000,1000));
      CloseBank;
      end;
    end;

    Function GetGlass:Boolean;
    Var
    A, B:Integer;
    Begin
    SetAngle(True);
    FindObj(A, B, 'earch Shelv', 3164471 , 5);
    wait(RandomRange(500,200));
    MMouse(A, B, 5, 5);
    wait(RandomRange(500,300));
    Mouse(A, B, 0, 0, False);
    ChooseOption('alk here');
    wait(RandomRange(3000,2000));

    if FindObj(A, B, 'earch Shelv', 3164471 , 5) Then
      Begin
      MMouse(A, B, 5, 5);
      wait(RandomRange(200,90));
        if IsUpText('earch Shelv') Then
          Repeat
          wait(RandomRange(2500,1600));
          Mouse(A, B, 0, 0, True);
          until(InvFull);
          writeln('Inventory is full. Going to bank.')
      end;
    end;

    Procedure ToBank;

    Var
    Path:TPointArray;
    begin
    SPS_Setup(RUNESCAPE_SURFACE, ['12_10', '12_9']);
    Path := [Point(5089, 4084), Point(5040, 4069), Point(4980, 4058), Point(4941, 4027), Point(4921, 3996)];
    writeln('Walking to the bank! :)');
    SPS_WalkPath(Path);
    wait(randomrange(1000,800));
    End;

    Procedure ToShelves;

    Var
    Path:TPointArray;
    begin
    SPS_SETUP(RUNESCAPE_SURFACE, ['12_10', '12_9']);
    Path := [Point(4940, 4024), Point(4971, 4058), Point(5019, 4067), Point(5075, 4075), Point(5114, 4103)];
    writeln('Walking back the the shelves to get more glass! :)');
    SPS_WalkPath(Path);
    wait(randomrange(1000,700));
    end;
    //Procedure StepToBooth;
    //Var
    //X, Y, Tile:Integer;
    //begin
    //Tile := DTMFromString('mggAAAHicY2NgYFBlgAB2IBYBYj4g5gJiXyCeAMRZUHklIHYG4pkloQyP9k9neHVsNhj/urwMjJmAcsxYMCMODAEAL8sPOA==');
    //FindDTM(Tile, X, Y, MSX1, MSY1, MSX2, MSY2)
    //MMouse(X, Y, 2, 2);
    //Wait(500+random(500));
    //Mouse(X, Y, 3, 3, True);
    //Wait(1000+random(500));
    //FreeDTM(Tile);
    //end;




    begin
    SETUPSRL;
    ClickNorth(True);
    repeat
      if not InvFull then
      begin
      wait(1000+random(500));
      ToShelves;
      wait(1000+Random(500));
      Getglass;
      end;
        if InvFull Then
        begin
        wait(1000+random(500));
        ToBank;
        wait(1000+random(500));
        DepositGlass;
        wait(1000+Random(500));
        end;
    until(false)


    end.

  7. #7
    Join Date
    Feb 2009
    Posts
    484
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Wow, can't believe it!

    I managed to fix the script! It's going flawless now!

    Here it is if anyone is interested:

    Simba Code:
    program GlassGrabber;

    {$i SRL\SRL.scar}
    {$i sps/sps.simba}

    Var
    Path:TPointArray;


    Procedure DepositGlass;
    Var
    X, Y:Integer;
    Begin
      Begin
      OpenBankFast('akb');
      wait(RandomRange(1000,700));
      DepositAll;
      wait(RandomRange(2000,1000));
      CloseBank;
      end;
    end;

    Function GetGlass:Boolean;
    Var
    A, B:Integer;
    Begin
    SetAngle(True);
    FindObj(A, B, 'earch Shelv', 3164471 , 5);
    wait(RandomRange(500,200));
    MMouse(A, B, 5, 5);
    wait(RandomRange(500,300));
    Mouse(A, B, 0, 0, False);
    ChooseOption('alk here');
    wait(RandomRange(3000,2000));

    if FindObj(A, B, 'earch Shelv', 3164471 , 5) Then
      Begin
      MMouse(A, B, 5, 5);
      wait(RandomRange(200,90));
        if IsUpText('earch Shelv') Then
          Repeat
          wait(RandomRange(2500,1600));
          Mouse(A, B, 0, 0, True);
          until(InvFull);
          writeln('Inventory is full. Going to bank.')
      end;
    end;

    Procedure ToBank;

    Var
    Path:TPointArray;
    begin
    SPS_Setup(RUNESCAPE_SURFACE, ['12_10', '12_9']);
    Path := [Point(5089, 4084), Point(5040, 4069), Point(4980, 4058), Point(4941, 4027), Point(4921, 3996)];
    writeln('Walking to the bank! :)');
    SPS_WalkPath(Path);
    wait(randomrange(1000,800));
    End;

    Procedure ToShelves;

    Var
    Path:TPointArray;
    begin
    SPS_SETUP(RUNESCAPE_SURFACE, ['12_10', '12_9']);
    Path := [Point(4929, 3995), Point(4945, 4043), Point(4997, 4067), Point(5056, 4092), Point(5111, 4106)];;
    writeln('Walking back the the shelves to get more glass! :)');
    SPS_WalkPath(Path);
    wait(randomrange(1000,700));
    end;
    Procedure StepToBooth;
    Var
    X, Y, Tile:Integer;
    begin
    Tile := DTMFromString('mggAAAHicY2NgYFBlgAB2IBYBYj4g5gJiXyCeAMRZUHklIHYG4pkloQyP9k9neHVsNhj/urwMjJmAcsxYMCMODAEAL8sPOA==');
    FindDTM(Tile, X, Y, MSX1, MSY1, MSX2, MSY2)
    MMouse(X, Y, 2, 2);
    Wait(500+random(500));
    Mouse(X, Y, 3, 3, True);
    Wait(1000+random(500));
    FreeDTM(Tile);
    end;




    begin
    SETUPSRL;
    ClickNorth(True);
    repeat
      if not InvFull then
      begin
      wait(1000+random(500));
      ToShelves;
      wait(1000+Random(500));
      Getglass;
      end;
        if InvFull Then
        begin
        wait(1000+random(500));
        ToBank;
        wait(1000+random(500));
        StepToBooth;
        Wait(1000+Random(500));
        DepositGlass;
        wait(1000+Random(500));
        end;
    until(false)


    end.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •