Results 1 to 13 of 13

Thread: Bank pin procedure

  1. #1
    Join Date
    Dec 2012
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default Bank pin procedure

    im writing a script for an rsps. this script can open the bank but i want to be able to have the script enter a pin. so far i only have
    Simba Code:
    Const

    //Banking
    BankPin = True; // true if you have a pin, false if not
    PinNumber = '';

    and i have this

    Simba Code:
    procedure Banking;
    var x, y: integer;

    begin

      WriteLn('Starting to bank');
    if BankPin then
        begin
        end;

    since the bank pin numbers dont move, i want to set a coordinate for each number. i also want to be able to just enter a pin number into "PinNumber = ' '; " and have the string converted so each number can be given their respective coordinates. how would i achieve this? or could someone just point me in the right direction?

  2. #2
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Code:
    Procedure EnterPin(Text: String);
    Var
      I: Integer;
    Begin
      For I:=1 To Length(Text) Do
      Begin
        If (Text[I] = '0') Then
          Click(0position)
        Else If (Text[I] = '1') Then
          Click(1Position)
        Else If (Text[I] = '2' Then
          Click(2Position);
      End;
    End;
    Code:
    If BankPin Then
      EnterPin(PinNumber);
    Something like this i think is what you want, I've never done it though and I'm on my phone not my PC so i cant check syntax
    Last edited by DannyRS; 12-26-2012 at 12:18 PM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  3. #3
    Join Date
    Dec 2012
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Thanks I think it got it from here

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

    Default

    Use InPin from the include...
    Declare your pin under Players[CurrentPlayer].Pin.

  5. #5
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Use InPin from the include...
    Declare your pin under Players[CurrentPlayer].Pin.
    Private server


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

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

    Default

    Ohhh...
    If the one in PS is similar to RS you can't use static coors since the number appear on diff places every time. Have to use OCR/bitmap/dtm.

  7. #7
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    Ohhh...
    If the one in PS is similar to RS you can't use static coors since the number appear on diff places every time. Have to use OCR/bitmap/dtm.
    I think he also mentioned the numbers dont move


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

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

    Default

    Oh. Can be done with some math to avoid long case/if statements then.
    Like
    Simba Code:
    B:= Grid();
    for i:=0 to High(PinNumber) do
      MouseBox(B[PinNumber].X1, B[PinNumber].Y1, ....);
    May have to twist a bit depending on the Grid setup.

  9. #9
    Join Date
    Dec 2012
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    Simba Code:
    procedure EnterPin(Text: String);
    var
      I: Integer;
    begin
      For I:=1 To Length(Text) do
      begin
        if (Text[I] = '0') then
          AL_AccurateMMouse(point(68, 139), 3, 3);
          AL_FastClick(mouse_left);
          Wait(500+random(500));
        else if (Text[I] = '1') then    //this is line 24 <---
          AL_AccurateMMouse(point(160, 137), 3, 3);
          AL_FastClick(mouse_left);
          Wait(500+random(500));
      end;
    end;

    identifier expect at line 24?

  10. #10
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    If the numbers don't move, just use Coordinates?

  11. #11
    Join Date
    Dec 2012
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    i am using coordinates. im just wondering why it wont compile. it says "identifier expected at line 24"

  12. #12
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by doxin View Post
    identifier expect at line 24?
    try this

    Simba Code:
    procedure EnterPin(Text: String);
    var
      I: Integer;
    begin
      For I:=1 To Length(Text) do
      begin
        if (Text[I] = '0') then
        begin
          AL_AccurateMMouse(point(68, 139), 3, 3);
          AL_FastClick(mouse_left);
          Wait(500+random(500));
        end else
        if (Text[I] = '1') then    //this is line 24 <---
        begin
          AL_AccurateMMouse(point(160, 137), 3, 3);
          AL_FastClick(mouse_left);
          Wait(500+random(500));
        end;
      end;
    end;
    Last edited by DannyRS; 12-26-2012 at 10:04 PM.


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  13. #13
    Join Date
    Dec 2012
    Posts
    86
    Mentioned
    0 Post(s)
    Quoted
    18 Post(s)

    Default

    it compiles now. ill complete the procedure and i'll test it out

    EDIT:it enters the pin perfectly now. thanks
    Last edited by doxin; 12-26-2012 at 10:24 PM.

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
  •