Page 4 of 6 FirstFirst ... 23456 LastLast
Results 76 to 100 of 132

Thread: [R]Edgeville Fisher + Banker

  1. #76
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Rev 73? What repository are you using?

  2. #77
    Join Date
    Jan 2008
    Location
    denmark.
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    have tried:
    http://simbareflection.googlecode.com/svn/trunk/ <- cant remember rev on this :S
    http://blanddns.no-ip.org:81/repos/reflection/ <-- this giving me rev 73

  3. #78
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    http://simbareflection.googlecode.com/svn/trunk is the correct repository. It's at rev 42.

  4. #79
    Join Date
    Jan 2008
    Location
    denmark.
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    http://simbareflection.googlecode.com/svn/trunk is the correct repository. It's at rev 42.
    well i installed using the correct repository.

    i still get this error:
    Code:
    [Error] C:\Simba\Includes\Reflection\./Core/Core.simba(567:11): Unknown identifier 'SmartGetFieldArraySize' at line 566
    Compiling failed.
    but in that line there's nothing
    look like this:
    Code:
    565. end;
    566.
    567{*******************************************************************************
    568. function R_IsUpTextMulti(UpText: TStringArray): Boolean;
    569By: Drags111
    570Description: Returns true if any instance of the UpText is found.
    im confused :S

  5. #80
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    You have to move the libsmart.dll from the reflection svn to your plugins folder.

  6. #81
    Join Date
    Jan 2008
    Location
    denmark.
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    You have to move the libsmart.dll from the reflection svn to your plugins folder.
    have done that.

  7. #82
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    Hmm.. I'll add you on MSN.

  8. #83
    Join Date
    Jan 2008
    Location
    denmark.
    Posts
    66
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    Hmm.. I'll add you on MSN.
    thx, but i'll leave tomorrow for 14 days - so i'll speak to you in 14 days>> MSN!!

    // PeaZzT!

  9. #84
    Join Date
    Jun 2007
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    any help please? im getting this error :

    doesn't exist
    Exception in Script: Unable to find file 'Reflection/Reflection.simba' used from ''

    i have everything updated and the latest reflection too.. rev 44

  10. #85
    Join Date
    Aug 2007
    Posts
    984
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    did you move all your files correctly?
    SRL > Runescape

    Quote Originally Posted by brent8900 View Post
    when i download it its a FAWG.rar how to i get it to FAWG.exe

  11. #86
    Join Date
    Sep 2007
    Location
    Australia, NSW
    Posts
    934
    Mentioned
    6 Post(s)
    Quoted
    145 Post(s)

    Default

    Quote Originally Posted by rs2 cheating roks! View Post
    any help please? im getting this error :

    doesn't exist
    Exception in Script: Unable to find file 'Reflection/Reflection.simba' used from ''

    i have everything updated and the latest reflection too.. rev 44
    Make sure your reflection folder is in Simba --> Includes --> Reflection


    INACTIVE
    How-to: Make S.M.A.R.T. less laggy

    Sell me your Maple Shieldbows (u)! Up to 95gp ea!

    My Scripts:
    Ivy Chopper Ultra [RS3] | Fantastic Fletcher [RS3]
    99 x78 | 99 x10 | 99 x2 | 99 x12


    Use the REPORT tags when posting progress reports to make life easier (:
    [REPORT]Put progress report in here![/REPORT]

    Super Savvy Smither V1.06Cool Classy Cooker V1.02 [EoC]

  12. #87
    Join Date
    Jun 2007
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by -daazndagger- View Post
    Make sure your reflection folder is in Simba --> Includes --> Reflection

    yeah I got it there but now im getting this :

    ERROR in TMThread.LoadFile
    Exception in Script: Unable to find file 'C:\Users\(ME)\Desktop\Simba\Includes\SRL/SRL/Core/AntiRandoms/Mordaut.scar' used from 'C:\Users\(ME)\Desktop\Simba\Includes\SRL/SRL.scar'

    EDIT: okay it works now but when it try's to bank it just walks into the bank, right clicks on the banker and clicks somewhere else outside of the bank. Sometimes on the grey road and sometimes on the dirt part. And it just stays there. Doesn't do anything after that.
    Last edited by rs2 cheating roks!; 07-21-2010 at 04:18 AM.


  13. #88
    Join Date
    Jul 2010
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I got:

    *****Hooks are outdated. Terminating script.*****

    can anyone help me out?

  14. #89
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe your hooks are outdated -.- Update reflection or if you have it updated wait for the hooks to get updated.

  15. #90
    Join Date
    Aug 2007
    Posts
    984
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by bbri06 View Post
    Maybe your hooks are outdated -.- Update reflection or if you have it updated wait for the hooks to get updated.
    He's new give him a break. And do what he said; just check your reflection. If you don't have it there are tutorials on how to install in the refletcion section.

    @bbrio06 how's you catherby fisher going?
    Last edited by Becks; 07-23-2010 at 02:21 PM.
    SRL > Runescape

    Quote Originally Posted by brent8900 View Post
    when i download it its a FAWG.rar how to i get it to FAWG.exe

  16. #91
    Join Date
    Jul 2010
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the help I do have reflection installed, and tried updating it via Simba but it says its up to date. Maybe i'll just wait for the hooks to update, if the below statement is true it may not be available yet.

    I believe i read here: "Reflection involves the use of client "hooks" to grab data directly from the client. Many of these hooks get outdated when Jagex does an update. Hooks are usually updated in the repository a couple hours to days after an update"

    The script looks great though, cant wait to try it out.
    Last edited by z7zz7; 07-23-2010 at 07:40 PM.

  17. #92
    Join Date
    Aug 2007
    Posts
    984
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by z7zz7 View Post
    Thanks for the help I do have reflection installed, and tried updating it via Simba but it says its up to date. I'll just wait for the hooks to update as you mentioned, as I believe I read somewhere that it can take up anywhere from hours to a few days after a rs update (I think there was one yesterday) for the hooks to update, correct me if i'm wrong.

    The script looks great though, cant wait to try it out.
    did you run an svn update on your refection? To do so right click your refection folder and then click run svn update.
    SRL > Runescape

    Quote Originally Posted by brent8900 View Post
    when i download it its a FAWG.rar how to i get it to FAWG.exe

  18. #93
    Join Date
    Jul 2010
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I tried updating the reflection through svn, but it still says the hooks are outdated.
    I followed this guide exactly so im sure i installed it right, is the repository url on the guide old?
    http://villavu.com/forum/showthread.php?t=56736

  19. #94
    Join Date
    Dec 2006
    Location
    New York
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Had a 6+ proggy but got deleted...the fisher is still standing strong but Reflection banking is broken so I had to switch to the Color Banking procedure.

    Code:
    R_ChooseOptionMulti([''])
    this function specifically is broken which causes the banking to fail...

    With the color banking, the script has a hard time finding the bank tellers but eventually finds it. Just thought I let you know...

  20. #95
    Join Date
    Jul 2010
    Posts
    14
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Got it working, thanks for the script works great so far

  21. #96
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by gamer716 View Post
    Had a 6+ proggy but got deleted...the fisher is still standing strong but Reflection banking is broken so I had to switch to the Color Banking procedure.

    Code:
    R_ChooseOptionMulti([''])
    this function specifically is broken which causes the banking to fail...

    With the color banking, the script has a hard time finding the bank tellers but eventually finds it. Just thought I let you know...
    I just tested this out for myself and I'm getting that problem to. Thanks for the feedback. I reported the error in the reflection section. Working on a temporary fix, but things are acting very strange.

    Edit: Change your hooks to match these
    Code:
    hook_static_MenuX = 'qea.n';
    hook_static_MenuY = 'm.f';
    Last edited by bbri06; 07-26-2010 at 10:05 PM.

  22. #97
    Join Date
    Dec 2006
    Location
    New York
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Edit: Change your hooks to match these
    Code:
    hook_static_MenuX = 'qea.n';
    hook_static_MenuY = 'm.f';
    Works Great...thanks for updating!

  23. #98
    Join Date
    Dec 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I am getting the hooks are outdated error, then when I try to update the reflection via svn it just makes everything worse...

    And I DID edit the hooks like in the post above me in hooks.simba


    EDIT: Fixed running script now, so far works perfectly. Will post progress report when done. Thanks for the script.
    Last edited by demon_54; 07-27-2010 at 09:54 PM.

  24. #99
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Glad you got it working. Tell me how it goes.

  25. #100
    Join Date
    May 2007
    Location
    Sydney, Australia (Faggot Region)
    Posts
    1,465
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    My Version.. Just replaced some reflection stuff with colour

    SCAR Code:
    {$Define Reflection}    //comment this line out to use color, not completed yet.
    program EdgevilleFisher;
    {.include SRL/SRL/Misc/SMART.scar}
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Misc/Debug.scar}
    {$ifDef Reflection}
      {.include Reflection/Reflection.simba}
    {$EndIf}

    Const
      INI_Loc = '';

    Type
      TFormPlayers = Record
        Name, Pass, Nick, Pin : String;
    End;

    var
      x, y, BreakAfter, BreakFor, TimeSinceBreak: integer;
      UseBreaks: boolean;
      Loads, SalmonB, TroutB: TIntegerArray;
      FishingSpot: TPointArray;
      frmDesign, frmDesign2 : TForm;
      Buttons : Array [0..2] of TButton;
      Labels: Array [0..7] of TLabel;
      LabelNames: Array of String;
      LabelPosX, EditPosX, EditPosY, LabelPosY: TIntegerArray;
      EditBoxes: Array [0..5] of TEdit;
      EditBox1: TEdit;
      Button1: TButton;
      Label1: TLabel;
      List1: TListBox;
      ComboBox1: TComboBox;
      FormPlayers : Array of TFormPlayers;
      RCBox1: TCheckBox;
      Memo1: TMemo;

    Procedure DeclarePlayers;
    var
      i: integer;
    begin
      NumberOfPlayers(Length(FormPlayers));
      for i := 0 to High(FormPlayers) do
      begin
        Players[i].Name := FormPlayers[i].Name;
        Players[i].Pass := FormPlayers[i].Pass;
        Players[i].Nick := FormPlayers[i].Nick;
        Players[i].Strings[0] := FormPlayers[i].Pin;
        Players[i].Active := True;
      end;
    end;

    Function PlayersInINI(var NPlayers: integer): boolean;
    begin
      NPlayers := StrToInt(ReadINI('NumCharacters', 'Num', INI_Loc));
      Result := (NPlayers > 0);
    end;

    Function LoadCharsINIList: TStringArray;
    var
      i, NPlayers: integer;
    begin
      Writeln('Loading players');
      PlayersInINI(NPlayers);
      SetLength(Result, NPlayers);
      for i := 0 to NPlayers - 1 do
      begin
        Result[i] := ReadINI('Character' + IntToStr(i), 'Name', INI_Loc);
      end;
    end;

    Procedure SaveItem;
    var
      OldNum, i: integer;
      NewNum: string;
    begin
      OldNum := StrToInt(ReadINI('NumCharacters', 'Num', INI_Loc));
      NewNum := IntToStr((OldNum + 1));
      WriteINI('NumCharacters', 'Num', NewNum, INI_Loc)
      NewNum := IntToStr(OldNum);;
      WriteINI('Character' + (NewNum), 'Name', EditBoxes[2].Text, INI_Loc);
      WriteINI('Character' + (NewNum), 'Pass', EditBoxes[3].Text, INI_Loc);
      WriteINI('Character' + (NewNum), 'Nick', EditBoxes[4].Text, INI_Loc);
      WriteINI('Character' + (NewNum), 'Pin', EditBoxes[5].Text, INI_Loc);
      for i := 2 to 5 do
        EditBoxes[i].Clear;
    end;

    Procedure ReorganizeINI(DelNum, OldNumofChars: integer);
    var
      i: integer;
      CharInfo: TFormPlayers;
    begin
      for i := (DelNum + 1) to OldNumofChars do
      begin
        CharInfo.Name := (ReadINI('Character' + IntToStr(i), 'Name', INI_Loc));
        CharInfo.Pass := (ReadINI('Character' + IntToStr(i), 'Pass', INI_Loc));
        CharInfo.Nick := (ReadINI('Character' + IntToStr(i), 'Nick', INI_Loc));
        CharInfo.Pin := (ReadINI('Character' + IntToStr(i), 'Pin', INI_Loc));
        WriteINI('Character' + IntToStr(i - 1), 'Name', CharInfo.Name, INI_Loc);
        WriteINI('Character' + IntToStr(i - 1), 'Pass', CharInfo.Pass, INI_Loc);
        WriteINI('Character' + IntToStr(i - 1), 'Nick', CharInfo.Nick, INI_Loc);
        WriteINI('Character' + IntToStr(i - 1), 'Pin', CharInfo.Pin, INI_Loc);
      end;
    end;

    Procedure DeleteItem;
    var
      OldNum, CharNum: integer;
      NewNum, ININame: string;
      ListNames: TStrings;
    begin
      CharNum := List1.ITEMINDEX;
      ININame := ReadINI('Character' + IntToStr(CharNum), 'Name', INI_Loc);
      ListNames := List1.ITEMS;
      if(not(ListNames[CharNum] = ININame))then
      begin
        Writeln('Problem with character record');
        Writeln('Please delete your BbriConfigFile.ini');
        Writeln('If this problem persists, please contact me on Villavu.com');
        frmDesign.ModalResult := mrOK;
        TerminateScript;
      end;
      OldNum := StrToInt(ReadINI('NumCharacters', 'Num', INI_Loc));
      if(OldNum = 0)then
      begin
        Writeln('No characters currently in the list to delete');
        Exit;
      end;
      NewNum := IntToStr((OldNum - 1));
      WriteINI('NumCharacters', 'Num', NewNum, INI_Loc)
      DeleteINI('Character' + IntToStr(CharNum), '', INI_Loc);
      List1.Items.Delete(CharNum);
      ReorganizeINI(CharNum, OldNum);
    end;

    Procedure FormEnd;
    var
      i: integer;
    begin
      if(Length(FormPlayers) = 0)then
      begin
        Writeln('No players selected to use');
        Writeln('Script is terminating');
        frmDesign.ModalResult := mrOk;
        TerminateScript;
      end;
      Writeln('Starting script using the following players');
      for i := 0 to High(FormPlayers) do
        Writeln(FormPlayers[i].Name);
      if(RCBox1.Checked)then
      begin
        UseBreaks := True;
        Writeln('Using breaks');
        BreakAfter := (StrToInt(EditBoxes[0].Text) * 60000) + Random(600000);
        BreakFor := (StrToInt(EditBoxes[1].Text) * 60000) + Random(600000);
        MarkTime(TimeSinceBreak);
        Writeln('Player will break after ' + IntToStr(BreakAfter / 60000) + ' minutes.');
        Writeln('Player will break for ' + IntToStr(BreakFor / 60000) + ' minutes.');
      end;
      frmDesign.ModalResult := mrOk;
    end;

    Procedure ButtonClick(Sender:TObject);
    begin
      Case Sender of
       Buttons[0] : begin
         if(Length(EditBoxes[2].Text) > 0)
          and (Length(EditBoxes[3].Text) > 0)
           and (length(EditBoxes[4].Text) > 0)
            and (Length(EditBoxes[5].Text) > 0)then
         begin
           List1.Items.Add(EditBoxes[2].Text)
           SaveItem;
         end else
           Writeln('Please fill out the character info boxes.');
       end;
       Buttons[1] : FormEnd;
       Buttons[2] : DeleteItem;
       Button1 : begin

         frmDesign2.MODALRESULT := mrOk;
       end;
      end;
    end;

    Procedure ListClick(Sender: TObject);
    begin
      comboBox1.CLEAR;
      ComboBox1.Items.Add('Active');
    end;

    Procedure SetupPlayer(PlayerIndex: integer);
    begin
      SetLength(FormPlayers, (High(FormPlayers) + 2));
      FormPlayers[High(FormPlayers)].Name := ReadINI('Character' + IntToStr(PlayerIndex), 'Name', INI_Loc);
      FormPlayers[High(FormPlayers)].Pass := ReadINI('Character' + IntToStr(PlayerIndex), 'Pass', INI_Loc);
      FormPlayers[High(FormPlayers)].Nick := ReadINI('Character' + IntToStr(PlayerIndex), 'Nick', INI_Loc);
      FormPlayers[High(FormPlayers)].Pin := ReadINI('Character' + IntToStr(PlayerIndex), 'Pin', INI_Loc);
    end;

    Procedure ActiveSet(Sender: TObject);
    begin
      if(ComboBox1.ItemIndex = 0)then
        SetupPlayer(List1.ItemIndex);
    end;

    procedure InitForm;
    var
      i, BoxWidth, NPlayers: integer;
      PlayersINI: TStringArray;
    begin
      frmDesign := CreateForm;
      frmDesign.Left := 100;
      frmDesign.Top := 100;
      frmDesign.Width := 600;
      frmDesign.Height := 400;
      frmDesign.Caption := 'Bbri06s Edgeville Fly Fisher';
      frmDesign.Color := 13882311;
      frmDesign.Font.Name := 'Calibri';
      frmDesign.Font.Color := CLBlack;

      for i := 0 to 2 do
      begin
        Buttons[i] := Tbutton.Create(frmDesign);
        Buttons[i].Parent := frmDesign;
        Buttons[i].left := 140 + (i * 110);
        Buttons[i].Top := 340;
        Buttons[i].Width := 100;
        Buttons[i].Height := 30;
        Buttons[i].OnClick := @ButtonClick;
      end;
      Buttons[0].Caption := 'Add Player';
      Buttons[1].Caption := 'Start Script';
      Buttons[2].Caption := 'Del Player';

      LabelPosX := [60, 220, 220, 332, 332, 332, 332, 110];
      LabelPosY := [80, 82, 127, 100, 140, 180, 220, 285];
      LabelNames := ['Players list', 'Break after', 'Break for', 'Username', 'Password', 'Nickname', 'Pin', 'Active?'];
      for i := 0 to 7 do
      begin
        Labels[i] := TLabel.Create(frmDesign);
        Labels[i].Parent := frmDesign;
        Labels[i].Left := LabelPosX[i];
        Labels[i].Top := LabelPosY[i];
        Labels[i].Caption := LabelNames[i];
      end;

      EditPosX := [210, 210, 415, 415, 415, 415];
      EditPosY := [100, 145, 100, 140, 180, 220];
      for i := 0 to 5 do
      begin
        if(i > 1)then
          BoxWidth := 175
        else
          BoxWidth := 100;
        EditBoxes[i] := TEdit.Create(frmDesign);
        EditBoxes[i].Parent := frmDesign;
        EditBoxes[i].Top := EditPosY[i];
        EditBoxes[i].Left := EditPosX[i];
        EditBoxes[i].Width := BoxWidth;
        EditBoxes[i].Height := 20;
      end;
      EditBoxes[0].Text := 'In mins';
      EditBoxes[1].Text := 'In mins';
      EditBoxes[5].Text := 'Set to "0000" for no pin';
      EditBoxes[3].PasswordChar := '*';

      List1 := TListBox.Create(frmDesign);
      List1.Parent := frmDesign;
      List1.Top := 100;
      List1.Left := 10;
      List1.Width := 175;
      List1.Height := 175;
      List1.OnClick := @ListClick;
      if(PlayersInINI(NPlayers))then
      begin
        PlayersINI := LoadCharsINIList;
        for i := 0 to High(PlayersINI) do
        begin
          Writeln('Loaded Player ' + PlayersINI[i]);
          List1.Items.Add(PlayersINI[i]);
        end;
      end;

      ComboBox1 := TComboBox.Create(frmDesign);
      ComboBox1.Parent := FrmDesign;
      ComboBox1.Top := 280;
      ComboBox1.Left := 20;
      ComboBox1.Width := 80;
      ComboBox1.Height := 20;
      ComboBox1.OnChange := @ActiveSet;

      RCBox1 := TCheckBox.Create(frmDesign);
      RCBox1.Parent := frmDesign;
      RCBox1.Top := 175;
      RCBox1.Left := 210;
      RCBox1.Width := 0;
      RCBox1.Height := 0;
      RCBox1.Caption := 'Use breaking?';

      Memo1 := TMemo.Create(frmDesign);
      Memo1.Parent := frmDesign;
      Memo1.Top := 250;
      Memo1.Left := 190;
      Memo1.Width := 400;
      Memo1.Height := 85;
      Memo1.READONLY;
      Memo1.Font.color := 4926486;
      Memo1.FONT.Size := 9;
      Memo1.Text := 'Welcome to Bbri06s Edgeville Fly Fisher and Banker. To setup, enter any new players info that is not on the player list into the appropriate boxes then click add player. Before starting the script, select which players should be used by clicking their names in the player list and then selecting active in the box below.';

    end;

    procedure InitForm2;
    begin
      frmDesign2 := CreateForm;
      frmDesign2.Left := 500;
      frmDesign2.Top := 300;
      frmDesign2.Width := 500;
      frmDesign2.Height := 100;
      frmDesign2.Caption := 'File location';
      frmDesign2.Color := 14979415;
      frmDesign2.Font.Name := 'Calibri';
      frmDesign2.Font.Color := CLBlack;

      EditBox1 := TEdit.Create(frmDesign2);
      EditBox1.Parent := frmDesign2;
      EditBox1.Left := 62;
      EditBox1.Top := 10;
      EditBox1.Width := 375;
      EditBox1.Height := 30;

      Label1 := TLabel.Create(frmDesign2);
      Label1.Parent := frmDesign2;
      Label1.left := 175;
      Label1.Top := 40;
      Label1.Caption := 'Location to save config file';
      Label1.FONT.Size := 9;

      Button1 := TButton.Create(frmDesign2);
      Button1.Parent := frmDesign2;
      Button1.Left := 215;
      Button1.Top := 60;
      Button1.Width := 70;
      Button1.Caption := 'Ok';
      Button1.OnClick := @ButtonClick;
    end;

    procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;


    procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v);
    end;

    procedure SafeInitForm2;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm2', v);
    end;

    procedure ShowFormModal2;
    begin
      frmDesign2.ShowModal;
    end;

    procedure SafeShowFormModal2;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal2', v);
    end;

    Procedure SetupFormConfig;
    begin
      SafeInitForm2;
      SafeShowFormModal2;
      writeln('Setting up player info file');
      CreateFile(EditBox1.Text + '\BbriConfigFile.ini');
      Writeln('Waiting for file creation');
      Wait(2000);
      Writeln('File should be made; script must be restarted now');
      Writeln('Before restarting please fill in INI_Loc with the path you entered');
      Writeln('The path was ' + EditBox1.Text + '\BbriConfigFile.ini');
      TerminateScript;
    end;


    function R_OpenBankBootha(Bank : String) : Boolean;
    var
      Tiles: TPointArray;
      P: TPoint;
      Tries: Integer;
    begin
      Result := R_BankScreen or R_PinScreen;
      if Result then Exit;

      case LowerCase(Bank) of
        'veb', 'varrock east':
            Tiles := [Point(3251,3419), Point(3252,3419), Point(3253,3419),
                      Point(3254,3419), Point(3255,3419), Point(3256,3419)];
        'vwb', 'varrock west':
            Tiles := [Point(3190,3435), Point(3190,3437), Point(3190,3439),
                      Point(3190,3441), Point(3190,3443), Point(3181,3444),
                      Point(3181,3442), Point(3181,3440), Point(3181,3438),
                      Point(3181,3436)];
        'falador west', 'fwb':
            Tiles := [Point(2945,3367), Point(2946,3367), Point(2947,3367),
                      Point(2948,3367)];
        'falador east', 'feb':
            Tiles := [Point(3010,3354), Point(3011,3354), Point(3012,3354),
                      Point(3013,3354), Point(3014,3354), Point(3015,3354)];
        'lumbridge', 'lb':
            Tiles := [Point(3208,3221)];
        'draynor', 'db':
            Tiles := [Point(3091,3419), Point(3091,3245), Point(3091,3244),
                      Point(3091,3243), Point(3091,3242)];
        'al kharid', 'akb':
            Tiles := [Point(3268,3168), Point(3268,3167), Point(3268,3166),
                      Point(3268,3165), Point(3268,3164)];
        'seb', 'seers':
            Tiles := [Point(2729,3494), Point(2728,3494), Point(2727,3494),
                      Point(2724,3494), Point(2722,3494)];
        'eb', 'edgeville':
            Tiles := [Point(3095,3489), Point(3095,3491), Point(3095,3493),
                      Point(3097,3495)];
        'cb', 'catherby':
            Tiles := [Point(2807, 3442), Point(2809, 3442), Point(2810, 3442), Point(2811, 3442)];
        'fgb', 'fishing guild':
            Tiles := [Point(2585, 3422), Point(2585, 3421), Point(2585, 3419), Point(2585, 3418)];
        'mc', 'moonclan':
            Tiles := [Point(2098, 3920), Point(2097, 3920), Point(2098, 3920)];
        'yb', 'yanille':
            Tiles := [Point(2614, 3094), Point(2614, 3092), Point(2614, 3091)];
        'da', 'duel arena': Tiles := [Point(3381, 3269), Point(3382, 3270)];
        'asb', 'ardougne south': Tiles := [Point(2656, 3286), Point(2656, 3283)];
        'pc', 'pest control':
            Tiles := [Point(2667, 2652), Point(2666, 2652), Point(2665, 2652),
                      Point(2668, 2652)];
      else
        begin
          SRL_Warn('R_OpenBankBooth', 'Unsupported bank name.', -1);
          Exit;
        end;
      end;
      SortTPAFrom(Tiles, GetMyPos);
      if (DistanceFrom(Tiles[0]) > 3) or not TileOnMS(Tiles[0], 10) then
      begin
        if not(TileOnMM(Tiles[0])) then
        begin
          SRL_Warn('R_OpenBankBooth', 'Could not find Bank Booth.', Warn_AllVersions);
          Exit;
        end;
        WalkToTile(Tiles[0], 0, 0);
        Wait(50);
        R_Flag;
        Wait(RandomRange(100, 200));
      end;
      if not(TileOnMS(Tiles[0], 10)) then
      begin
        SetAngle(True);
        MakeCompass('n');
        Wait(RandomRange(200, 400));
        if not(TileOnMS(Tiles[0], 10)) then
        begin
          SRL_Warn('R_OpenBankBooth', 'Could get MS Point.', Warn_AllVersions);
          Exit;
        end;
      end;

      P := TileToMS(Tiles[0], 10);
      MMouse(p.x - 5, p.y - 5, 11, 11);
      Wait(RandomRange(200, 300));
      if IsUpTextMultiCustom(['ank', 'ooth']) then
      begin
        GetMousePos(P.x, P.y);
        Mouse(P.x, P.y, 0, 0, false);
        Wait(RandomRange(80, 110));
        P.x := 0;
        if WaitOption('uickl', 2200) then
          repeat
            R_Flag;
            Wait(RandomRange(50, 90));
            Inc(Tries);
            if (Length(Players) > 0) then
              if Players[CurrentPlayer].Pin <> '' then
                Result := InPin(Players[CurrentPlayer].Pin);
            Result := R_BankScreen or R_PinScreen;
          until Result or (Tries > 40);
      end;
    end;

    function WaterAC: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.68, 0.54);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 9865086, MMX1, MMY1, MMX2, MMY2, 8);
      if (Length(arP) = 0) then
      begin
    //    Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 111) and (R <= 146) and (G >= 115) and (G <= 153) and (B >= 128) and (B <= 169) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 16.87) and (X <= 29.74) and (Y >= 17.50) and (Y <= 30.96) and (Z >= 23.23) and (Z <= 41.36) then
          begin
            Result := arC[i];
    //        Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
    //    Writeln('AutoColor failed in finding the color.');
    end;

    function BankFloorAC: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.29, 1.72);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 856906, MMX1, MMY1, MMX2, MMY2, 5);
      if (Length(arP) = 0) then
      begin
    //    Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 57) and (R <= 92) and (G >= 13) and (G <= 23) and (B >= 7) and (B <= 20) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 1.94) and (X <= 4.72) and (Y >= 1.24) and (Y <= 2.86) and (Z >= 0.35) and (Z <= 0.93) then
          begin
            Result := arC[i];
    //        Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
    //    Writeln('AutoColor failed in finding the color.');
    end;

    function BubblesAC: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      R, G, B: Integer;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.25, 0.28);

      FindColorsSpiralTolerance(MSCX, MSCY, arP, 11116956, MSX1, MSY1, MSX2, MSY2, 8);
      if (Length(arP) = 0) then
      begin
    //    Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        SetColorSpeed2Modifiers(0.2, 0.2);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToRGB(arC[i], R, G, B);

        if (R >= 134) and (R <= 177) and (G >= 141) and (G <= 180) and (B >= 152) and (B <= 185) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 25.48) and (X <= 42.69) and (Y >= 26.81) and (Y <= 44.95) and (Z >= 34.13) and (Z <= 51.78) then
          begin
            Result := arC[i];
    //        Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);
      SetColorSpeed2Modifiers(0.2, 0.2);

      if (i = arL + 1) then
    //    Writeln('AutoColor failed in finding the color.');
    end;

    Procedure TakeABreak;
    var
      PreWaitTime: integer;
    begin
      R_Flag;
      Wait(750 + Random(500));
      if(PlayersActive > 1)then
      begin
        LogOut;
        NextPlayer(Players[CurrentPlayer].Active);
        if(BreakFor >= 360000)then
          BreakFor := RandomRange((BreakFor - 180000), BreakFor + 180000);
        if(BreakAfter >= 600000)then
          BreakAfter := RandomRange((BreakAfter - 500000), (BreakAfter + 500000));
        Writeln('Done breaking, logging back in');
        Writeln('Next break will be ' + IntToStr(BreakFor / 60000) + ' minutes.');
        Writeln('Next break will occur after ' + IntToStr(BreakAfter / 60000) + ' minutes.');
        Exit;
      end;
      MarkTime(PreWaitTime);
      Writeln('Breaking for ' + IntToStr(BreakFor / 60000) + ' minutes.');
      LogOut;
      repeat
        Wait(RandomRange(5000, 25000))
      until(TimeFromMark(PreWaitTime) >= BreakFor)
      MarkTime(TimeSinceBreak);
      if(BreakFor >= 360000)then
        BreakFor := RandomRange((BreakFor - 180000), BreakFor + 180000);
      if(BreakAfter >= 600000)then
        BreakAfter := RandomRange((BreakAfter - 500000), (BreakAfter + 500000));
      Writeln('Done breaking, logging back in');
      Writeln('Next break will be ' + IntToStr(BreakFor / 60000) + ' minutes.');
      Writeln('Next break will occur after' + IntToStr(BreakAfter / 60000) + ' minutes.');
      NextPlayer(Players[CurrentPlayer].Active);
    end;

    Procedure Randoms;
    var
      BookDTM: integer;
    begin
      BookDTM := DTMFromString('78DA637460616098CCC80002109281A1B4A08' +
        '0410E89CFE80454D381AA868181898115598D3F504D0F116A2610501' +
        '300543389801A2FA09A3904D480DCBC84801A2322CCB102AA5948408' +
        'D2D504D3B01351644F89D88B80000162F0D9A');
      if(FindDTM(BookDTM, x, y, mix1, miy1, mix2, miy2))then
      begin
        Writeln('Found experience reward book');
        Writeln('Choosing fishing skill');
        Mouse(x, y, 3, 3, true);
        Wait(750 + random(250));
        Mouse(325, 164, 12, 12, True);
        Wait(350 + random(150));
        MouseBox(384, 275, 449, 285, 1);
        Wait(500 + random(300));
      end;
      FreeDTM(BookDTM);
      LevelUp;
    //  R_FindRandoms;
      FindNormalRandoms;
    end;
    {$IfDef Reflection}
    Procedure Ref_MainLoop; Forward;
    {$EndIf}
    Function LoggedInBB: boolean;
    var
      i: integer;
      Bool: boolean;
    begin
      for i:= 0 to 6 do
      begin
        {$IfDef Reflection}
          Bool := R_LoggedIn
        {$Else}
          Bool := LoggedIn;
        {$EndIf}
        if(not(Bool))then
          Wait(175 + random(50))
        else begin
          Result := True;
          Exit;
        end;
      end;
      Result := False;
    end;

    Function OffMapFlag: boolean;
    var
      i: integer;
    begin
      For i := 0 to 30 do
      begin
        if(Not(FindColor(x, y, 3026478, mmx1, mmy1, mmx2, mmy2)))then
          Wait(100)
        else begin
          Writeln('Flag is back on map');
          Result := true;
          Exit;
        end;
      end;
      if(i = 30)then
        Result := false;
    end;
    {Credits to the creaters/updaters of FlagEx
    (Wizzup? / WT-Fakawi / ZephyrsFury modified by N1ke!)

    Used some of FlagEx}


    Procedure BBFlag(Dist: integer);
    var
      TimeFS1, TimeFS2, Distance1, a, b: integer;
    begin
      Wait(500 + random(250));
      MarkTime(TimeFS1);
      While IsMoving do
      begin

        if(not(LoggedIn))then
         if(not(LoggedInBB))then
         begin
           Players[CurrentPlayer].Active := False;
           LogOut;
         end;
        if(FindColor(a, b, 3026478, mmx1, mmy1, mmx2, mmy2))then
        begin
          Wait(50);
          Distance1 := Distance(a, b + 14, MMCX, MMCY);
          if(Distance1 <= Dist)then
            Exit;
        end else
          if(not(IsMoving))then
            Exit
          else
            if(not(OffMapFlag))then
              Exit;
      Wait(200);
      MarkTime(TimeFS2);
      if((TimeFS2 - TimeFS1) > 6000)then
        if(Distance1 = Distance(a, b + 14, MMCX, MMCY))then
          Exit;
      if (Random(20) = 0)then
        IdleTime(500, 1000, 0.01);
      end;
    end;

    {Function GetTile: boolean;
    var
      TheTile: TPoint;
    begin
        TheTile := GetMyPos;
        Writeln('At tile (' + IntToStr(TheTile.x) + ',' + IntToStr(TheTile.y) + ')');
        Wait(2000);
    end;       }


    {function LoadPath: TPointArray;
    begin
      SetLength(Result, 9);
      Result[0] := Point(3107, 3433);
      Result[1] := Point(3097, 3438);
      Result[2] := Point(3090, 3446);
      Result[3] := Point(3092, 3455);
      Result[4] := Point(3093, 3464);
      Result[5] := Point(3099, 3470);
      Result[6] := Point(3099, 3482);
      Result[7] := Point(3091, 3485);
      Result[8] := Point(3093,3491);
    end;    }

    function LoadPath: TPointArray;
    begin
      SetLength(Result, 24);
      Result[0] := Point(3107, 3434);
      Result[1] := Point(3104, 3434);
      Result[2] := Point(3102, 3435);
      Result[3] := Point(3098, 3436);
      Result[4] := Point(3096, 3439);
      Result[5] := Point(3094, 3440);
      Result[6] := Point(3093, 3443);
      Result[7] := Point(3092, 3444);
      Result[8] := Point(3091, 3446);
      Result[9] := Point(3091, 3449);
      Result[10] := Point(3093, 3450);
      Result[11] := Point(3093, 3454);
      Result[12] := Point(3092, 3456);
      Result[13] := Point(3091, 3459);
      Result[14] := Point(3088, 3460);
      Result[15] := Point(3087, 3465);
      Result[16] := Point(3092, 3465);
      Result[17] := Point(3097, 3465);
      Result[18] := Point(3099, 3471);
      Result[19] := Point(3100, 3477);
      Result[20] := Point(3099, 3482);
      Result[21] := Point(3095, 3484);
      Result[22] := Point(3091, 3485);
      Result[23] := Point(3092, 3489);
    end;

    function BankPoints: TPointArray;
    begin
      SetLength(Result, 5);
      Result[0] := Point(3093, 3491);
      Result[1] := Point(3093, 3489);
      Result[2] := Point(3093, 3493);
      Result[3] := Point(3092, 3495);
      Result[4] := Point(3096, 3496);
    end;

    Procedure SmallCompAdj;
    var
      i: integer;
    begin
      i := Random(10);
      if(i < 2)then
        MakeCompass(RS_GetCompassAngleDegrees + Random(80))
      else
        if(i < 4)and(i > 1)then
          MakeCompass(RS_GetCompassAngleDegrees - Random(80));
    end;

    Procedure RandomCompass;
    var
      i, z, q: integer;
    begin
      MakeCompass(Random(360));
      z := Random(4);
      for q := 0 to z do
      begin
        Wait(Random(500));
        i := Random(10);
        if(i < 4)then
          SmallCompAdj;
      end;
    end;

    Procedure AntiBan;
    var
      i: integer;
      Bool: boolean;
    begin
      LevelUp;
      {$IfDef Reflection}
        Bool := R_LoggedIn
      {$Else}
        Bool := LoggedIn;
      {$EndIf}
      if(not(Bool))then
        if(not(LoggedInBB))then
        begin
          Players[CurrentPlayer].Active := False;
          Exit;
        end;
     Randoms;
      i := Random(225);
      Case i of
       0..7: RandomRClick;
       8..9: HoverSkill('Fishing', False);
       10..17: PickupMouse;
       18..20: BoredHuman;
       21..22: ExamineInv;
       {$IfDef Reflection}
         23..26: RandomCompass;
       {$EndIf}
       27..225: Wait(250 + random(250));
      end;
    end;

    Procedure WaitForFullStop;
    var
      i: integer;
    begin
      for i := 0 to 15 do
       if(IsMoving)then
         Wait(100)
       else
         Break;
    end;

    Procedure Color_CountInv;
    var
      Trout, i: integer;
    begin
      for i := 0 to 5 do
       if(not(GetCurrentTab = 25))then
         if(not(GameTab(25)))then
         begin
           Randoms;
         end;
      if(i = 5)and(GetCurrentTab <> 25)then
      begin
        Players[CurrentPlayer].Active := False;
        LogOut;
        Exit;
      end;
      Trout := DTMFromString('78DA6364E46060706764000108C9C0B07CC10' +
        '20611243EE37F7606064754350C0C4C287C4616A0395604D47001D5D' +
        '81250C30E54E346400D13508D0F0135FC40356604D47C07FACB17BF1' +
        'A00C53B0699');
      TroutB[CurrentPlayer] := TroutB[CurrentPlayer] + CountItems('dtm', trout, []);
      SalmonB[CurrentPlayer] := SalmonB[CurrentPlayer] + CountItems('color', 6187690, [15]);
      FreeDTM(Trout);
    end;

    Procedure ProgressReport;
    begin
      writeln('/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/');
      writeln('Bbri06s Edgeville Fly Fisher');
      writeln('Time running: ' + TimeRunning);
      Writeln('Players active : ' + IntToStr(PlayersActive));
      Writeln('');
      Writeln('- Current Character Report -');
      writeln('Banked ' + IntToStr(Loads[CurrentPlayer]) + ' loads.');
      Writeln('Banked ' + IntToStr(TroutB[CurrentPlayer]) + ' trout.');
      Writeln('Banked ' + IntToStr(SalmonB[CurrentPlayer]) + ' salmon.');
      Writeln('Current character has gained ' + IntToStr((TroutB[CurrentPlayer] * 50) + (SalmonB[CurrentPlayer] * 70)) + ' experience.');
      Writeln('');
      Writeln('- Combined Report -');
      Writeln('Banked ' + IntToStr(SumIntegerArray(Loads)) + ' loads.');
      Writeln('Banked ' + IntToStr((SumIntegerArray(TroutB))) + ' trout.');
      Writeln('Banked ' + IntToStr((SumIntegerArray(SalmonB))) + ' salmon.');
      Writeln(IntToStr((SumIntegerArray(TroutB) * 50) + (SumIntegerArray(SalmonB) * 70)) + ' total experience has been gained.');
      writeln('/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/');
      SRLRandomsReport;
    end;

    Function TrackTPA(TPA: TPointArray): TPointArray;
    var
      Box: Tbox;
      Color: integer;
      TPA2: TPointArray;
    begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.29, 0.44);
      repeat
        Color := BubblesAC;
        Box := GetTPABounds(TPA);
        FindColorsTolerance(TPA2, Color, Box.x1 - 15, Box.y1 - 15, Box.x2 + 15, Box.y2 + 15, 10);
        if(Length(TPA2) < 60)then
        begin
          TPA := TPA2;
        end;
        Wait(15);
      until(not(IsMoving))
      Result := TPA;
      DebugTPA(Result, '');
    end;

    Function Color_SwitchSpots: boolean;
    var
      i: integer;
      Symbols: TPointArray;
    begin
      writeln('Switching spots using color');
      SymbolAccuracy := 0.5;
      for i := 0 to 3 do
      begin
        FindSymbols(Symbols, 'fishing spot');
        if(Length(Symbols) > 0)then
        begin
          Result := True;
          SortTPAFrom(Symbols, IntToPoint(mmcx, mmcy));
          InvertTPA(Symbols);
          Mouse(Symbols[0].x, Symbols[0].y, 4, 4, true);
          Exit;
        end else
          Wait(500 + random(500));
      end;
      Result := False;
    end;

    Function Color_AreWeFishing: boolean;
    var
      TPA: TPointArray;
      FSBox: TBox;
      i: integer;
    begin
      FSBox := GetTPABounds(FishingSpot);
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.25, 0.28);
      for i := 0 to 3 do
      begin
        FindColorsTolerance(TPA, BubblesAC, FSBox.x1, FSBox.y1, FSBox.x2, FSBox.y2, 10);
        DebugTPA(TPA, '');
        Writeln(Length(TPA));
        Result := (Length(TPA) < 60)and(Length(TPA) >= 3);
        if(Result)then
          Break;
        Wait(100 + random(50));
      end;
    end;

    Function Color_FindBubbles: Boolean;
    var
      Bubbles: TPointArray;
      Sorter: Array of TPointArray;
      ThePoint: TPoint;
      i: integer;
    begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.29, 0.44);
      FindColorsSpiralTolerance(mscx, mscy, Bubbles, BubblesAC, msx1, msy1, msx2, msy2, 7);
      Sorter := SplitTPA(Bubbles, 15);
      SortATPAFrom(Sorter, IntToPoint(mmcx, mmcy));
      if(GetArrayLength(Sorter) > 0)then
      begin
        For i := 0 to High(Sorter) do
        begin
          ThePoint := MiddleTPA(Sorter[i]);
          MMouse(ThePoint.x, ThePoint.y, 4, 4);
          wait(200 + random(50));
          if(IsUpText('ure'))then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 0, 0, false);
            wait(200 + random(50));
            Result := (ChooseOption('ure'));
            FishingSpot := TrackTPA(Sorter[i]);
            Exit;
          end else
            Result := false;
        end;
      end;
    end;

    Function Color_CheckForFeathers: boolean;
    var
      Feathers: integer;
    begin
      Feathers := DTMFromString('78DA637CC5CEC0B098910104202403C3FA152' +
        'B182491F88C3F30D530303031B022AB790F54B386809AA740356B09A' +
        '8790854B399809A274035AB08A8790E54B390809A7F4035D330D520F' +
        '301569F0F30');
      Result := (FindDTM(Feathers, x, y, mix1, miy1, mix2, miy2));
      FreeDTM(Feathers);
    end;

    Procedure Color_FishingLoop;
    var
      FishingFS1, FishingFS2, FailCount, ClickFS, SwitchCount: integer;
    begin
      repeat
        Flag;
        if(GetCurrentTab <> 25)then
          if(not(GameTab(25)))then
            Break;
        Randoms;
        MarkTime(FishingFS1);
        if(not(Color_CheckForFeathers))then
        begin
          Writeln('Player ' + IntToStr(CurrentPlayer) + ' has ran out of feathers. Setting player to inactive.');
          Players[CurrentPlayer].Active := False;
          if(LoggedIn)then
            LogOut;
          Exit;
        end;
        if(Color_FindBubbles)then
        begin
          ClickFS := ClickFS + 1;
          FishingFS2 := InvCount;
          Flag;
          repeat
            if(not(Color_AreWeFishing))then
              Break;
            AntiBan;
            if(GetCurrentTab <> 25)then
            begin
              if(not(GameTab(25)))then
                Break;
            end;
            if(TimeFromMark(FishingFS1) > 24000)then
            begin
              MarkTime(FishingFS1);
              if(InvCount = FishingFS2)then
                Break;
              FishingFS2 := InvCount;
            end;
            if(ClickFS > 25)then
            begin
              Players[CurrentPlayer].Active := False;
              LogOut;
              Exit;
            end;
          until(InvFull)
        end else
          if(not(Color_SwitchSpots))then
            FailCount := FailCount + 1
          else
            SwitchCount := SwitchCount + 1;
        if(FailCount > 5) or (ClickFS > 25)then
        begin
          Players[CurrentPlayer].Active := False;
          LogOut;
          Exit;
        end;
      until(InvFull)
    end;

    Procedure Color_WalkRiver(GuideTPA: TPointArray; Direction: string);
    var
      i: integer;
    begin
      if(Direction = 'north')then
        SortTPAFrom(GuideTPA, IntToPoint(mmcx - 76, mmy1));
      if(Direction = 'south')then
        SortTPAFrom(GuideTPA, IntToPoint(mmcx - 76, mmy2));
      For i := 0 to High(GuideTPA) do
      begin
        if(RS_OnMiniMap(GuideTPA[i].x, GuideTPA[i].y))then
        begin
          if(Direction = 'north')then
            if(GuideTPA[i].y < 85)then
            begin
              Mouse(GuideTPA[i].x - 10, GuideTPA[i].y + 10, 5, 8, true);
              break;
            end;
          if(Direction = 'south')then
            if(GuideTPA[i].y > 85)then
            begin
              Mouse(GuideTPA[i].x - 10, GuideTPA[i].y - 10, 5, 8, true);
              break;
            end;
        end;
      end;
    end;

    Function Color_GoToBank: boolean;
    var
      i: integer;
      TPA, FTPA: TPointArray;
      P: TPoint;
    begin
      MakeCompass('N');
      SetAngle(True);
      SetRun(True);
      SymbolAccuracy := 0.6;
      for i := 0 to 30 do
      begin
        if(not(LoggedIn))then
          if(not(LoggedInBB))then
          begin
            Players[CurrentPlayer].Active := False;
            LogOut;
          end;
        Randoms;
        if(FindSymbol(x, y, 'bank'))then
        begin
          writeln('Found bank symbol');
          Mouse(x, y, 4, 4, true);
          BBFlag(15);
          WaitForFullStop;
          Result := True;
          Exit;
        end;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.29, 1.72);
        FindColorsTolerance(FTPA, BankFloorAC, mmx1, mmy1, mmx2, mmcy, 7);
        if(Length(FTPA) > 5)then
        begin
          P := MiddleTPA(FTPA);
          if(RS_OnMiniMap(P.x, P.y))then
          begin
            writeln('Found red floor');
            Mouse(x, y, 4, 4, true);
            BBFlag(10);
            WaitForFullStop;
            Result := True;
            Exit;
          end;
        end;
        ColorToleranceSpeed(2);
        SetColorSpeed2Modifiers(0.68, 0.54);
        FindColorsTolerance(TPA, WaterAC, mmx1, mmy1, mmx2, mmy2, 8);
        Color_WalkRiver(TPA, 'north');
        BBFlag(20);
      end;
    end;

    Function Color_GoToFish: boolean;
    var
      i: integer;
      TPA: TPointArray;
    begin
      MakeCompass('N');
      SetAngle(True);
      SymbolAccuracy := 0.7;
      for i := 0 to 15 do
      begin
      if(not(LoggedIn))then
         if(not(LoggedInBB))then
         begin
           Players[CurrentPlayer].Active := False;
           LogOut;
         end;
      Randoms;
      if(FindSymbol(x, y, 'fishing spot'))then
      begin
        Mouse(x, y, 4, 4, true);
        BBFlag(10);
        WaitForFullStop;
        Result := True;
        Exit;
      end;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.68, 0.54);
      FindColorsTolerance(TPA, WaterAC, mmx1, mmy1, mmx2, mmy2, 8);
      Color_WalkRiver(TPA, 'south');
      BBFlag(20);
      end;
    end;

    {Function CalculateAnimating(TimePeriod, Samples: integer): integer;
    var
      PixelShiftValues: Array of Integer;
      i: integer;
      Sum: integer;
    begin
      SetArrayLength(PixelShiftValues, Samples);
      for i:= 0 to High(PixelShiftValues)do
      begin
        PixelShiftValues[i] := PixelShift(IntToBox(MSCx + 5, MSCy - 4, MSCx + 48, MSCy + 27), TimePeriod);
        if(i > 0)then
          Sum := Sum + PixelShiftValues[i];
        if(i = 0)then
          Sum := PixelShiftValues[i];
      end;
      result := Sum / Samples;
    end;   }


    Function Color_InBank: boolean;
    var
      TPA: TPointArray;
      BankBox: TBox;
    begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.29, 1.72);
      FindColorsTolerance(TPA, BankFloorAC, mmx1, mmy1, mmx2, mmy2, 7);
      BankBox := GetTPABounds(TPA);
      BankBox.x2 := BankBox.x2 + 17;
      Result := (PointInBox(IntToPoint(mmcx, mmcy), BankBox));
      if(not(Result))then
        Writeln('Not in Bank');
    end;

    Function DepositInBank: boolean;
    var
      i: integer;
    begin
      for i := 0 to 20 do
      begin
        if(BankScreen)or(PinScreen)then
          Break;
        Wait(100 + random(50));
      end;
      if(PinScreen)then
        InPin(Players[CurrentPlayer].strings[0]);
      Wait(150 + random(50));
      if(BankScreen)then
      begin
        Color_CountInv;
        Loads[CurrentPlayer] := Loads[CurrentPlayer] + 1;
        Deposit(3, 28, true);
        Wait(250 + random(100));
        CloseBank;
        Wait(250 + random(100));
        Result := (InvCount = 2);
        if(Result)then
          ProgressReport;
      end;
    end;

    Procedure Color_Bank;
    var
      TPA: TPointArray;
      P: TPoint;
      ATPA: T2DPointArray;
      i: integer;
    begin
      Writeln('Attempting to bank');
      Randoms;
      if(GetCurrentTab <> 25)then
        if(not(GameTab(25)))then
          Exit;
      FindColorsTolerance(TPA, 4663092, msx1, msy1, msx2, msy2, 10);
      ATPA := SplitTPA(TPA, 10);
      for i := 0 to High(ATPA) do
      begin
        P := MiddleTPA(ATPA[i]);
        MMouse(P.x, P.y, 3, 3);
        Wait(150 + random(100));
        if(IsUpText('Bank'))then
        begin
          GetMousePos(x, y);
          Mouse(x, y, 0, 0, False);
          Wait(150 + random(100));
          if(ChooseOption('k Bank')) or (ChooseOption('uickly'))then
            if(DepositInBank)then
              Exit;
        end;
      end;
    end;

    Procedure Color_MainLoop;
    begin
      repeat
       repeat
        if(RunEnergy(40 + random(40)))then
          SetRun(True);
        if(not(InvFull)) and (not(Color_InBank))then
          Color_FishingLoop;
        Randoms;
        if(InvFull) and (LoggedIn)then
          if(Color_GoToBank)then
            Color_Bank
          else begin
            Players[CurrentPlayer].Active := False;
            if(LoggedIn)then
              LogOut;
            Break;
          end;
        Randoms;
        if(Color_InBank) and (not(InvFull))then
          if(not(Color_GoToFish))then
          begin
            Players[CurrentPlayer].Active := False;
            if(LoggedIn)then
              LogOut;
            Break;
          end;
        if(UseBreaks)and(TimeFromMark(TimeSinceBreak) > BreakAfter)then
          if(PlayersActive > 1)then
          begin
            LogOut;
            NextPlayer(Players[CurrentPlayer].Active);
          end else
            TakeABreak;
        if(not(LoggedIn))then
          if(not(LoggedInBB))then
            Break;
       until(false)
       if(PlayersActive > 0)then
         NextPlayer(Players[CurrentPlayer].Active);
      until(PlayersActive = 0)
      Writeln('We have run out of players, script is terminating');
    end;
    {$IfDef Reflection}
    Procedure Ref_CountInv;
    var
      i: integer;
    begin
      for i := 0 to 5 do
       if(not(GetCurrentTab = 25))then
         if(not(GameTab(25)))then
         begin
           Randoms;
         end;
      if(i = 5)and(GetCurrentTab <> 25)then
      begin
        Players[CurrentPlayer].Active := False;
        LogOut;
        Exit;
      end;
      TroutB[CurrentPlayer] := TroutB[CurrentPlayer] + R_CountItemName('Trout');
      SalmonB[CurrentPlayer] := SalmonB[CurrentPlayer] + R_CountItemName('Salmon');
    end;

    Procedure Ref_MoveToBooth;
    var
      TPA: TPointArray;
      z: integer;
    begin
      TPA := BankPoints;
      z := Random(7);
      WalkToTile(TPA[z], 1, 0);
    end;

    Function Ref_InBank: boolean;
    var
      i: integer;
      Points: TPointArray;
      P: TPoint;
    begin
      if(not(R_LoggedIn))then
        if(not(LoggedInBB))then
        begin
          Result := False;
          Exit;
        end;
      Points := BankPoints;
      for i := 0 to High(Points) do
      begin
        if(TileOnMM(PointToTile(Points[i])))then
        begin
          P := TileToMM(Points[i]);
          if(Distance(mmcx, mmcy, P.x, P.y) < 11)then
          begin
            Result := True;
            Exit;
          end else
            Result := False;
        end;
      end;
    end;

    Function Ref_WalkPath(Path: TPointArray): boolean;
    var
      i, FP, z, FailCount: integer;
      ThePoint: TPoint;
    begin
      repeat
       if(not(R_LoggedIn))then
         if(not(LoggedInBB))then
         begin
           Players[CurrentPlayer].active := false;
           Exit;
         end;
       FP := 0;
       z := 0;
       for i := 0 to High(Path) do
       begin
         ThePoint := TileToMM(PointToTile(Path[i]));
         if(RS_OnMiniMap(ThePoint.x, ThePoint.y))then
         begin
           FP := i;
           z := z + 1;
         end;
       end;
       if(z = 0)then
       begin
         FailCount := FailCount + 1;
         Wait(450 + random(200));
       end else
       begin
         if(not(TileOnMM(PointToTile(Path[FP]))))then
         begin
           Writeln('Tile wasnt on minimap');
           FailCount := FailCount + 1;
         end else
         begin
           ThePoint := TileToMM(PointToTile(Path[FP]));
           Mouse(ThePoint.x, ThePoint.y, 3, 3, true);
           Wait(150 + random(50));
           R_FFlag(10);
         end;
       end;
       if(FailCount > 25)then
       begin
         Writeln('Path walking failed');
         Result := (FP = High(Path));
         Exit;
       end;
       until(FP = High(Path))
      Result := (FP = High(Path));
      Writeln('Path walking successful');
    end;

    Function Ref_GoToBank: boolean;
    begin
      if(not(R_LoggedIn))then
        if(not(LoggedInBB))then
          Exit;
      Randoms;
      Writeln('Walking to bank');
      SetRun(False);
      if(not(Ref_WalkPath(LoadPath)))then
        Color_GoToBank
      else begin
        Result := True;
        Exit;
      end;
      Result := Ref_InBank;
    end;

    Procedure Ref_GoToFish;
    var
      Path: TPointArray;
    begin
      if(not(R_LoggedIn))then
        if(not(LoggedInBB))then
          Exit;
      Randoms;
      Writeln('Walking to fish');
      SetRun(True);
      Path := LoadPath;
      InvertTPA(Path);
      if(not(Ref_WalkPath(path)))then
        Color_GoToFish;
    end;

    Function Ref_Bank: boolean;
    var
      z, i: integer;
    begin
      if(not(R_LoggedIn))then
        if(not(LoggedInBB))then
        begin
          Players[CurrentPlayer].Active := false;
          Exit;
        end;
      for z := 0 to 5 do
      begin
        R_Flag;
        Randoms;
        if(GetCurrentTab <> 25)then
          if(not(GameTab(25)))then
            Break;
        if(R_OpenBankBootha('edgeville'))then
        begin
          for i := 0 to 20 do
          begin
            if(BankScreen)or(PinScreen)then
              Break;
            Wait(100 + random(50));
          end;
          if(PinScreen)then
            InPin(Players[CurrentPlayer].strings[0]);
          Wait(150 + random(50));
          if(BankScreen)then
          begin
            {$ifDef Reflection}
              Ref_CountInv
            {$Else}
              Color_CountInv;
            {$EndIf}
            Loads[CurrentPlayer] := Loads[CurrentPlayer] + 1;
            Deposit(3, 28, true);
            Wait(250 + random(100));
            CloseBank;
            Wait(250 + random(100));
            Result := (InvCount = 2);
            if(Result)then
              ProgressReport;
            Exit;
          end;
      end;
      end;
      Result := False;
    end;

    Function Ref_AreWeFishing: boolean;
    begin
      Result :=(GetAnimation = 623) or (GetAnimation = 622);
      if(not(Result))then
      begin
        Wait(500 + random(250));
        Result := (GetAnimation = 623) or (GetAnimation = 622);
      end;
    end;

    Function Ref_FindBubbles: boolean;
    var
      NPCS: TNPCArray;
      i, z: integer;
      P: TPoint;
    begin
      NPCS := GetNPCS;
      if(length(NPCS) > 0)then
        for i := 0 to High(NPCS) do
          if(NPCS[i].Name = 'Fishing spot') and (TileOnMS(NPCS[i].Tile, NPCS[i].Height))then
          begin
            P := TileToMS(NPCS[i].Tile, NPCS[i].Height);
            MMouse(P.x, P.y, 4, 4);
            Wait(150 + random(50));
            GetMousePos(x, y);
            if(IsUpText('Lure'))then
            begin
              Writeln('Clicking fishing spot');
              Z := Random(10);
              if(Z < 6)then
              begin
                Mouse(x, y, 0, 0, False);
                Wait(150 + random(50));
                Result := (ChooseOption('Lure'))
                Exit;
              end else
              begin
                Mouse(x, y, 0, 0, true);
                Result := True;
                Exit;
              end;
            end;
          end;
    //        Writeln('Bad index was ' + IntToStr(NPCS[i].Index));
      Result := False;
    end;

    Function WalkToTileBB(T: TTile): boolean;
    var
      ThePoint: TPoint;
    begin
      Result := (TileOnMM(T));
      if(Not(Result))then
      begin
        Writeln('Tile wasnt on map');
        Exit;
      end else
      begin
        ThePoint := TileToMM(T);
        Mouse(ThePoint.x, ThePoint.y, 4, 4, true);
        R_FFlag(0);
      end;
    end;

    Function Ref_SwitchSpots: boolean;
    var
      SSpot: TTile;
      NSpot: TTile;
    begin
      Writeln('Switching spots using reflection');
      SSpot := Tile(3101, 3425);
      NSpot := Tile(3107, 3434);
      if(DistanceFrom(SSpot) > DistanceFrom(NSpot))then
        Result := (WalkToTileBB(SSpot))
      else
        Result := (WalkToTileBB(NSpot));
    end;

    Function MoveSpots: boolean;
    begin
      Result := Ref_SwitchSpots;
      if(not(Result))then
      begin
        writeln('reflection switch failed');
        Result := Color_SwitchSpots;
      end;
      R_Flag;
    end;

    Procedure Ref_FishingLoop;
    var
      FailCount, ClickFS, SwitchCount, FishingFS1, FishingFS2: integer;
    begin
      repeat
        R_Flag;
        if(GetCurrentTab <> 25)then
          if(not(GameTab(25)))then
            Break;
        Randoms;
        MarkTime(FishingFS1);
        if(Ref_FindBubbles)then
        begin
          WriteLn('Ref_FindBubbles');
          ClickFS := ClickFS + 1;
          FishingFS2 := InvCount;
          R_Flag;
          repeat
            if(not(Ref_AreWeFishing))then
              Break;
            AntiBan;
            if(GetCurrentTab <> 25)then
            begin
              if(not(GameTab(25)))then
                Break;
            end;
            if(TimeFromMark(FishingFS1) > 24000)then
            begin
              MarkTime(FishingFS1);
              if(InvCount = FishingFS2)then
                Break;
              FishingFS2 := InvCount;
            end;
            if(ClickFS > 25)then
            begin
              Players[CurrentPlayer].Active := False;
              LogOut;
              Exit;
            end;
          until(InvFull)
        end else
          if(not(MoveSpots))then
            FailCount := FailCount + 1
          else
            SwitchCount := SwitchCount + 1;
        if(FailCount > 5) or (ClickFS > 25)then
        begin
          Players[CurrentPlayer].Active := False;
          LogOut;
          Exit;
        end;
      until(InvFull)
    end;

    Procedure Ref_MainLoop;
    begin
      repeat
       repeat
        if(not(InvFull)) and (not(Ref_InBank))then
          Ref_FishingLoop;
        Randoms;
        if(InvFull) and (R_LoggedIn)then
          if(Ref_GoToBank)then
            Ref_Bank;
        Randoms;
        if(Ref_InBank) and (not(InvFull))then
          Ref_GoToFish;
        if(not(R_LoggedIn))then
          if(not(LoggedInBB))then
            Break;
        if(UseBreaks)and(TimeFromMark(TimeSinceBreak) > BreakAfter)then
          TakeABreak;
       until(false)
       if(PlayersActive > 0)then
         NextPlayer(Players[CurrentPlayer].Active);
      until(PlayersActive = 0)
      Writeln('We have run out of players, script is terminating');
    end;
    {$EndIf}

    Procedure Splash;
    begin
      writeln('                  ____  __         _ ____  _____');
      writeln('                 / __ )/ /_  _____(_) __ \/ ___/');
      writeln('                / __  / __ \/ ___/ / / / / __ \ ');
      writeln('               / /_/ / /_/ / /  / / /_/ / /_/ / ');
      writeln('              /_____/_.___/_/  /_/\____/\____/  ');
      writeln('    ______     __                 _ ____         _______       __');
      writeln('   / ____/____/ /____ ____ _   __(_) / /___     / ____(_)_____/ /_  ___  _____');
      writeln('  / __/  / __  // __ `/ _ \ | / / / / // _ \   / /_  / // ___/ __ \/ _ \/ ___/');
      writeln(' / /___ / /_/ // /_/ /  __/ |/ / / / //  __/  / __/ / /(__  ) / / /  __/ /');
      writeln('/_____/ \__,_/ \__, /\___/|___/_/_/_/ \___/  /_/   /_//____/_/ /_/\___/_/');
      writeln('              /____/');
    end;

    Procedure GetIDS;
    var
      NPCS: TNPCarray;
      i: integer;
    begin
      NPCS := GetNPCS;
      for i := 0 to High(NPCS) do
      begin
        Writeln('NPC ' + IntToStr(i));
        Writeln(NPCS[i].Index);
        Writeln(NPCS[i].Name);
        Writeln(NPCS[i].Actions);
      end;
    end;

    Procedure SetupProc;
    begin
      if(not(FileExists(INI_Loc)))then
        SetupFormConfig;
      if(ReadINI('NumCharacters', 'Num', INI_Loc) = '')then
        WriteINI('NumCharacters', 'Num', '0', INI_Loc);
      SetLength(FormPlayers, 0);
      SafeInitForm;
      SafeShowFormModal;
      Smart_Server := 38;
      Smart_Members := False;
      Smart_Signed := True;
      Smart_SuperDetail := False;
      SetupSRL;
      {$IfDef Reflection}
        SetupReflectionEx(True);
      {$EndIf}
      Splash;
      DeclarePlayers;
      ActivateClient;
      LoginPlayer;
      SetLength(Loads, PlayersActive);
      SetLength(SalmonB, PlayersActive);
      SetLength(TroutB, PlayersActive);
      LampSkill := 'Fishing';
    //  Wait(2000 + random(500));
      SetAngle(true);
    end;

    begin
      SetupProc;
      {$ifDef Reflection}
        Ref_MainLoop
      {$Else}
        Color_MainLoop;
      {$EndIf}
    end.


Page 4 of 6 FirstFirst ... 23456 LastLast

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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