Results 1 to 9 of 9

Thread: Banking Problems

  1. #1
    Join Date
    Oct 2006
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Banking Problems

    I've been having some problems with my banking. I've looked at others to use as an example, but SCAR doesn't seem to recognise some of the Text. If you find something wrong with the code or if theres something i must account for please tell me. Thanks...
    SCAR Code:
    Function OpenUpBank(DTMs:Array of Integer; xs, ys, x1, y1, x2, y2:integer):Boolean;
    Var PreTime, CurTime, C, BankWords:integer;
      Begin
      Status('Searching for bank desk...');
      C:=0;
      BankWords:= CreateBitmapMaskFromText('Bank', UpChars);
      Repeat
        C:=C+1;
        //If(IsUpTextMulti('Bank', 'booth', 'Booth'))Then

        If(IsUpText('Use B'))Then

        //If(FindBitMapIn(BankWords, xs, ys, 0, 0, 200, 50))Then

        //If(FindText(x, y, 'Bank', UpChars, 0, 0, 200, 50))Then

          Begin
            Wait(Rands(100,200));
            GetMousePos(xs, ys);
            Mouse(xs, ys, 0, 0, false);
            Writeln('Clicked');
            //Repeat
              Wait(Rands(4000, 5000));
            //Until((TimeFromMark(PreTime) > (4000)) or (ClickOption('quickly', 1)) or (ClickOption('Bank Banker', 1)));
           End else
        If((ClickOption('quickly', 1)) or (ClickOption('Bank Banker', 1)))Then
          Begin
            Flag;
            MarkTime(PreTime);
            Repeat
              Wait(Rands(10,200));
            Until((TimeFromMark(PreTime) > 6000) or (BankScreen));
           End;
        If(FindDTMs(DTMs, xs, ys, x1, y1, x2, y2))Then
          Begin
            MMouse(xs, ys, 3, 3);
            Wait(Rands(400, 1200));
            Mouse(xs, ys, 5, 2, false);//edit
          End else
        If(FindDTMs(DTMs, xs, ys, MSX1, MSY1, MSX2, MSY2))Then
          Begin
            MMouse(xs, ys, 3, 3);
            Wait(Rands(400, 1200));
          End;
      Until((C > 5) or (BankScreen));
      FreeBitMap(BankWords);
      End;
    Thats my banking method, the DTM is a DTM of the bank desk, and the mouse almost always finds its way over it within a few seconds. Its with the text detection in the upper left corner, and with the ChooseOption that I'm having problems. It is just not returning either of the If statements as True and I don't know what to do. I've tried the stuff with all the // before it also and nothing seems to work.

  2. #2
    Join Date
    Oct 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I believe isUpText will not work with capital letters, even IF you specify it to look for 'Booth', try just using 'ooth' and things for your searching and for your CreateBitmapMaskFromText 'ank' functions.

  3. #3
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Always wait before Test checking.. and.. your mouse must be ON bank booth :P

    And i don't see Mouse moving


    ~Home ( Am i Blind ?! )

  4. #4
    Join Date
    Oct 2006
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    IronTeapot - Thanks ill try that out

    Quote Originally Posted by Home View Post
    Always wait before Test checking.. and.. your mouse must be ON bank booth :P

    And i don't see Mouse moving


    ~Home ( Am i Blind ?! )
    FindDTMs(DTMs, xs, ys, x1, y1, x2, y2)
    Function i made that finds and moves the mouse to it :P

    Did you mean always wait before TEXT checking? I'll try that out too, XD thanks a bunch.

  5. #5
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Default

    Like..
    MMouse(...........)
    Wait(100+Random(100))
    IsUptext('.....')

    And so on..


    ~Home

  6. #6
    Join Date
    Sep 2006
    Posts
    161
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Keep in mind that SRL has a built in OpenBank and related, including some OpenBankQuiet procedures. Also available are most banking functions.


    Wow. I've been away quite a while. Real life, yea, way unpredictable. Sorry, y'all, if I've caused any inconvenience.

  7. #7
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    I modded WT Fakawi's Draynor melter to work in port phasmatys, and the bank finding is pretty fast. I'll release it if Fakawi's cool with it so you can see how it works. Findyellows breaks up most of the minimap in to boxes, and finds the yellow that is always in banker dots (195836) only finding once per box, which in theory mines only 1 hit per yellow dot if the boxes are the right size, however when its more than 1 it takes care of it later. Then it looks at the distances between the dots and figures out which are the ones in the bank (as opposed to the ones walking around outside). Right now its hard coded to work with the layout in port phasmatys bank

    x x x x

    this is about how the bankers are. Calling findyellows and then clicking the spot it returns get me wicked close to the bank booth. So close that the modified version of simple bank down there finds it usually right away, and if not then pretty fast after that. To use, first change the analysis part of findyellows to suit your bank, and then follow the mainloop example below.

    If people like it, I'll put whichbank in the params and a case of for the banks, and have that call oustide procs, and leave it to you to write those.



    SCAR Code:
    type ybox = record
    x1,y1,x2,y2,cx,cy:integer;
    active:boolean;
    end;


    type tehpoint = record
    x,y :integer;
    active : boolean;
    end;

    type combo = record
    point1,point2,x1,y1,x2,y2,dist:integer;
    active:boolean;
    end;






    procedure findyellows (var fx, fy:integer; PointsToFind,width,basex,basey,endx,endy:integer);
    var
    box :array of ybox;
    ypoint : array of tehpoint;
    com:array [1..300] of combo;
    x,d,e,f,i,g,nob,{gx,gy,}currentpoint,row,prow,col,nor,noc:integer;//var
    //x,d,nob,gx,gy,currentpoint,row,prow,col,nor,noc:integer;

    begin
    noc:=(( (endx-basex) - (width mod (endx-basex)))/width)+1;
    nor:=(( (endy-basey) - (width mod (endy-basey)))/width)+1;
    //noc:=round( (endx-basex)/width );
    //nor:=round( (endy-basey)/width );

    nob:=nor*noc;
    setarraylength(box, ((nob)+2));
    repeat
      x:=x+1;
      if  ((x+noc) mod noc)>0 then
        col:=((x+noc) mod noc);
      if ((x+noc) mod noc) =0then
        col:=noc;
      prow:=0;
      repeat
        prow:=prow+1;
      until (  x<=(noc*prow));
      row:=prow;
      box[x].x1:=(basex+ ((col-1)*width) );
      box[x].x2:=(basex+(col*width));
      box[x].y1:=(basey+ ((row-1)*width) );
      box[x].y2:=(basey+(row*width));
      box[x].cx:=round((box[x].x2+box[x].x1)/2);
      box[x].cy:=round((box[x].y2+box[x].y1)/2);
      box[x].active:=true;

        {
      movemouse(box[x].x1,box[x].y1);
      holdmouse(box[x].x1,box[x].y1,true);
      movemouse(box[x].x2,box[x].y2);
      releasemouse(box[x].x2,box[x].y2,true);
         }



    until x>=nob;


    currentpoint:=1;
    d:=0;
    setarraylength(ypoint, pointstofind+1);
    repeat
      d:=d+1;
      if (box[d].active) then
      begin
        if findcolor(gx,gy,195836,box[d].x1,box[d].y1,box[d].x2,box[d].y2) then
        begin
          ypoint[currentpoint].x :=gx;
          ypoint[currentpoint].y :=gy;
          currentpoint:=currentpoint+1;
          box[d].active:=false;
        end;
      end;
    until ((  currentpoint= pointstofind)or (d=nob));
    e:=0;
    repeat
      e:=e+1;
      //writeln(inttostr(ypoint[e].x)+'  '+inttostr(ypoint[e].y));
      //if not((ypoint[e].x = 0) and (ypoint[e].y = 0)) then ypoint[e].active:=true;
    until e=16;

    //writeln('                      all points');
    e:=0;

    repeat
      f:=f+1;
      g:=0;
      repeat
      g:=g+1;
      e:=e+1;
      //writeln(inttostr(f)+'  '+inttostr(g)+'  '+inttostr(e));
      com[e].point1:=f;
      com[e].point2:=g;
      com[e].x1:=ypoint[f].x;
      com[e].y1:=ypoint[f].y;
      com[e].x2:=ypoint[g].x;
      com[e].y2:=ypoint[g].y;

      if not((com[e].x1=0) or (com[e].y1=0) or (com[e].x2=0) or (com[e].y2=0)) then com[e].active:=true;
      until( (g=16) or (e=256));
    until ((f=16) or (e=256));

    e:=0;
    repeat
    e:=e+1;
    com[e].dist:=Round(Sqrt(Sqr(com[e].x1 - com[e].x2) + Sqr(com[e].y1 - com[e].y2)))
    if ((com[e].dist=0) or (com[e].dist>20)) then com[e].active:=false;
    i:=0;
    repeat
    i:=i+1;
    if ((com[e].active) and (com[i].active))then
    begin
    if ((com[e].point1=com[i].point2)and (com[e].point2=com[i].point1)) then com[i].active:=false;
    end;
    until i=256;
    if com[e].dist=1 then com[e].active:=false;
    //if com[e].active then writeln(inttostr(com[e].point1)+'  '+inttostr(com[e].point2)+'  '+inttostr(com[e].dist));
    until e=256;
    e:=0;
    repeat
      e:=e+1;
      if com[e].active then
      begin
      if (com[e].dist <6 ) then
      begin
        i:=0;
        repeat
          i:=i+1;
          if ((com[i].point1=com[e].point1) or (com[i].point1=com[e].point2)  or (com[i].point2=com[e].point1) or (com[i].point2=com[e].point2))then
          begin
            if com[i].dist>7 then
            begin
            fx:=com[e].x1;
            fy:=com[e].y1;
            end;
        end;
        until i=256;
      end;
      end;
    until e=256;
    end;

    //----------modified this from WT Fakawi's Draynor Melter

    Function SimpleBank:Boolean;
    var sx,sy,dx,dy,Mark2,Tries:integer;
    begin
      SX:=280; SY:=180;
      repeat
      sx:=Sx+5+random(5);
      sy:=180+5+Random(40);
        MMouse(sx, sy, 0, 0);
        if IsUpTextMulti('e Bank','Booth','ooth') then
        begin
          GetMousePos(Dx, Dy);
          Mouse(Dx, Dy, 0, 0, False);
          if ChooseOption(Dx, Dy, 'uickly')  then
          begin
            MarkTime(Mark2);
            repeat
              Wait(10);
              if TimeFromMark(Mark2) > 20000 then
               begin
                 writeln('couldnt find the bank. Exiting');
                 Exit;
               end;
            until BankScreen;
          end;
        Result := True;
        Exit;
        end;
      wait(1);
      Tries:=Tries+1;
      until(tries >10) or bankscreen;
    end;



    //------main loop

    //click the bank symbol

     findyellows(gx,gy,16,5,590,30,700,120);
        Mouse(gx,gy,0,0,True);
        CountFlag(0);
    simplebank;

  8. #8
    Join Date
    Oct 2006
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks guys got it working <3....

  9. #9
    Join Date
    Oct 2006
    Posts
    119
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by I Pick Axes View Post
    Keep in mind that SRL has a built in OpenBank and related, including some OpenBankQuiet procedures. Also available are most banking functions.
    None of them worked too well... Took SUPER long to finally open the bank. Like 5-10 minutes of sitting there.

    Boreas the method i found has worked pretty well so far, but yours sounds a lot nicer that what im doing lol. I'll take a look at the code later, I've gotta go to a football playoff party for my football team right now.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Banking Problems
    By Lance in forum OSR Help
    Replies: 5
    Last Post: 02-20-2009, 12:04 AM
  2. Banking Problems
    By Lance in forum OSR Help
    Replies: 1
    Last Post: 02-18-2009, 02:56 PM
  3. Hermpie's banking proc's and Func's makes banking a piece of a cake!
    By ShowerThoughts in forum Research & Development Lounge
    Replies: 13
    Last Post: 06-11-2008, 03:16 PM
  4. i got problems with some banking stuff
    By ShowerThoughts in forum OSR Help
    Replies: 3
    Last Post: 08-03-2007, 11:59 AM

Posting Permissions

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