Results 1 to 7 of 7

Thread: Simple Logic Help

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default Simple Logic Help

    Just got brain-dead.. bleg .

    Simba Code:
    Function OpenBank:Boolean;
        Var
          ClickedBank:Integer;
        Begin
          If ClickObject('Booth') Then
          Begin
            MarkTime(ClickedBank)
            Repeat
              Wait(10)
              If TimeFromMark(ClickedBank) > 5000 Then Break
            Until (YBankOpen);
            If TimeFromMark(ClickedBank) > 5000 Then

    What I want

    Open Bank
    Wait Until YBankOpen Or 5 seconds have passed
    If YBankOpen then it can break/exit/end/finito
    If 5 seconds have passed, start over, and try opening the bank again.

    Thanks!

  2. #2
    Join Date
    Jul 2010
    Posts
    1,115
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    Simba Code:
    a:=0;
    repeat
      If OpenBankFast(Bank) then
        break;
      Inc(a);
      Wait(250+Random(150));
      Until (a>5)
      if (a>5) then
      begin
        Writeln('Cant Open Bank');
        NextPlayer(False);
        exit;
      end;

    thats my bank procedure. not exactly what you want, but the logic is there

  3. #3
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Simba Code:
    Function YohojoBank: Boolean;
    var
      T, Tries: Integer;
      Bool: Boolean;
    begin
      While (Tries < 3) do
      begin
        Result := (LoggedIn and BankScreen);
        if (Result) then
          Exit;

        T:= 0;
        MarkTimeT(T);
        Bool:= ClickObject('Booth');
        while ((Not Bool) and (TimeFromMark(T) < 5000) or (Not (LoggedIn and BankScreen) or Not PinScreen)) do
          wait(1);
        Inc(Tries);
      end;
        if (Length(Players) > 0) then
          if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
            InPin(Players[CurrentPlayer].Pin);
           
      Result:= (LoggedIn and BankScreen);
    end;
    I am Ggzz..
    Hackintosher

  4. #4
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Simba Code:
    Function OpenBank:Boolean;
    Var
      ClickedBank, fails:Integer;
    Begin
      Fails := 0;
      Result := False;
      repeat
        If ClickObject('Booth') Then
        Begin
          MarkTime(ClickedBank)
          Repeat
            Wait(10)
            If TimeFromMark(ClickedBank) > 5000 Then Break
          Until (YBankOpen);
          Result := YBankOpen;
        end else Wait(1000);
        Inc(Fails);
      until(Result or Fails > 5);
    end;

    v2:
    Simba Code:
    Function OpenBank:Boolean;
    Var
      ClickedBank, fails:Integer;
    Begin
      Fails := 0;
      Result := False;
      repeat
        Inc(Fails);
        If ClickObject('Booth') Then
        Begin
          MarkTime(ClickedBank)
          Repeat
            Wait(10)
            If YBankOpen Then
            begin
              Result := True;
              Exit;
            end;
          Until (TimeFromMark(ClickedBank) > 5000);
        end else Wait(1000);
      until(Fails > 5);
    end;
    Last edited by weequ; 02-29-2012 at 04:09 AM.
    Quote Originally Posted by DeSnob View Post
    ETA's don't exist in SRL like they did in other communities. Want a faster update? Help out with updating, otherwise just gotta wait it out.

  5. #5
    Join Date
    Jun 2007
    Location
    Greenville, SC
    Posts
    1,149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Smile Hope I did it right >.<

    Something like this I think(won't be the specific code but the logic will be there):
    Simba Code:
    Function OpenBank: Boolean;
    Var
        T: Integer;
    Label
        Start;
    Begin
        Result:=False;
        Start:
        MarkTime(T);
        Repeat
            If OpenBooth Then Result:=True;
        Until(YBankOpen OrTimeFromMark(T) > 5000);
        If Result:= False Then GoTo Start;
    End;
    Last edited by Runescape Pro; 02-29-2012 at 04:19 AM.

  6. #6
    Join Date
    Nov 2011
    Posts
    1,532
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Something like this?
    Simba Code:
    function DoBanking: boolean;
    begin
      repeat
        ClickObject('booth');
        ; //failsafe against infinite loop please
      until waitFunc(@YBankOpen, 500, 5000);

      ;//do banking stuff here
    end;
    Current activity: Recovering from vacation
    - Nulla pars vitae vacare officio potest -
    SRL membership? Can I buy that?
    Scripts - AGS - SWF - WAR - EMS - W100S-EM
    If you need scripting help, you can pm me. Remember, if you need help you have to ask for it properly though

  7. #7
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Simba Code:
    Procedure OpenandBankStuff;
    Var
      X, Y, T, I, Steelbar: Integer;
    Label
      OpenBanklbl, BankHandle;
    begin
      if not loggedin then exit;
      //Bank_AK
      T := GetSystemTime;
      OpenBanklbl:
      If(BankScreen)Then
      Begin
        I := 0;
        Goto BankHandle;
      End;
      If(GetSystemTime - T > 120000)Then
      Begin
        Writeln('banking took too long');
        CloseBank;
        Logout;
        Exit;
      End;
      If(I > 10)Then
      Begin
        Writeln('Cant find no bank');
        Wait(1500);
        Logout;
        Exit;
      End;
      OpenAKBank;
      Inc(I);
      Goto OpenBanklbl;
      //never here
      BankHandle:
      if(I > 2)Then
      Begin
        Writeln('Cant find no steelbars wtf');
        Wait(1500);
        CloseBank;
        Logout;
        Exit;
      End;
      DepositAll;
      Steelbar := BitmapFromString(13, 11, 'meJyLjUuKxY1qahohiBg1QGRsbA' +
            'pHuNSgKUNGg1kZskpkr+FSBpSqr2+Vl1eAIEz1cDXIyjDVw9UAEQC' +
            'pgY0d');
      If FindBitmapToleranceIn(Steelbar, x, y, MBX1, MBY1, MBX2, MBY2, 25) then
      Begin
        Mouse(X, Y, 9, 9, False);
        if not ChooseOption('ithdraw-All')then
        begin
          Inc(I);
          Goto BankHandle;
        end else
          SteelbarsDone := SteelbarsDone + 28;
      End else
      Begin
        SearchBank('Steel bar');
        Wait(350+Random(250));
        Inc(I);
        Goto BankHandle;
      End;
      FreeBitmap( Steelbar );
    end;

    I use this in a few Al-Kharid banking scripts i have.

    this is how i open the bank

    Simba Code:
    function OpenAKBank: Boolean;
    var
      P: TPoint;
      arP: TPointArray;
      ar2P: T2DPointArray;
      c, tmpCTS, i: Integer;
    begin
      WaitFunc(@Inverted_Ismoving, 50, 3000);

      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 10340332, MSX1, MSY1, MSX2, MSY2, 23);
      ar2P := TPAtoATPAEx(arP, 40, 40);
      SortATPAFrom(ar2P, Point(MSCX - 50, MSCY - 40));
      for i := 0 to high(ar2P) do
      begin
        P := MiddleTPA(ar2P[I]);
        //usually around 250 the "Inrange" can be lowered...
        C := CountColorTolerance(4409678, P.X - 30, P.Y - 30, P.X + 30, P.Y + 30, 16);
        If ( InRange(C, 200, 350))Then
        Begin
          MMouse(P.x, P.y, 8, 8);
          if WaitUpTextMulti(['Bank', 'ank', 'booth', 'ooth'], 500)then
          Begin
            //Writeln('boothcount '+inttostr(C));
            GetMousePos(P.x, P.y);
            Mouse(p.x, P.y, 0, 0, true);
            if not DidRedClick then break;
            FFLag(0);
            MarkTime(c);
            repeat
              Wait(100);
            until (BankScreen) or (PinScreen) or (TimeFromMark(c) > 10000);
            Wait(Random(300));
            if (HowManyPlayers > 0) then
              if (Players[CurrentPlayer].Pin <> '') then
                InPin(Players[CurrentPlayer].Pin);
            Result := (BankScreen) or (PinScreen);
            if (Result) then Break;
          End;
        End;
      end;
      If(Result)Then
        Writeln('Bank open');
      ColorToleranceSpeed(tmpCTS);
    end;

    feel free to copy/edit but leave credits if u release

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

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
  •