Results 1 to 10 of 10

Thread: Withdraw-X Problem

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default Withdraw-X Problem

    Hi

    I`m trying to withdraw a dtm item, It finds the item end open the options screen and choose the X amount, but after that nothing gets send. Any advice with this

    Thanks

    Simba Code:
    If FindDTM(DTM_Flour, x, y, MSX1, MSY1, MSX2, MSY2) then
        Begin
          WriteLn('We Have Found The Flour');
          Mouse(x, y, 3, 3, mouse_right);
          WaitOption('X', 1000);
          TypeSendEx(IntToStr(14),True);
          Wait(randomrange(700, 200));
          FreeDTM(DTM_Flour);
        End else
        Begin
          WriteLn('We couldnt find the Flour! Check your DTM, or make sure the flour is visible');
          FreeDTM(DTM_Flour);
    //      GlobalFailsafe('We couldnt find the Flour! Check your DTM, or make sure the flour is visible');
        End;
      End else
      Begin
        WriteLn('The inventory isnt full yet.');
        FreeDTM(DTM_Flour);
        Exit;
      End;

  2. #2
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    The text box for you to key in won't appear immediately after u choose the option, so your TypeSend missed it. Use CountColor or something to detect the presence of the text box before calling TypeSend.

  3. #3
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Simba Code:
    If FindDTM(DTM_Flour, x, y, MSX1, MSY1, MSX2, MSY2) then
        Begin
          WriteLn('We Have Found The Flour');
          Mouse(x, y, 3, 3, mouse_right);
          WaitOption('X', 1000);
          Wait(randomrange(200, 700)); //You want to wait before typing the value, not after.
          TypeSendEx('14',True); //intToStr(is not necesarry if you can just input a string to begin with ;)
          FreeDTM(DTM_Flour);
        End else

    See how that works I guess.

  4. #4
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think theres an SRL function that withdraws a specified amount, much less code then all that.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

  5. #5
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by Footy View Post
    I think theres an SRL function that withdraws a specified amount, much less code then all that.
    He is using DTMs rather than bank coordinates to withdraw. It can be done though using BankPointToBankIndex.
    Edit: there is already a function that does this for you: WithdrawItem.

  6. #6
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by NCDS View Post
    Simba Code:
    If FindDTM(DTM_Flour, x, y, MSX1, MSY1, MSX2, MSY2) then
        Begin
          WriteLn('We Have Found The Flour');
          Mouse(x, y, 3, 3, mouse_right);
          WaitOption('X', 1000);
          Wait(randomrange(200, 700)); //You want to wait before typing the value, not after.
          TypeSendEx('14',True); //intToStr(is not necesarry if you can just input a string to begin with ;)
          FreeDTM(DTM_Flour);
        End else

    See how that works I guess.
    Thanks,it works beautifully. If I had only used my brain hey.

    Thanks riwu, I will look into your suggestion as well.

  7. #7
    Join Date
    Jun 2012
    Posts
    2,182
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    use this
    Simba Code:
    Withdraw(column - 1, row - 1, 14);
    then make constants for column and row of your item. DTM also works, this is just another sugestion.
    Thx Euphemism and Vinyl for the awesome siggy and avatar!

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

    Default

    Quote Originally Posted by Footy View Post
    use this
    Simba Code:
    Withdraw(column - 1, row - 1, 14);
    then make constants for column and row of your item. DTM also works, this is just another sugestion.
    This is a faster, easier and more reliable method however it is rather basic, relies on the user to set it up correctly and ignores the possibility that the item will run out. You could always check the number of items left before withdrawing I guess, but if it is a script where the function is not primarily to bank (eg. A mine and bank vs a superheater) I sometimes prefer to use dtms or bitmaps.

    ~Caotom

  9. #9
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    This is how I withdraw bowstrings in my AIO stringer script. Very basic and requires the user to set up the bank correctly, but it will check if there's not enough of the item and it will withdraw the correct number every time.

    Simba Code:
    procedure WithdBS;
    var
      amt: Integer;
    begin
      Status('WithdBS');
      if not LoggedIn then
        NextPlayer(False);
      if WaitFunc(@BankScreen,10 + random(25),2000 + random(500)) then
      begin
        amt := GetBankItemAmount(0,0);
        if (amt >= 15) then
          Withdraw(0,0,14) else
        begin
          WriteLn('Not enough BS left @WithdBS');
          NextPlayer(False);
        end;
      end else
      WriteLn('Not in Bankscreen @WithdBS');
    end;

  10. #10
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for all the feedback guys, you really helped me a lot.

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
  •