Results 1 to 7 of 7

Thread: Shop Buyer Pin Support Help Needed

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

    Default Shop Buyer Pin Support Help Needed

    Hi

    I`m trying to add Pin Support for a script that buys items from a shop. But all attempts by me to do so has failed thus far.

    Here is the code I`m currently using:

    In Constants I declare it like this:
    Simba Code:
    BankPin           = ''; // Leave blank if the player doesn't have a bank pin

    In the Loop for the buying of the items I Call it like this:

    Simba Code:
    Mouse(44, 90, 10, 10, mouse_Right);
        Wait(RandomRange(600 * SPEED, 800 * SPEED));
            ChooseOption('All');
            If PinScreen then
              Writeln('Attempted to Input Bank Pin');
              InPin(BankPin);
              Wait(500 + Random(200));
              Exit;

    No Matter how I try, it just continues with the script without Inputting the Bank Pin

    Can someone give me some advice on this.

    Thanks

  2. #2
    Join Date
    Dec 2011
    Location
    -bash
    Posts
    515
    Mentioned
    0 Post(s)
    Quoted
    27 Post(s)

    Default

    Try adding it like this:

    Simba Code:
    BankPin         := '';

    Then in your code, do this:

    Simba Code:
    If PinScreen then
      begin
         Writeln('Attempted to Input Bank Pin');
          InPin(BankPin);
          Wait(500 + Random(200));
      end;

    Hopefully that works

  3. #3
    Join Date
    Jun 2012
    Location
    Howell, Michigan
    Posts
    1,585
    Mentioned
    34 Post(s)
    Quoted
    553 Post(s)

    Default

    Do you have the pin declared as an integer? Also you can also ad it in your players like this.


    Simba Code:
    Players[0].Name := 'Username';            // Username
      Players[0].Pass := 'Password';           // Password
      Players[0].Pin := '1234';

    Then call it like this

    Simba Code:
    if PinScreen then
        InPin(Players[CurrentPlayer].Pin);

    I would also use it like this for the pin

    Simba Code:
    Procedure Bank;
      Begin
        if AtBank then
    Begin
      If Not ( BankScreen or PinScreen) Then
      begin
        OpenBankNPC;
        repeat
        wait(50)
        until(BankScreen or PinScreen)
        end;
      Begin
        If PinScreen Then
          InPin(Players[0].Pin);
        If BankScreen Then
        Begin
          DepositAll;
          wait(50 + Random(250));
          Withdraw( 0, 0, Food);
          Wait(50 + Random(250));
          If FindBlackChatMessage('ou use your amulets last charge.') then
          Deposit( 1, 1, True);
          Deposit( 2, 28, True);
          Wait(50 + Random(250));
          Proggy;
          CloseBank;
          wait(400+random(50));
        End;
      End;
    End;
    end;

    Use conditions and such. I think the problem is that it might be checking before the pin screen appears, using it like I have in the bank function will have it check more often than just once.

    Hope it helped (:

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

    Default

    Do you have the pin declared as an integer? Also you can also ad it in your players like this
    It's a constant so he doesn't have to declare whether it's a string, boolean or integer. However for the use of InPin it would need to be a string.

    But yes, the one you posted in the beginning simply requires the begin and end to be added in like chig suggested and that should work fine.

    I like to loop my banking and shop opening procedures so in case it fails it will try again a couple of times. Here's an example of mine from my air runecrafter..

    Simba Code:
    procedure POpenBank;
    var
      Counter: integer;
    begin
      while IsMoving do //If the player needs to move to the banker the script will wait
        Wait(RandomRange(500,800)); //until it has done so.
      repeat //Will repeat the section below up to 5 times
      Inc(Counter); //this is what increases so the script knows when to stop trying
      FFlag(0); //Another check for if we are walking to the banker
      if (not(LoggedIn)) or FindNormalRandoms or BankScreen then
        Break; //If we arent logged in/in a random/already in the bank we dont need to openbank
      if PinScreen then
        InPin(Players[CurrentPlayer].Pin); //if pinscreen then enter pin
      OpenBank('vwb',true,true); //time to try and open the bank
      until(Counter > 5); //this tells us when to stop trying and give up
    end;

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

    Default Loop For PinScreen

    Can I put a loop like this?

    Simba Code:
    If PinScreen then
              Repeat
                  Writeln('Attempted to Input Bank Pin');
                  InPin(BankPin);
                  Wait(500 + Random(200));
              Until (not (PinScreen))

    Will this also do a loop until the PinScreen do not appear?

    Edit: PinScreen Still Not Working after Changes.

    Ok, I have made some changes, First, I have Removed the BankPin From the Constants and have declared it under DeclarePlayers as I think it should have been in the first place.

    Here is the code as it looks now:
    Simba Code:
    procedure DeclarePlayers;
    begin
      HowManyPlayers := NumbOfPlayers;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := StartPlayer;

      with Players[0] do
      begin
        Name := 'UserName'; // Username
        Pass := 'Password'; // Password
        Pin  := ''; // Leave Blank If No Bank Pin Number
        Active := True; // Set to true if you want to use Player 0
        Integers[2] := 0;
      end;
    end;

    Should I declare it in any other way under DeclarePlayers,
    Should I convert it to a string maybe as mentioned or is that unnecessary?


    The Shop Function I have changed like this.

    Simba Code:
    Mouse(44, 90, 10, 10, mouse_Right);
          Wait(RandomRange(600 * SPEED, 800 * SPEED));
              ChooseOption('500');
                If PinScreen then
                Begin
                  Writeln('Attempted to Input Bank Pin');
                  InPin(Players[0].Pin);
                  Wait(500 + Random(200));
                End;


    I`ll wait for some more response otherwise I will just isolate these two functions in a script in its simplest form and try to make it happen. Also create a bank procedure where it use PinScreen and compare the two. Does a PinScreen work different in a shop from a bank?

    If it works in a bank then it is supposed to work in a shop in the same way?

    Thanks for the response guys. Appreciate it.
    Last edited by VastlySuperior; 07-04-2012 at 07:59 AM. Reason: PinScreen Still Not Working after Changes.

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

    Default

    theoretically that would work but you'd need to add a begin and end to that so -
    Simba Code:
    if PinScreen then
    begin
      repeat
      Writeln('Attempted to Input Bank Pin');
      InPin(BankPin);
      Wait(500 + Random(200));
      until (not PinScreen);
    end;

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

    Default I Got it Working

    Hey Guys

    I figured it out. Thanks for all your help. I Had the PinScreen at the wrong place. It was not in the right place for the sequence of events that had to take place so it never saw the PinScreen to complete it.

    Rookie mistake. But thank you for all your advice. I ended up implementing some of it and now the script runs smoother.

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
  •