Results 1 to 3 of 3

Thread: How to withdraw items with bank??

  1. #1
    Join Date
    Feb 2012
    Posts
    48
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default How to withdraw items with bank??

    Hello people! I'm making a bonfire script so i need to know how to withdraw items

    This is my code atm and it opens bank.
    Theres also one other problem and its when it opens the bank the script stops and hilights the 59th line and says
    It also dosent enter the pin
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]
    Simba Code:
    program Bonfire;
    {.include SRL\SRL.simba}
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Active := True;
      Players[0].Member := True;
      Players[0].Pin := '1999';
    end;// declare players


    function OpenBankNPCEx :Boolean;
    var
      NPCBox :TBox;
      Colors, NPCArray :TPointArray;
      ATPA: T2DPointArray;
      MSNPC, NPCPoint :TPoint;
      TempCTS, C, HiNPC, II, I :Integer;
    begin
      Result := False;
      Result := (BankScreen) or (PinScreen);
      If Result then Exit;

      NPCArray := GetMinimapDots('NPC');
      HiNPC := High(NPCArray);

      If Length(NPCArray) = 0 then Exit;
      SortTPAFrom(NPCArray, Point(MMCX, MMCY));
      for I := 0 to HiNPC do
      begin
        NPCPoint := MMToMS(NPCArray[I])
        If NPCPoint = Point(-1, -1) then Continue;
        NPCBox := IntToBox(NPCPoint.X - 40, NPCPoint.Y - 40, NPCPoint.X + 40, NPCPoint.Y + 40)
        If PixelShift(NPCBox, 200) > 500 then Continue;

        TempCTS := GetColorToleranceSpeed;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.13, 1.52);
        FindColorsTolerance(Colors, 6067652, NPCBox.X1, NPCBox.Y1, NPCBox.X2, NPCBox.Y2, 13);
        ATPA := TPAToATPAEx(Colors, 15, 20);
        SortATPASize(ATPA, True);

        for II := 0 to High(ATPA) do
        begin
          MSNPC := MiddleTPA(ATPA[II]);
          MMouse(MSNPC.X, MSNPC.Y, 3, 3);
          If WaitUpTextMulti(['ooth', 'anker'], 200) then
          begin
            Mouse(MSNPC.X, MSNPC.Y, 1, 1, False);
            If WaitOptionMulti(['ank B', 'quick'], 300) then
              MarkTime(c);
              Repeat
                Wait(RandomRange(50, 100));
              Until (BankScreen) or (PinScreen) or (TimeFromMark(C) > 4500);
              if (Players[CurrentPlayer].Pin <> '') then // Here is the error!!!! am i suppose to fill the '' with the pin?
                InPin(Players[CurrentPlayer].Pin);
              Result := (BankScreen) or (PinScreen);
              If Result then
              begin
               ColorToleranceSpeed(TempCTS);
               Exit;
              end
              else
                ColorToleranceSpeed(TempCTS);
          end;
        end;
      end;
    end;

    begin
      SetupSRL;
       OpenBankNPCEx;
    end.
    Last edited by akash22; 06-28-2012 at 11:32 AM.

  2. #2
    Join Date
    Jul 2009
    Location
    Australia
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    As far as the pin goes I usually use this set of code
    Simba Code:
    if PinScreen then
            if (Players[CurrentPlayer].Pin <> '') then
              InPin(Players[CurrentPlayer].Pin)
            else
              Terminate('No Pin Given');
    (The 'terminte' - I have a procedure called terminate that pretty much just logs out, terminates script and outputs in the debug why the error occurred).
    Is the pin screen coming up or is it the bank screen as you have no
    Simba Code:
    if PinScreen then

    And no do not fill the '' with the pin, this simply checks if the player has given a pin or not. You may want to have an else to terminate the script if it gets a pin screen with no pin given.

    So there is no error message in the debug box? Just comes up in orange and gives the un-freed dtms? Hmm...

    As far as withdrawing items goes you could simply use
    Simba Code:
    Withdraw(0, 0, 28);
    Replacing the 0,0 with the row and column of the item and the 28 with the number of items wanted.

    You also need a begin added on line 55.

    ~Caotom
    Last edited by Caotom; 06-28-2012 at 12:30 PM.

  3. #3
    Join Date
    Jul 2008
    Location
    NSW, Australia
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    It depends what your wanting to do, for instance if you wanted you could add in a Bank slot that certain Items are into the Const

    For Example:
    Simba Code:
    Const
    FirstWordOfLog = 'Rune';
    LogBankSlot = 6;

    Then you can just do this when the BankScreen is up,
    Simba Code:
    Var
      Tries:Integer;

        if(InvEmpty = false)then
          QuickDeposit(0);
       Repeat
         MouseBankSlot(OreBankSlot, mouse_Right);  
         if(Waitoption('All ' + FirstWordofLog,6000))then  
         begin
           mouse(483,29,5,5,true);  // Exit bank
           Break;
         end else
         begin
            Tries:=Tries+1;
            if(CheckBankUp(1))then
            begin
              if(Tries=2)then
              begin
                writeln('No Logs Left in Bank! Exiting bank, Logging out and Terminating Script...');
                mouse(483,29,5,5,true);  // Exit bank
                Logout;
                TerminateScript;
              end;  
            end else
              OpenBank;  
         end;
      Until(False);

    You don't even need DTMs or anything this way ^

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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