Page 91 of 95 FirstFirst ... 41818990919293 ... LastLast
Results 2,251 to 2,275 of 2359

Thread: [SRL] AK Smelter

  1. #2251
    Join Date
    May 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    | Banked | Bars | Crafted | XP | XP/Hour ]
    | 54 | 0 | 1473 | 44190 | 28399 ]

    Worked that one time, getting this after 2/3 banks all the time:

    SwitchToPlayer(PlayerNo: 0, Active: False);

    Player is not Active...

    All players not active!

    NextPlayer(True)

    Thanks tho =)

  2. #2252
    Join Date
    Apr 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    how do i get the forms to not come up :S I'm sort of confused on how to do this

  3. #2253
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    Type your info in the script itself, this will disable the form.
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

  4. #2254
    Join Date
    Apr 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kevin33 View Post
    Type your info in the script itself, this will disable the form.
    i typed my info into the script itself, but the form still pops up

  5. #2255
    Join Date
    Dec 2011
    Location
    Ontario, Canada
    Posts
    1,735
    Mentioned
    5 Post(s)
    Quoted
    89 Post(s)

    Default

    Hmm ill take a look and edit this post with what to do. Says right in the script:
    Simba Code:
    {   ATTENTION!!!
      To use Forms just push play do NOT put anything in DeclarePlayers.
      If you want to use DeclarePlayers fill it in (Forms should NOT come up then)}

    Just use the forms its no big deal. SmartManager it is a problem though I guess. Is that why you dont want to use the forms?
    FEEL FREE TO PM ME ABOUT ANYTHING! Will help over Teamviewer...just ask!! "WITH A NEW QUESTION COMES A NEW CHALLENGE"
    Silentcore's AIO Service team !!! Pm me if you want questing done or service done or post on thread ofc

  6. #2256
    Join Date
    Apr 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by kevin33 View Post
    Hmm ill take a look and edit this post with what to do. Says right in the script:
    Simba Code:
    {   ATTENTION!!!
      To use Forms just push play do NOT put anything in DeclarePlayers.
      If you want to use DeclarePlayers fill it in (Forms should NOT come up then)}

    Just use the forms its no big deal. SmartManager it is a problem though I guess. Is that why you dont want to use the forms?
    yup :S it doesn't work past the 6 hours otherwise

  7. #2257
    Join Date
    Jun 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is absolutely great. Thanks I'll post my proggy once I'm finished

  8. #2258
    Join Date
    May 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [Error] (1788:3): Unknown identifier 'ScreenShots' at line 1787
    Compiling failed.

    anyone help me with this?

  9. #2259
    Join Date
    May 2012
    Posts
    9
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by The Killer View Post
    just delete the line and it will work fine
    afetr reading through these found out how to do, nvm my comment.

    ty its running now =D

  10. #2260
    Join Date
    Jun 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [================================================== ===================]
    [ Nick | Active | Worked | Banked | Bars | Crafted | XP | XP/Hour ]
    [================================================== ===================]
    [ **** | True | 02:29:40 | 115 | 1582 | 0 | 9831 | 3941 ]
    [================================================== ===================]
    Oh my it works. Does it work indeed. Thank you for making this.

  11. #2261
    Join Date
    May 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Compiled successfully in 406 ms.
    SRL Compiled in 0 msec
    SMART Initialized.
    Loaded: Server 1, Members: True, Signed: True, Super Detail: False.
    Error: Out Of Range at line 208
    The following DTMs were not freed: [SRL - Lamp bitmap, 1]
    The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap]

    Refuses to run, any help?
    Last edited by boxing; 06-14-2012 at 02:01 PM.

  12. #2262
    Join Date
    Sep 2007
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [================================================== ====================]
    [ Nick | Active | Worked | Banked | Bars | Crafted | XP | XP/Hour ]
    [================================================== ====================]
    [ | True | 04:28:59 | 220 | 1962 | 0 | 34444 | 7683 ]
    [================================================== ====================]

    Making steel bars in Al kharid, runs very smoothly. Thank you!

  13. #2263
    Join Date
    Jun 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This script is brilliant--I'm going on about 6 hours, will post proggy soon!

    Thanks a lot!

  14. #2264
    Join Date
    Jun 2012
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [================================================== ====================]
    [ Nick | Active | Worked | Banked | Bars | Crafted | XP | XP/Hour ]
    [================================================== ====================]
    [ **** | True | 03:32:17 | 178 | 1593 | 0 | 27966 | 7904 ]
    [================================================== ====================]

    Steel Bars, Works perfect.

  15. #2265
    Join Date
    Jan 2012
    Posts
    468
    Mentioned
    3 Post(s)
    Quoted
    200 Post(s)

    Default

    Someone Post a code that works! Mine wont even start up!

    This is for those that are using for silver crafting! very cheap method of fast crafting levels!

    Simba Code:
    {==============================================================================]
    [                   [SRL] Al-Kharid Smelter by Narcle                          ]
    [                            SRL 5 and Simba                                   ]
    [                                                                              ]
    [             NAME        : Narcle's AK Smelter                                ]
    [             WRITER      : Narcle                                             ]
    [             CATEGORY    : Smithing & Crafting                                ]
    [             DESCRIPTION : Smelts ores into bars & make C-balls               ]
    [                           Can craft Silver/Gold bars                         ]
    [             AUTOCOLOR   : Yes                                                ]
    [                                                                              ]
    [==============================================================================]
    [                             Description.                                     ]
    [==============================================================================]
    [    I made this script mainly to make cannonballs.  I then expanded on the    ]
    [ concept and made it into a full fledged smelter.  It's a very simple setup   ]
    [ as I try to keep most of my scripts; the simpler the setup the less likely   ]
    [ something could go wrong. I hope you use this as well as I have.             ]
    [   -Narcle                                                                    ]
    [==============================================================================]
    [                             Instructions.                                    ]
    [==============================================================================]
    [                                                                              ]
    [   Instructions have changed a bit.  Please go to:                            ]
    [     [url]http://villavu.com/forum/showthread.php?t=34507[/url]                          ]
    [   For complete instructions. (first post)                                    ]
    [                                                                              ]
    [==============================================================================}

    {$i srl/srl/misc/Smart.simba}
    {$i srl/srl.simba}
    {$i SRL/SRL/Misc/Reports.simba}
    {$i srl/srl/misc/paintsmart.simba}



    {   ATTENTION!!!
      To use Forms just push play do NOT put anything in DeclarePlayers.
      If you want to use DeclarePlayers fill it in (Forms should NOT come up then)}




    procedure DeclarePlayers;
    begin
      With Players[0] do
      begin
        Name   := ''; //Character Name
        Pass   := ''; //Character Pass
        Active := true; //Use player in script?
        Pin    := ''; //Pin for bank
        Strings[0] := 'steel'; //What to smith/craft? [Create string]
        Strings[1] := 'al kharid';//Where are you smithing? [Al Kharid, Edgeville]
        //cballs, steeltoball, steel, mith, addy, runite, iron, bronze, silver, gold
        Arrays[0] := [1, 2, true, false, '23:00', true, false, false];//Settings array
        //Settings array := [1st Bankslot, 2nd Bankslot, Take-Breaks, Take-Sleeps, Sleep-Time 'hh:mm', Rest for run, Use Coal bag];
      end;

      {
      With Players[1] do
      begin
        Name   := '';
        Pass   := '';
        Active := true;
        Pin    := '';
        Strings[0] := ''; //[Create string]
        Strings[1] := 'al kharid';
        Arrays[0] := [1, 2, true, false, '23:00', true, false, false];
      end;
      }

    end;

    //Advance Constants
    Const
      DebugMode = False;
      //Change these if needed
      AKBankBooth_Color = 9747935;//Color of the bank booth at AK
      GreenHedge_Color = 2056767;


    Type
      TTPAItem = Record
        OutLine, Width, Height, Color: Integer;
      end;
    Type
      TPlayas = Record
        WithDrawMain, WithDrawSeco, BaseCount, SecoCount, BagCount, BaseDivi: integer;//Setup
        BaseAmount, SecoAmount, FailToSmelt: integer;
        XPper: Extended;//Setup
        CannonBall, SmeltBars, CraftGold, CraftSilver: boolean;//Setup
        BaseItem, SecoItem, CraftedItem: TTPAItem;
        Coords: TPoint;
        SmeltText, SleepTime, statsStr: string;
        TakeBreaks, TakeSleeps, RestForRun, HasCoalBag, DisableAntiBan: Boolean;
        BankSlot1, BankSlot2: integer;
        EdgeVille, AlKharid, Neitiznot: Boolean;
        ClickFurnace: Function(Option: string): boolean;
        MyOpenBank: Function: boolean;
      end;

    var
      LogTime, BreakTime: integer;//Timers
      TotalBars, TotalXP, TotalCrafted: integer;//Counters
      PaceCheck: integer;//Ise this to see how fast they are going.
      MyVars: array[0..21] of integer;
      Playas: array[0..99] of TPlayas;

    const
      //don't change these!
      stats_Bars = 10;
      stats_Crafted = 11;
      stats_XP = 12;
      stats_XPpH = 13;
      version = '1.6.3';
      ScriptName = 'Narcle''s AK Smelter';

    procedure Debug(S: string);
    begin
      if DebugMode then
        Writeln(S)
      else
        Debugln(S);
      Status(S);
    end;

    const
      FilePath = AppPath + 'AKchars.ini';

      formCheckActive = 0;
      formCheckBreak  = 2;
      formCheckSleep  = 3;
      formCheckRestRun = 1;

    var
      frmDesign: TForm;
      PButtons: Array [0..3] of TButton;
      SButtons: Array [0..3] of TButton;
      frmLabels: Array of TLABEL;
      frmEdits: Array [0..9] of TEDIT;
      CreateCombo: TCOMBOBOX;
      LocationCombo: TCOMBOBox;
      CheckBoxs: Array [0..5] of TCHECKBOX;
      CurPlayer: integer;
      AKpf_SavePlayers, AKpf_Terminate: boolean;

    Procedure SavePlayers(tofile: boolean);
    var
      i: integer;
    begin
      With Players[CurPlayer] do
      begin
        Name := frmEdits[0].Caption;
        Pass := frmEdits[1].Caption;
        Pin := frmEdits[2].Caption;
        Active := CheckBoxs[0].CHECKED;
        Strings[0] := CreateCombo.Caption;
        Strings[1] := LocationCombo.Caption;
        Arrays[0] := [StrToInt(frmEdits[3].Caption), StrToInt(frmEdits[4].Caption),  CheckBoxs[2].CHECKED,  CheckBoxs[3].CHECKED, frmEdits[5].Caption, CheckBoxs[1].CHECKED, CheckBoxs[4].CHECKED, CheckBoxs[5].CHECKED];
      end;

      if tofile then
      begin
        WriteINI('General', 'NumOfPlayers', IntToStr(HowManyPlayers), FilePath);
        WriteINI('General', 'statsUser', frmEdits[6].Caption, FilePath);
        WriteINI('General', 'statsPass', frmEdits[7].Caption, FilePath);
      end;

      if tofile then
      for i := 0 to HowManyPlayers - 1 do
      with Players[i] do
      begin
        WriteINI('Player['+IntToStr(i)+']', 'Name', Name, FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Pass', Pass, FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Pin', Pin, FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Active', BoolToStr(Active), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Strings[0]', Strings[0], FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Strings[1]', Strings[1], FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][0]', IntToStr(Arrays[0][0]), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][1]', IntToStr(Arrays[0][1]), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][2]', BoolToStr(Arrays[0][2]), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][3]', BoolToStr(Arrays[0][3]), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][4]', Arrays[0][4], FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][5]', BoolToStr(Arrays[0][5]), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][6]', BoolToStr(Arrays[0][6]), FilePath);
        WriteINI('Player['+IntToStr(i)+']', 'Arrays[0][7]', BoolToStr(Arrays[0][7]), FilePath);
      end;
    end;


    Procedure ShowPlayer(index: integer);
    begin
      With Players[index] do
      begin
        frmEdits[0].Caption := Name;
        frmEdits[1].Caption := Pass;
        frmEdits[2].Caption := Pin;
        CheckBoxs[0].CHECKED := Active;
        CreateCombo.Caption := Strings[0];
        if Strings[1] = '' then
          LocationCombo.Caption := 'Al Kharid'
        else
          LocationCombo.Caption := Strings[1];
        frmEdits[3].Caption := IntToStr(Arrays[0][0]);//1st bank slot
        frmEdits[4].Caption := IntToStr(Arrays[0][1]);//2nd bank slot
        CheckBoxs[2].CHECKED := Arrays[0][2];//Take breaks
        CheckBoxs[3].CHECKED := Arrays[0][3];//Sleep boolean
        frmEdits[5].Caption := Arrays[0][4];//Sleep time
        CheckBoxs[1].CHECKED := Arrays[0][5];//Rest for Run
        CheckBoxs[4].CHECKED := Arrays[0][6];//CoalBag

      end;
      CurPlayer := index;
      frmEdits[6].Caption := stats_Username;
      frmEdits[7].Caption := stats_UserPass;
      frmEdits[8].Caption := IntToStr(CurPlayer);
      frmEdits[9].Caption := IntToStr(HowManyPlayers);
    end;

    Procedure LoadPlayers;
    var
      i: integer;
    begin
      HowManyPlayers := StrToIntDef(ReadINI('General', 'NumOfPlayers', FilePath), 1);
      stats_Username := ReadINI('General', 'statsUser', FilePath);
      stats_UserPass := ReadINI('General', 'statsPass', FilePath);
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      CurPlayer := CurrentPlayer;
      for i := 0 to HowManyPlayers - 1 do
      with Players[i] do
      begin
        Name := ReadINI('Player['+IntToStr(i)+']', 'Name', FilePath);
        if Name = '' then
        begin
          Active := false;
          Arrays[0] := [1,2,true,false,'hh:mm',false,false];
          Strings[0] := 'Select what to make here.';
        end
        else
        begin
          Pass := ReadINI('Player['+IntToStr(i)+']', 'Pass', FilePath);
          Pin := ReadINI('Player['+IntToStr(i)+']', 'Pin', FilePath);
          Active := StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Active', FilePath));
          Strings[0] := ReadINI('Player['+IntToStr(i)+']', 'Strings[0]', FilePath);
          Strings[1] := ReadINI('Player['+IntToStr(i)+']', 'Strings[1]', FilePath);
          try
            Arrays[0] := [StrToIntDef(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(0)+']', FilePath), 1),
                          StrToIntDef(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(1)+']', FilePath), 2),
                          StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(2)+']', FilePath)),
                          StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(3)+']', FilePath)),
                          ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(4)+']', FilePath),
                          StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(5)+']', FilePath)),
                          StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(6)+']', FilePath)),
                          StrToBool(ReadINI('Player['+IntToStr(i)+']', 'Arrays[0]['+IntToStr(7)+']', FilePath))];
          except
            Arrays[0] := [1,2,true,false,'hh:mm',false,false,false];
          end;
        end;
      end;
    end;

    procedure OnLeftClick(Sender: TObject);
    var
      i: integer;
    begin
      Case Sender of
        SButtons[0]: begin//Start
                       frmDesign.ModalResult := mrOk;
                       AKpf_SavePlayers := False;
                       AKpf_Terminate := False;
                       Writeln('Start.');
                     end;
        SButtons[1]: begin//Save and start
                       frmDesign.ModalResult := mrOk;
                       AKpf_SavePlayers := True;
                       AKpf_Terminate := False;
                       Writeln('Save and Start.');
                     end;
        SButtons[2]: begin//Save and Exit
                       frmDesign.MODALRESULT:= mrOk;
                       AKpf_SavePlayers := True;
                       AKpf_Terminate := True;
                       Writeln('Save and Exit.');
                     end;
        SButtons[3]: begin//Exit
                       frmDesign.MODALRESULT:= mrOk;
                       AKpf_SavePlayers := False;
                       AKpf_Terminate := True;
                       Writeln('Exit.');
                     end;
        PButtons[0]: begin//Previous player
                       SavePlayers(false);
                       if CurPlayer = 0 then
                         ShowPlayer(HowManyPlayers - 1)
                       else
                         ShowPlayer(CurPlayer - 1);
                     end;
        PButtons[1]: begin//New player
                       Inc(HowManyPlayers);
                       NumberOfPlayers(HowManyPlayers);
                       SavePlayers(false);
                       CurPlayer := HowManyPlayers-1;
                       for i := 0 to 2 do
                       begin
                         frmEdits[i].Caption := '';
                         CheckBoxs[i].CHECKED := true;
                       end;
                       CreateCombo.Caption := 'Select what to make here.';
                       frmEdits[3].Caption := '1';
                       frmEdits[4].Caption := '2';
                       CheckBoxs[3].CHECKED := false;
                       CheckBoxs[4].CHECKED := false;
                       CheckBoxs[5].CHECKED := false;
                       frmEdits[5].Caption := 'hh:mm';
                       frmEdits[6].Caption := stats_Username;
                       frmEdits[7].Caption := stats_UserPass;
                       frmEdits[8].Caption := IntToStr(CurPlayer);
                       frmEdits[9].Caption := IntToStr(HowManyPlayers);
                       Writeln('Player '+IntToStr(CurPlayer)+' added.');
                     end;
        PButtons[2]: begin//Next player
                       SavePlayers(false);
                       if CurPlayer = HowManyPlayers - 1 then
                         ShowPlayer(0)
                       else
                         ShowPlayer(CurPlayer + 1);
                     end;
        PButtons[3]: begin//Delete player
                       if (HowManyPlayers > 1) and (CurPlayer = 0) then
                         Writeln('Can''t delete player 0.')
                       else
                       if (HowManyPlayers = 1) then
                       begin
                         if not (MessageDlg('Delete?', 'Do you want to reset Player '+ToStr(CurPlayer)+'?', mtWarning, [mbYes,mbNo]) = 6) then
                           Exit;
                         Writeln('Player '+ToStr(CurPlayer)+' reset.');
                         for i := 0 to 2 do
                         begin
                           frmEdits[i].Caption := '';
                           CheckBoxs[i].CHECKED := true;
                         end;
                         CreateCombo.Caption := '';
                         frmEdits[3].Caption := '1';
                         frmEdits[4].Caption := '2';
                         CheckBoxs[3].CHECKED := false;
                         frmEdits[5].Caption := 'hh:mm';
                         CheckBoxs[5].CHECKED := false;
                       end
                       else
                       if MessageDlg('Delete?', 'Do you want to delete Player '+ToStr(CurPlayer)+'?', mtWarning, [mbYes,mbNo]) = 6 then
                       begin
                         Writeln('Player '+ToStr(CurPlayer)+' deleted.');
                         Swap(Players[CurPlayer], Players[HowManyPlayers - 1]);
                         IncEx(HowManyPlayers, -1);
                         ShowPlayer(Max(CurPlayer - 1, 0));
                         SavePlayers(true);
                       end;
                     end;
      end;
    end;

    procedure InitForm;
    var
      i: integer;
      PCaps, CreateComboText, LocationText, Labels: TStringArray;
      Ws, Ls, Ts: TIntegerArray;
    begin
      frmDesign := Tform.Create(nil);
      With frmDesign do
      begin
        setBounds(100, 100, 390, 330);
        Caption := 'Narcle''s AK Smelter v'+version;
        Color := ClWhite;
        Font.Color := ClBlack;
      end;

      PCaps := ['Previous Player', 'New Player', 'Next Player', 'Delete Player'];
      for i := 0 to 3 do
      begin
        PButtons[i] := TBUTTON.Create(frmDesign);
        with PButtons[i] do
        begin
          Parent := frmDesign;
          Height := 22;
          if i = 3 then
            Width := 80//Delete Player
          else
            Width := 120;
          Left := 10+i*125;
          Top := 8;
          CAPTION := PCaps[i];
          ONCLICK := @OnLeftClick;
          if i = 3 then
          begin
            Left := 135;
            Top := 34;
          end;
        end;
      end;

      PCaps := ['Start', 'Save and Start', 'Save and Exit', 'Exit'];
      for i := 0 to 3 do
      begin
        SButtons[i] := TBUTTON.Create(frmDesign);
        with SButtons[i] do
        begin
          Parent := frmDesign;
          Height := 22;
          Width := 90;
          Left := 6+i*96;
          Top := 300;
          FONT.Size := 8;
          CAPTION := PCaps[i];
          OnClick := @OnLeftClick;
        end;
      end;

      CreateComboText := ['Bronze bars', 'Iron bars', 'Steel bars', 'Silver bars', 'Gold bars',
        'Mithril bars', 'Addamantite bars', 'Runite bars', 'Cannonballs from Ores', 'Cannonballs from Bars',
        'Silver Holy Symbol', 'Silver Unholy Symbol', 'Silver Sickle', 'Silver Tiara',
        'Gold ring', 'Gold necklace', 'Gold amulet', 'Gold bracelet', 'Sapphire ring', 'Sapphire necklace', 'Sapphire amulet',
        'Sapphire bracelet', 'Emerald ring', 'Emerald necklace', 'Emerald amulet', 'Emerald bracelet',
        'Ruby ring', 'Ruby necklace', 'Ruby amulet', 'Ruby bracelet', 'Diamond ring', 'Diamond necklace',
        'Diamond amulet', 'Diamond bracelet', 'Dragonstone ring', 'Dragonstone necklace',
        'Dragonstone amulet', 'Dragonstone bracelet'];
      CreateCombo := TComboBox.Create(frmDesign);
      with CreateCombo do
      begin
        Parent := frmDesign;
        Top := 80;
        Left := 200;
        Width := 180;
        Height := 20;
        FONT.Size := 10;
        Caption := 'Select what to make here.';
        for i := 0 to High(CreateComboText) do
          ITEMS.Add(CreateComboText[i]);
      end;

      LocationText := ['Al Kharid', 'Edgeville'];
      LocationCombo := TComboBox.Create(frmDesign);
      with LocationCombo do
      begin
        Parent := frmDesign;
        Top := 126;
        Left := 200;
        Width := 180;
        Height := 20;
        for i := 0 to High(LocationText) do
          Items.Add(LocationText[i]);
      end;

      Labels := ['Username:', 'Password:', 'Bank Pin:', '1st Bank slot:', '2nd Bank slot:',
        'What are you Making:', 'Where are you smelting:',
        'Active', 'Rest for Run', 'Take Breaks', 'Sleep : Time ---->', 'Use Coal bag', 'Disable Antiban',
        'SRL Stats User:', 'SRL Stats Password:', 'Player:', 'Total Players:'];
      SetArrayLength(frmLabels, Length(Labels));
      Ts := [62, 108, 156, 186, 216,  62, 108, 156, 178, 200, 222, 244, 266, 250, 280, 38,  38];
      Ls := [10,  10,  50,  29,  25, 200, 200, 228, 228, 228, 228, 228, 228,  34,  10, 20, 260];
      for i := 0 to High(Labels) do
      begin
        frmLabels[i] := TLABEL.Create(frmDesign);
        with frmLabels[i] do
        begin
          Parent := frmDesign;
          Height := 20;
          Width := 50;
          Top := Ts[i];
          Left := Ls[i];
          Font.Size := 8;
          Caption := Labels[i];
        end;
      end;

      Ws := [180, 180,  60,  60,  60,  60,  76,  76, 28,  28];
      Ts := [ 80, 126, 154, 184, 214, 218, 244, 274, 34,  34];
      Ls := [ 10,  10, 100, 100, 100, 320, 112, 112, 60, 330];
      for i := 0 to 9 do
      begin
        frmEdits[i] := TEDIT.Create(frmDesign);
        with frmEdits[i] do
        begin
          Parent := frmDesign;
          Height := 21;
          Width := Ws[i];
          top := Ts[i];
          Left := Ls[i];
          Font.Size := 8;
          if i = 3 then
            Caption := '1';
          if i = 4 then
            Caption := '2';
          if i = 5 then
            Caption := 'hh:mm';
        end;
      end;

      for i := 0 to 5 do
      begin
        CheckBoxs[i] := TCHECKBOX.Create(frmDesign);
        with CheckBoxs[i] do
        begin
          Parent := frmDesign;
          Top := 154+i*22;
          Left := 210;
          if InIntArray([0, 1, 2], i) then
            Checked := true;
        end;
      end;

      if FileExists(FilePath) then
      begin
        LoadPlayers;
        ShowPlayer(0);
      end
      else
      begin
        HowManyPlayers := 1;
        NumberOfPlayers(HowManyPlayers);
        CurrentPlayer := 0;
        CurPlayer := CurrentPlayer;
        frmEdits[8].Caption := IntToStr(CurPlayer);
        frmEdits[9].Caption := IntToStr(HowManyPlayers);
      end;

      frmDesign.ShowModal;
    end;

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


    Function Loc(Location: string): Boolean;
    begin
      Result := Players[CurrentPlayer].Loc = Lowercase(Location);
    end;

    Procedure SetLoc(Location: string);
    begin
      Players[CurrentPlayer].Loc := Lowercase(Location);
    end;

    function TPAItem(cOutLine, cWidth, cHeight, cColor: Integer): TTPAItem;
    begin
      with Result do
      begin
        OutLine := cOutLine;
        Width := cWidth;
        Height := cHeight;
        Color := cColor;
      end;
    end;

    function FindTPAItem(Item: TTPAItem; B: TBox): Boolean;
    var
      TPA: TPointArray;
      Bt: TBox;
      x,y: integer;
      T:TPoint;
    begin
      FindColorsTolerance(TPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
      if Length(TPA) < 1 then
        Exit;
      Bt := GetTPABounds(TPA);
      T := MiddleTPA(TPA);
      if (Length(TPA) = Item.OutLine) and (iAbs(Bt.x2-Bt.x1) = Item.Width) and (iAbs(Bt.y2-Bt.y1) = Item.Height) then
        if Item.Color > -1 then
          Result := FindColorTolerance(x, y, Item.Color, T.x, T.y, T.x, T.y, 7)
        else
          Result := True;
    end;

    Function UpdateItem(var Item: TTPAItem; InvN: integer; ForcedUpdate: Boolean): Boolean;
    var
      TPA: TPointArray;
      T: TPoint;
      B: TBox;
    begin
      if InvN < 1 then
        Exit;
      if not ForcedUpdate then
       if (Item.OutLine > 0) then
        Exit;
      if ForcedUpdate then
        WriteLn('Item wasn''t detected attempting a TPA update.');
      Wait(300+random(200));
      B := InvBox(InvN);
      FindColorsTolerance(TPA, srl_outline_black, B.x1, B.y1, B.x2, B.y2, 0);
      if Length(TPA) < 1 then
        Exit;
      B := GetTPABounds(TPA);
      T := MiddleTPA(TPA);
      Item := TPAItem(Length(TPA), iAbs(B.x2-B.x1), iAbs(B.y2-B.y1), GetColor(T.x, T.y));
      Result := true;
      Writeln('Item := TPAItem('+inttostr(Item.Outline) +', '+inttostr(Item.Width)+', '+inttostr(Item.Height)+', '+inttostr(Item.Color)+');');
      Exit;
    end;

    function iCountArr(Item: TTPAItem): TIntegerArray;
    var
      i, n: integer;
    begin
      SetArrayLength(Result, 28);
      for i := 1 to 28 do
       if FindTPAItem(Item, InvBox(i)) then
       begin
         Result[n] := i;
         Inc(n);
       end;
      SetArrayLength(Result, n);
    end;

    function iCount(Item: TTPAItem): integer;
    begin
      Result := Length(iCountArr(Item));
    end;

    Function GoldCraftCoords(x, y: integer): TPoint;//x = 0 to 3, y = 0 to 7
    begin
      Result.y := 101+ 61*y;
      if (y = 0) then
        Result.x := 110+47*x;//Rings
      if InRange(y, 1, 3) and InRange(x, 0, 6) then
        Result.x := 125 + 51*x;//others
    end;

    Function GoldMenu: Boolean;
    begin
      Result := InRange(CountColor(2071039, MSX1, MSY1, MSX2, MSY1+60), 610, 630);
    end;

    Function SilverMenu: Boolean;
    begin
      Result := InRange(CountColor(2070783, MSX1, MSY1, MSX2, MSY1+60), 285, 310);
    end;

    Procedure ResetTimer(Time: string);
    begin
      Case LowerCase(Time) of
        'logout': LogTime := GetSystemTime+RandomRange(19*60000, 31*60000);
        'break': BreakTime := GetSystemTime+RandomRange(50*60000, 180*60000);
      end;
    end;

    procedure Report;
    var
      i: integer;
    begin
      if (GetTimeRunning < 60000) then
        Exit;

      With Playas[CurrentPlayer] do
      begin

        if CannonBall then
        begin
          MyVars[0] := Round(MyVars[2]*25.5/4);
          IncEx(Players[CurrentPlayer].Integers[11], MyVars[2]);//Players C-balls
          IncEx(TotalCrafted, MyVars[2]);//Total
          stats_IncVariable('Cannonballs (Made)', MyVars[2]);
        end;
     
        if SmeltBars then
        begin
          MyVars[0] := Round(MyVars[1]*XPper) + MyVars[0];//XP
          IncEx(Players[CurrentPlayer].Integers[10], MyVars[1]);//Bars
          IncEx(TotalBars, MyVars[1]);
          stats_IncVariable(statsStr, MyVars[1]);
        end;

        if CraftGold or CraftSilver then
        begin
          MyVars[0] := Round(MyVars[1]*XPper) + MyVars[0];
          IncEx(Players[CurrentPlayer].Integers[11], MyVars[1]);//Player Crafted
          IncEx(TotalCrafted, MyVars[1]);//Total Crafted
          stats_IncVariable(statsStr, MyVars[1]);
        end;
      end;
      With Players[CurrentPlayer] do
      begin
        Integers[12] := integers[12] + MyVars[0];//XP
        IncEx(TotalXP, MyVars[0]);
        stats_IncVariable('Total EXP Gained', MyVars[0]);

        if ((PlayerWorked(CurrentPlayer)/60000.0) > 0) then
          Integers[13] := round( (Integers[12]*60.0)/(PlayerWorked(CurrentPlayer)/60000.0))//XP Per hour
        else
          Integers[13] := -1;//error number
      end;
      writeln('');
      //ClearReport;
      if (HowManyPlayers > 1) then
        SRLProgressReport(ResultDebugBox, ScriptName, 'Narcle', version,
                         ['Run Time', 'Total Bars', 'Crafted', 'Total XP'],
                         [MsToTime(GetTimeRunning, Time_Abbrev), TotalBars, TotalCrafted, TotalXP]);

      SRLPlayerReport( ResultDebugBox, 0, False,
                       [True, True, False, False, False, False],
                       ['Bars', 'Crafted', 'XP', 'XP/Hour'],
                       [], [stats_Bars, stats_Crafted, stats_XP, stats_XPpH], [], []);

      For i := 0 to High(MyVars) do
        MyVars[i] := 0;
      stats_Commit;
    end;

    Procedure SetupPlayer;
    begin
      Debug('Player setup...');
      Disguise('AKS: '+Players[CurrentPlayer].Nick);
      SetAngle(SRL_ANGLE_HIGH);
      ResetTimer('Logout');
      RunEnergy(20);
      GameTab(tab_Inv);
    end;

    procedure LogoutSeq(reason:string);
    begin
      CloseWindow;
      if (reason = '') then
        nextplayer(true)
      else
      begin
        writeln(reason+', '+Players[CurrentPlayer].Name+' is now inactive.');
        SaveScreenshot(AppPath + reason + TheDate(Date_Day) + TheTime+'.bmp');
        nextplayer(false);
      end;
    end;

    function TakeABreak: boolean;
    var
      H, M, S, BreakFor, T: integer;
    begin
      if ( GetSystemTime >= BreakTime ) then
      begin
        CloseWindow;
        Logout;
        result := true;
        BreakFor := RandomRange(5 * 60000, 25 * 60000);
        ConvertTime(BreakFor, H, M, S);
        Writeln('Break for: '+inttostr(M)+ 'm:' +inttostr(S)+ 's');
        Logout;
        MarkTime(T);
        Repeat
          wait(1000);
        until (BreakFor < TimeFromMark(T))
        ResetTimer('Logout');
        ResetTimer('Break');
        NextPlayer(true);
      end;
    end;

    function TakeASleep(SleepTime: string): boolean;
    var
      H, M, S, ms: Word;
      SleepH, SleepM, SleepFor, Hr, Mr, Sr, T: integer;
    begin
      SleepH := StrToInt(Copy(SleepTime, 1, 2));
      SleepM := StrToInt(Copy(SleepTime, 4, 5));
      DecodeTime(Now, H, M, S, ms);
      if (H = SleepH) and (M > SleepM) then
      begin
        Logout;
        Result := true;
        SleepFor := RandomRange(540 * 60000, 780 * 60000);
        ConvertTime(SleepFor, Hr, Mr, Sr);
        Writeln('Sleep for: '+inttostr(Hr)+ 'h:'+inttostr(Mr)+ 'm:' +inttostr(Sr)+ 's');
        Logout;
        MarkTime(T);
        Repeat
          wait(1000);
        until (SleepFor < TimeFromMark(T))
        ResetTimer('Logout');
        ResetTimer('Break');
        NextPlayer(true);
      end;
    end;


    function BuildingOutline: integer;
    var
      arC, A: TIntegerArray;
      i, t, Len, Hi, c: Integer;
      H, S, L: Extended;
    begin
      Result := -1;
      t := GetSystemTime;
      arC := GetColors(TPAFromBox(IntToBox(MMX1, MMY1, MMX2, MMY2)));
      ClearSameIntegers(arC);
      SetArrayLength(A, Length(arC));
      for i := 0 to High(arC) do
      begin
        ColorToHSL(arC[i], H, S, L);
        if (L >= 90.5) and (L <= 99.0) then
        begin
          A[Len] := arC[i];
          Inc(Len);
        end;
      end;
      For i := 0 to Len do
      begin
        c := CountColor(A[i], MMX1, MMY1, MMX2, MMY2)
        if c > Hi then
        begin
          Hi := c;
          Result := A[i];
        end;
      end;
      Debug('BuildingOutline = ' + IntToStr(Result)+ '  '+IntToStr(GetSystemTime-t)+'ms');
    end;


    Function AKFindPosition: boolean;
    var
      TPAG: TPointArray;
      B: TBox;
      ATPAG: T2DPointArray;
      Size: integer;
    begin
      Result := False;
      if BankScreen then
      begin
        SetLoc('at bank');
        Result := true;
        Exit;
      end;

      FindColorsSpiralTolerance(MMCX, MMCY, TPAG, GreenHedge_Color, MMx1, MMy1, MMx2, MMy2, 40);

      If (Length(TPAG) < 1) then
        Exit;

      ATPAG := SplitTPAEx(TPAG, 3, 3);
      SortATPASize(ATPAG, True);

      if DebugMode then
        SMART_DrawDotsEx(True, ATPAG[0], clBlue);

      B := GetTPABounds(ATPAG[0]);
      Size := Length(ATPAG[0]);
      Debug('Size: '+ ToStr(Size) +' Height: '+ToStr(B.y2-B.y1));

      if InRange(Size, 130, 500) and InRange(B.y2-B.y1, 20, 69) then
      begin
        SetLoc('smelted');
        Result := True;
        Debug('Near Furnace');
      end;

      if InRange(Size, 200, 800) and InRange(B.y2-B.y1, 70, 120)  then
      begin
        SetLoc('to bank');
        Result := True;
        Debug('Near Bank');
      end;
    end;

    function ToAKCactus(ToFurnace:boolean): boolean;//This uses the green bush wall
    var
      z: integer;
      B: TBox;
      TPA: TpointArray;
      ATPA: T2DPointArray;
      T, O: TPoint;
    begin
      if not LoggedIn then
       Exit;
      Debug('To Cactus...');
      if ToFurnace then
      begin
        O := Point(2, Random(5));
        B := IntToBox(MMX1, MMY1, MMX2, MMY2);
      end
      else
      begin
        Case Random(2) of
          0: O := Point(-6, 15);
          1: O := Point(-8, 20);
        end;
        B := IntToBox(625, MMCY, MMX2, MMY2);
      end;
      z := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, GreenHedge_Color, B.x1, B.y1, B.x2, B.y2, 40);
      ColorToleranceSpeed(z);
      if Length(TPA) < 1 then
        Exit;
      //ATPA := TPAtoATPAEx(TPA, 20, 38);
      ATPA := SplitTPA(TPA, 3);
      SortATPASize(ATPA, true);
      B := GetTPABounds(ATPA[0]);
      T := Point(B.x1+O.x, B.y1+O.y);
      if DebugMode then
      begin
        SMART_DrawDotsEx(true, ATPA[0], clBlue);
        TPA := TPAFromBox(IntToBox(T.x, T.y, T.x+6, T.y+8 ));
        SMART_DrawDotsEx(False, TPA, clRed);
      end;

      if PointInBox(T, MMBox) then
      begin
        Mouse(T.x, T.y, 6, 8, true);
        FFlag(20);
        Result := true;
        PaceCheck := GetSystemTime;
      end else
        Debug('To AK Cactus failed.');
    end;



    function ToAKFurnace: Boolean;
    var
      TPA: TPointArray;
      B, Ba: TBox;
      ATPA: T2DPointArray;
      T: TPoint;
      YMod: integer;
    begin
      if not LoggedIn then
        Exit;
      Debug('To Furnace...');
      Result := False;
      B := MMBox;
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, GreenHedge_Color, B.x1, B.y1, B.x2, B.y2, 40);//green hedge
      if (High(TPA) < 1) then
        Exit;
      ATPA := SplitTPAEx(TPA, 3, 3);
      SortATPAFromSize(ATPA, 1000, True);
      //SMART_DrawDotsEx(True, ATPA[0], clGreen);
      Ba := GetTPABounds(ATPA[0]);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, BuildingOutline, B.x1, B.y1, Ba.x2+6, Ba.y1+12, 0);
      if (High(TPA) < 1) then
        Exit;
      ATPA := SplitTPA(TPA, 15);
      SortATPAFromSize(ATPA, 200, True);
      B := GetTPABounds(ATPA[0]);
      //SMART_DrawDotsEx(True, ATPA[0], clBlue);

      Debug('PaceCheck: '+ToStr(GetSystemTime-PaceCheck)+'ms');
      Case (GetSystemTime-PaceCheck) of
           0..70: Ymod := 4;
           71..89: Ymod := 3;
         90..129: YMod := 2;
        else
          YMod := 0;
      end;
      if (B.y2-B.y1 < 37) then//if the Box is too short, somethigns off
        T := Point(Ba.x1-17, Ba.y1-25+YMod)
      else
        T := Point(B.x2-17, B.y2-30+YMod);

      if DebugMode then
      begin
        SMART_DrawDotsEx(True, ATPA[0], clBlue);
        TPA := TPAFromBox(IntToBox(T.x, T.y, T.x+5, T.y+5 ));
        SMART_DrawDotsEx(false, TPA, clRed);
      end;

      If PointInBox(T, MMBox) then
      begin
        Mouse(T.x, T.y, 5, 5, true);
        FFlag(20);
        Wait(400+random(100));
        FFlag(0);
        Result := True;
        PaceCheck := GetSystemTime;
        Wait(700+random(300));
      end else
        Debug('To AK Furnace failed.');
    end;

    function ToAKBank: Boolean;//Uses bankers at bank
    var
      z, L: integer;
      T: TPoint;
      B: TBox;
      TPA, TPA2: TpointArray;
      ATPA, ATPA2: T2Dpointarray;
    begin
      if not LoggedIn then
       Exit;
      Debug('To Bank...');
      z := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA, GreenHedge_Color, MMX1, MMY1, MMX2, MMY2, 40);
      ColorToleranceSpeed(z);
      if (Length(TPA) < 1) then
        Exit;
      ATPA := SplitTPAEx(TPA, 2, 2);
      SortATPASize(ATPA, true);

      B := GetTPABounds(ATPA[0]);
      if DebugMode then
        SMART_DrawDotsEx(True, ATPA[0], clBlue);
      ColorToleranceSpeed(1);
      FindColorsSpiralTolerance(MMCX, MMCY, TPA2, BuildingOutline, MMX1, B.Y1+9, B.X1, MMY2, 0);
      ColorToleranceSpeed(z);
      if (Length(TPA2) < 1) then
        Exit;

      ATPA2 := SplitTPAEx(TPA2, 15, 10);
      SortATPASize(ATPA2, True);
      L := Length(ATPA2);
      if (L = 0) then
        Exit;
      SetArrayLength(ATPA2, Min(L, 2));

      SortATPAFromFirstPoint(ATPA2, Point(B.x1-16, MMY2));

      B := GetTPABounds(ATPA2[0]);
      Debug('H: '+ToSTR(B.y2-B.y1)+', W: '+ToStr(B.x2-B.x1));
      T := Point(B.x2-13, B.y1+(B.y2-B.y1)/2-MAx((35-(B.x2-B.x1))/2, 2));
      if DebugMode then
      begin
        TPA := TPAFromBox(IntToBox(T.x, T.y, T.x+4, T.y+8 ));
        SMART_DrawDotsEx(False, ATPA2[0], clGreen);
        SMART_DrawDotsEx(False, TPA, clRed);
      end;

      if PointInBox(T, MMBox) then
      begin
        Mouse(T.x, T.y, 4, 8, true);
        FFlag(20);
        Result := true;
        if RunEnergy(10) then
          Wait(1200+random(600))
        else
          Wait(2400+random(1200));
      end else
        Debug('To AK Bank failed.');
    end;

    function AKClickFurnace(Option: string): boolean;
    var
      z: integer;
      TPoint: TPoint;
      TPA, TPA2: TpointArray;
      ATPA: T2Dpointarray;
    begin
      z := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
      FindColorsTolerance(TPA, 3815997, MSX1, MSY1, MSX2, MSY2, 50);
      FindColorsTolerance(TPA2, 1911763, MSX1, MSY1, MSX2, MSY2, 18);
      ColorToleranceSpeed(z);
      TPA := CombineTPA(TPA, TPA2);
      if Length(TPA) < 1 then exit;
      ATPA := SplitTPAEx(TPA, 15, 10);
      SortATPASize(ATPA, true);
      TPA := ATPA[0];
      TPoint := MiddleTPA(TPA);
      if Length(TPA) > 0 then
      begin
        MMouse(TPoint.x+10, TPoint.y+10, 1, 1);
        if WaitUpText('urnac', 100+random(50)) then
        begin
          case random(2) of
          0: begin
               ClickMouse2(mouse_Right);
               Result := WaitOption(Option, 200+random(100));
             end;
          1: begin
               ClickMouse2(mouse_Left);
               Result := DidClick(True, 100);
             end;
          end;
          If Result then
          begin
            wait(300+random(200));
            Exit;
          end;
        end;
      end;
    end;

    Function ToEdgeFurnace: Boolean;
    var
      TPA: TPointArray;
      B, Bs: TBox;
      ATPA: T2DPointArray;
      T: TPoint;
      i: integer;
    begin
      if not LoggedIn then
        Exit;
      Debug('To Furnace...');
      Result := false;
      FindColorsSpiralTolerance(MMX2, MMCY, TPA, BuildingOutline, MMx1, MMy1, MMx2, MMy2, 0);
      if High(TPA) < 0 then
        Exit;
      ATPA := SplitTPA(TPA, 16);

      For i := 0 to High(ATPA) do
      begin
        Bs := GetTPABounds(ATPA[i]);
        if InRange(Bs.y2-Bs.y1, 23, 28) then
        begin
          B := Bs;
          TPA := ATPA[i];
          Break;
        end;
      end;

      if DebugMode then
        SMART_DrawDotsEx(true, TPA, clBlue);

      T := Point(B.x1+(B.x2-B.x1)/2+3, B.y1+(B.y2-B.y1)/2-5);
      if DebugMode then
      begin
        TPA := TPAFromBox(IntToBox(T.x, T.y, T.x+3, T.y+5 ));
        SMART_DrawDotsEx(False, TPA, clRed);
      end;
      if PointInBox(T, MMBox) then
      begin
        Mouse(T.x, T.y, 3, 5, true);
        FFlag(0);
        Result := true;
        wait(800+random(400));
      end else
        Debug('To Edge Furnace failed.');
    end;

    Function ToEdgeBank: Boolean;
    var
      TPA: TPointArray;
      B,Bs: TBox;
      ATPA: T2DPointArray;
      T: TPoint;
      i: integer;
    begin
      if not LoggedIn then
        Exit;
      Debug('To Bank...');
      Result := false;
      FindColorsSpiralTolerance(MMX1, MMY2, TPA, BuildingOutline, MMx1, MMy1, MMx2, MMy2, 0);
      if High(TPA) < 0 then
        Exit;
      ATPA := SplitTPA(TPA, 17);

      For i := 0 to High(ATPA) do
      begin
        Bs := GetTPABounds(ATPA[i]);
        Debug('W: '+ToStr(Bs.y2-Bs.y1)+' H: '+ToStr(Bs.x2-Bs.x1));
        if InRange(Bs.y2-Bs.y1, 42, 55) and InRange(Bs.x2-Bs.x1, 23, 36) then
        begin
          B := Bs;
          TPA := ATPA[i];
          Break;
        end;
      end;

      if DebugMode then
        SMART_DrawDotsEx(true, TPA, clBlue);

      T := Point(B.x2-9, B.y1+16);
      if DebugMode then
      begin
        TPA := TPAFromBox(IntToBox(T.x, T.y, T.x+5, T.y+5 ));
        SMART_DrawDotsEx(False, TPA, clRed);
      end;
      if PointInBox(T, MMBox) then
      begin
        Mouse(T.x, T.y, 2, 3, true);
        FFlag(0);
        Wait(1200+random(200));
        Result := True;
      end else
        Debug('To Edge Bank failed.');
    end;

    Function EdgeClickFurnace(Option: string): Boolean;
    var
      TPA, tpa1, tpa2: TPointArray;
      ATPA: T2DPointArray;
      B:TBox;
      T: TPoint;
    begin

      FindColorsTolerance(tpa1, 1516193, MSX1, MSY1, MSX2, MSY2, 50);
      //SMART_DrawDotsEx(true, tpa1, 255);
      if (Length(tpa1) < 1) and (Length(tpa2) < 1) then
        Exit;
      ATPA := TPAtoATPAEx(tpa1, 30, 40);
      SortATPAFromSize(ATPA, 450, true);
      //for i := 0 to High(ATPA) do Debug('ATPA['+ToStr(i)+']  Length = '+ToStr(Length(ATPA[i])));
      tpa1 := ATPA[0];
      B := GetTPABounds(tpa1);
      FindColorsTolerance(tpa2, 6121324, B.x1-50, B.y1-20, B.x2, B.y2+30, 50);

      if DebugMode then
      begin
        SMART_DrawDotsEx(true, tpa1, 255);
        SMART_DrawDotsEx(False, tpa2, 5026082);
      end;
      Debug('tpa1  Length = '+ToStr(Length(tpa1))+' ||  tpa2  Length = '+ToStr(Length(tpa2)));

      if (Length(tpa1) < 1) and (Length(tpa2) < 1) then
        Exit;

      TPA := CombineTPA(tpa1, tpa2);
      T := MiddleTPA(TPA);

      if PointInBox(T, IntToBox(B.x1-50, B.y1-20, B.x2, B.y2+30)) then
      begin
        MMouse(T.x-10, T.y-10, 20, 20);
        if WaitUpTextMulti(['urnac', 'nace'], 400) then
        begin
          case random(2) of
          0: begin
               ClickMouse2(mouse_Right);
               Result := WaitOption(Option, 200+random(100));
             end;
          1: begin
               ClickMouse2(mouse_Left);
               Result := DidClick(True, 100);
             end;
          end;
          If Result then
          begin
            wait(300+random(200));
            Exit;
          end;
        end;
      end;

    end;

    Function EdgeOpenBank: Boolean;
    var
      TPA: TPointArray;
      ATPA: T2DPointArray;
      i, cts: integer;
      T: TPoint;
    begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.33, 0.22);
      FindColorsTolerance(TPA, 3688009, MSX1, MSY1, MSX2, MSY2, 3)
      ColorToleranceSpeed(cts);
      SetColorSpeed2Modifiers(0.2, 0.2);
      if Length(TPA) < 1 then
        Exit;

      ATPA := SplitTPAEx(TPA, 1, 4);
      SortATPASize(ATPA, True);
      SetArrayLength(ATPA, Min(3, Length(ATPA)));
      SortATPAFromFirstPoint(ATPA, Point(MSCX+30, MSCY));

      for i := 0 to High(ATPA) do
      begin
        T := MiddleTPA(ATPA[i]);
        MMouse(T.x-5, T.y-5, 10, 10);
        wait(100+Random(100));
        if WaitUpText('ooth', 450) then
          if random(3) = 0 then
          begin
            ClickMouse2(mouse_Right);
            Result :=  WaitOptionMulti(['Bank B', 'nk B', 'k Bank'], 250+random(100));
          end else
          begin
            ClickMouse2(mouse_Left);
            Result := DidClick(True, 200);
          end;
          if Result then
            Exit;
      end;
    end;

    Function AKOpenBank: Boolean;
    var
      i, H, L: integer;
      T: TPoint;
      TPA: TPointArray;
      ATPA: T2Dpointarray;
    begin
      FindColorsSpiralTolerance(MSCX, MSCY, TPA, AKBankBooth_Color, MSX1, MSY1, MSX2, MSY2, 30);
      if Length(TPA) < 1 then
        Exit;
      ATPA := TPAtoATPAEx(TPA, 44, 200);
      SortATPAFrom(ATPA, Point(MSCX, MSCY));
      L := High(ATPA);
      If L > 1 then
        H := 1 Else H := L;
      For i := 0 to H do
      begin
        T := MiddleTPA(ATPA[i]);
        MMouse(T.x, T.y, 1, 1);
        if WaitUpText('ooth', 450) then
          if random(3) = 0 then
          begin
            ClickMouse2(mouse_Right);
            Result :=  WaitOptionMulti(['Bank B', 'nk B', 'k Bank'], 250+random(100));
          end else
          begin
            ClickMouse2(mouse_Left);
            Result := DidClick(True, 200);
          end;
          if Result then
            Exit;
      end;
    end;

    Function Smelt: boolean;
    var
      i, s, C, Timer: integer;
      iCa: TIntegerArray;
      T: TPoint;
      Item: TTPAItem;
    begin
      With Playas[CurrentPlayer] do
      begin
        Debug('Going to smelt...');

      repeat
        if SmeltBars then
        if (iCount(BaseItem) > 0) then
         if ClickFurnace('elt') then
         begin
           Timer := GetSystemTime + 8000+random(2000);
           repeat
             Wait(50+random(50));//Waiting for smith options to pop up
             if (GetSystemTime > Timer) or not LoggedIn then
               Exit;
           until FindTextTpaEx(2070783, 0, MCX1, MCY1, MCX2, MCY2, T.x, T.y, SmeltText, statchars, Nothing);
           Wait(RandomRange(150, 350));//Don't want a instant click, the text can pop up fast
           MouseBox(T.x-20, T.y-30, T.x+20, T.y+8, 1);
           Debug('Smelting Ore...');

           Timer := GetSystemTime+4000*WithDrawMain;
           repeat
             If not LoggedIn then
               Exit;
             if FindNormalRandoms then
               Break;
             if ClickContinue(true, true) then
               Break;
             Wait(300+random(200));
           until( iCount(BaseItem) < 1) or (GetSystemTime > Timer);
           UpdateItem(CraftedItem, 2, False);
           if iCount(CraftedItem) < 1 then
             UpdateItem(CraftedItem, WithDrawMain+2, True);
         end;

        if SmeltBars then
          Item := CraftedItem
        else
          Item := BaseItem;

       //CannonBall Begin
        if CannonBall or CraftGold or CraftSilver then
         if ( iCount(Item) > 0 ) then
         begin
           if CannonBall then
             Debug('Making Cannonballs...')
           else
             Debug('Making '+Players[CurrentPlayer].Strings[0]+'...');
           for i := 0 to 3 do
           begin
             iCa := iCountArr(Item);
             s := iCa[random(High(iCa))];
             if ExistsItem(s) then
             begin
               MouseItem(s, mouse_Left);
               Break;
             end;
           end;

           if ClickFurnace('bar') then
           begin
             Timer := GetSystemTime + 8000+random(2000);
             repeat
               Wait(100+random(100));//Waiting for options to pop up
               if (GetSystemTime > Timer) or not LoggedIn then
                 Exit;
               if CannonBall then
                 if FindTextTpaEx(2070783, 0, MCX1, MCY1, MCX2, MCY2, T.x, T.y, 'nonb',statchars, Nothing) then
                 begin
                   Wait(RandomRange(150, 350));
                   MouseBox(T.x-20, T.y-30, T.x+20, T.y+8, 1);
                   Break;
                 end;
             until GoldMenu or SilverMenu;

             if CraftGold then
             begin
               T := GoldCraftCoords(Coords.x, Coords.y);
               Mouse(T.x, T.y, 8, 8, false);
             end;

             If CraftSilver then
               FindTextTPA(52224, 0, MSX1, MSY1, MSX2, MSY2, SmeltText, StatChars, ClickRight);

             if CraftSilver or CraftGold then
              if WaitOptionMulti(['ke Al', 'e All', 'ke A', 'All'], 2000) then
              begin
                Timer := GetSystemTime+4000*WithDrawMain;
                repeat
                  If not LoggedIn then
                    Exit;
                  if FindNormalRandoms then
                    Break;
                  if ClickContinue(true, true) then
                    Break;
                  Wait(300+random(200));
                until( iCount(Item) < 1 ) or (GetSystemTime > Timer);
                UpdateItem(CraftedItem, 2, false);
                if iCount(CraftedItem) < 1 then
                  UpdateItem(CraftedItem, 2, True);
              end;

              if CannonBall then
              begin
                Timer := GetSystemTime+6666*WithDrawMain;
                repeat
                  If not LoggedIn then
                    Exit;
                  if FindNormalRandoms then
                    Break;
                  if ClickContinue(true, true) then
                    Break;
                  Wait(300+random(200));
                until( iCount(Item) < 1 ) or (GetSystemTime > Timer);
              end;
            end;
         end;
        //CannonBall end;

        Inc(C);
        if CannonBall then
         if ( iCount(BaseItem) > 0 ) then
          Continue;

      until( iCount(BaseItem) < 1) or ( C > 5 );
      Debug('Smelting Done.');
      Result := true;
      end;//With do end;
    end;

    Function Bank: boolean;
    var
      T: TPoint;
      B: TBox;
      TPA: TPointArray;
      W, F, Timer, CBalls, WithDrawIs, A:integer;
      Recorded: Boolean;
    begin
      Debug('Opening Bank...');

      Timer := GetSystemTime + 40000;
      if Playas[CurrentPlayer].AlKharid or Playas[CurrentPlayer].EdgeVille then
      repeat
        Wait(800+random(502));
        if (PinScreen) or (BankScreen) Then
          Break;
        if Playas[CurrentPlayer].MyOpenBank() then
          Break;
        if OpenBankNPC then
          Break;
      until (GetSystemTime > Timer) or (not LoggedIn);

      repeat
        Wait(50+random(20));
        if InRange(CountColor(2070783, 90, 147, 230, 211), 400, 430) then
          if (Players[CurrentPlayer].Pin <> '') then
            MouseBox(90, 147, 230, 211, 1)
          else
          begin
            LogoutSeq('Bank Pin settings unknown');
            Exit;
          end;
      until PinScreen or BankScreen or (not LoggedIn) or (GetSystemTime > Timer);

      if (GetSystemTime > Timer) or (not LoggedIn) then
      begin
        SetLoc('Lost');
        Exit;
      end;

      if PinScreen then
      begin
        Debug('Entering Pin...');
        F := 0;
        repeat
          InPin(Players[CurrentPlayer].Pin);
          Inc(F);
        until (BankScreen) or ( F > 5 )
        if (F > 5) then
        begin
          LogoutSeq('Failed to enter bank pin');
          Exit;
        end;
      end;

      if BankScreen then
      with Playas[CurrentPlayer] do
      begin

        if (iCount(CraftedItem) < 26 ) and InvFull then
          Inc(FailToSmelt)
        else
          FailToSmelt := 0;

        if (FailToSmelt > 2) then
        begin
          LogoutSeq('Failed to smelt 2+ times');
          Exit;
        end;

        repeat
          Wait(100+random(100));
        Until (CountColor(65535, MBX1, MBY1, MBX2, MBY2) > 20) or not LoggedIn;

        if Not Recorded then
        begin
          if CannonBall then
          begin
            FindColors(TPA, 65535, MIX1, MIY1, MIX2, MIY2);
            B := GetTPABounds(TPA);
            CBalls := GetAmountBox(B);
            Debug('Cannonballs: '+inttostr(CBalls));
            MyVars[2] := MyVars[2] + CBalls;
            if SmeltBars then
              MyVars[1] := MyVars[1] + Round(CBalls / 4);
          end;
          if CraftGold or CraftSilver then
            MyVars[1] := MyVars[1] + iCount(CraftedItem);

          if SmeltBars and not CannonBall then
            MyVars[1] := MyVars[1] + iCount(CraftedItem);
          Debug('Record Count: '+ToStr(MyVars[1]));
          Recorded := true;
        end;
       
        repeat
          if not LoggedIn then
            Exit;
          if (InvCount > 0) then
          begin
            Debug('Banking...');
            if HasCoalBag then
              Deposit(2, 28, true)
            else
              DepositAll;
          end;

          BaseAmount := BaseAmount - WithDrawMain;
          if (WithDrawSeco > -1) then
            SecoAmount := SecoAmount - WithDrawSeco;
          FixBank;
          BankTab(1);
          Debug('Withdrawing...');

          Timer := GetSystemTime + 2000;
          Repeat
            A := GetAmountBox(BankIndexToMSBox(BankSlot1));
            Wait(50+random(50));
          until (A > 0) or (GetSystemTime > Timer);
          if (A < (WithDrawMain+1)) and ((BaseAmount - WithDrawMain) < (WithDrawMain+1)) then
          begin
            CloseBank;
            LogoutSeq('Ran out of primary');
            Exit;
          end;
          If (A > (WithDrawMain+1)) then
            BaseAmount := A;

          if (WithDrawSeco > -1) then
          begin
            Timer := GetSystemTime + 2000;
            Repeat
              A := GetAmountBox(BankIndexToMSBox(BankSlot2));
              Wait(50+random(50));
            until (A > 0) or (GetSystemTime > Timer);
            if (A < (WithDrawSeco+1)) and ((SecoAmount - WithDrawSeco) < (WithDrawSeco+1)) then
            begin
              CloseBank;
              LogoutSeq('Ran out of secondary');
              Exit;
            end;
            If (A > (WithDrawSeco+1)) then
              SecoAmount := A;
          end;

          if HasCoalBag then//Coal Bag mod
            if (WithDrawSeco > 0) then
            begin
              T := BankIndexToBankPoint(BankSlot2);
              Withdraw(T.x, T.y, 0);
              Timer := GetSystemTime + 60000;
              Repeat
                Wait(50);
                if (GetSystemTime > Timer) then
                  Exit;
              until (InvFull);
              InvMouse(1, mouse_Right);//Coal ore
              WaitOptionMulti(['Fill', 'ill', 'll C'], 1000);
              Timer := GetSystemTime + 10000;
              repeat
                wait(50+random(100));
                if InChat('already full') then
                  Deposit(2, 28, true);
                if (GetSystemTime > Timer) then
                  Exit;
              until (InvCount = 1);
            end;


          if (WithDrawMain > 26) then
            WithDrawIs := 0
          else
            WithDrawIs := WithDrawMain;

          T := BankIndexToBankPoint(BankSlot1);
          Withdraw(T.x, T.y, WithDrawIs);
          Timer := GetSystemTime + 60000;
          Repeat
            Wait(50);
          until (GetSystemTime > Timer) or (InvCount >= WithDrawMain);
          if (GetSystemTime > Timer) then
            Exit;

          UpdateItem(BaseItem, 2, False);
          if iCount(BaseItem) <> WithDrawMain then
            UpdateItem(BaseItem, 2, True);

          if (WithDrawSeco > -1) then
            if (InvCount >= WithDrawMain) then
            begin
              if HasCoalBag then
                WithDrawIs := 0
              else
              begin
                if WithDrawSeco > 14 then
                  WithDrawIs := 0
                else
                  WithDrawIs := WithDrawSeco;
              end;
              T := BankIndexToBankPoint(BankSlot2);
              Withdraw(T.x, T.y, WithDrawIs);
              Timer := GetSystemTime + 60000;
              Repeat
                Wait(50);
              until (GetSystemTime > Timer) or (InvCount >= 27);
              UpdateItem(SecoItem, WithDrawMain+2, False);
              if iCount(SecoItem) < 1 then
                UpdateItem(SecoItem, WithDrawMain+2, True);
            end;
          if (GetSystemTime > Timer) then
            Exit;
          Inc(W);
        until(InvCount >= 27) or (W > 10);

        if (W > 10) then
        begin
          LogoutSeq('Banking failed');
          Exit;
        end;
      end;

      with Playas[CurrentPlayer] do
      begin

        if not (iCount(BaseItem) = WithDrawMain) then
        begin
          LogoutSeq('Counted BaseItem wrong');
          Exit;
        end;

        if HasCoalBag then
          A := 1
        else
          A := WithDrawSeco;

        if (WithDrawSeco > -1) then
        if not (iCount(SecoItem) >= A) then
        begin
          LogoutSeq('Counted SecoItem wrong');
          Exit;
        end;

      end;

      Debug('Done Banking...');
      Case random(3) of
        1: CloseBank;
      end;
      Inc(Players[CurrentPlayer].Banked);
      result := true;

      //if (ReportTime < GetSystemTime) then
        Report;
    end;

    procedure DoChecks;
    var
      r: integer;
    begin
      FindNormalRandoms;

      r := round(rs_GetCompassAngleDegrees*100.0);
      Debugln('Compass: '+tostr(r/100.0)+' Degrees  r := ' + ToStr(r));
      if InRange(r, 300, 35699) then
      begin
        Debug('ClickNorth');
        ClickNorth(SRL_ANGLE_HIGH);
      end;

      if (HowManyPlayers > 1) then
       if ( GetSystemTime >= LogTime ) then
        LogoutSeq('');

      if Playas[CurrentPlayer].TakeSleeps then
       TakeASleep(Playas[CurrentPlayer].SleepTime);

      if Playas[CurrentPlayer].TakeBreaks then
       TakeABreak;

      if Playas[CurrentPlayer].RestForRun then
        if Loc('banked') then
        if not RunEnergy(28+random(13)) then
        begin
          Debug('Resting...');
          RestUntil(50+random(45));
          Debug('Done resting.');
        end;
      RunEnergy(20);

      if not LoggedIn then
        LogoutSeq('');

      if not Playas[CurrentPlayer].DisableAntiBan then
        r := Random(60);
      if (r < 5) then
        Debug('Antiban...');
      case r of
        10: wait(1000+random(10000));
        1,2: if (Playas[CurrentPlayer].SmeltBars) or (Playas[CurrentPlayer].CannonBall) then
               HoverSkill('smithing' ,false)
             else
               HoverSkill('crafting' ,false);
        3: PickUpMouse;
        4: if (HowManyPlayers = 1) then
            if random(20) = 1 then
             Wait(RandomRange(29000, 59000));//29-59secs
      end;
      if (r < 5) then
        Debug('End Antiban.');
      FindNormalRandoms;
    end;

    function ArrInStrEx(StrArr: TStringArray; Str: string): integer;//Needed for figuring out crafting
    var
      i: integer;
    begin
      Result := -1;
      for i := 0 to High(StrArr) do
        if Pos(StrArr[i], Str) > 0 then
        begin
          Result := i
          Exit;
        end;
    end;

    procedure EndOfScript;
    begin
      writeln('');
      writeln('Thanks for using my AK Smelter!');
      writeln('Please post proggies on forums!');
      writeln(' -Narcle');
    end;

    procedure ScriptStartup;
    var
      i: integer;
      CreateStr: string;
      Gem, Kind: TIntegerArray;
    begin
      Debug('SMART & SRL Loading...');
      Smart_Server := 1;
      Smart_Members:= true;
      Smart_Signed := true;
      Smart_SuperDetail := false;
      SetupSRL;

      SRL_Procs[srl_OnLogIn] := @SetupPlayer;
      SRL_Procs[srl_OnLogOut] := @Report;
      AddOnTerminate('EndOfScript');

      NumberOfPlayers(100);
      DeclarePlayers;
      if (Players[0].Name = '') then
      begin
        SafeInitForm;
        if AKpf_SavePlayers then
          SavePlayers(True);
        if AKpf_Terminate then
          TerminateScript;
      end else
      begin
        HowManyPlayers := 0;
        CurrentPlayer := 0;
        DeclarePlayers;
        for i := 0 to High(Players) do
        if (Players[i].Name <> '') then
          Inc(HowManyPlayers)
        else
          Break;
        NumberOfPlayers(HowManyPlayers);
      end;

      Debug('Player count = '+ToStr(HowManyPlayers));

      SetupSRLStats(18, stats_Username, stats_Userpass);
      if (stats_Username = '') then
      begin
        stats_Username := 'Anonymous';
        stats_Userpass := 'anon1337';
      end;

      Gem  := [15, 40, 55, 70, 85, 100];//Base gem xp
      Kind := [0, 5, 15, 10];//Kind modifiers, Dragonstone Amulet is +50

      For i := 0 to HowManyPlayers - 1 do
      With Playas[i] do// Playas[CurrentPlayer]
      begin
        CreateStr := LowerCase(Players[i].Strings[0]);
        //All booleans should be false
        If Length(Players[i].Name) < 1 then
        begin
          Writeln('Player '+ToStr(i)+' has no name, making inactive for now.');
          Players[i].Active := false;
          Continue;
        end;
        if Players[i].Nick = '' then
          Players[i].Nick := Capitalize(Copy(Players[i].Name, 1, 4));

        try
          BankSlot1 := Players[i].Arrays[0][0];
          BankSlot2 := Players[i].Arrays[0][1];
          TakeBreaks := Players[i].Arrays[0][2];
          TakeSleeps := Players[i].Arrays[0][3];
          SleepTime := Players[i].Arrays[0][4];
          RestForRun := Players[i].Arrays[0][5];
          HasCoalBag := Players[i].Arrays[0][6];
          DisableAntiBan := Players[i].Arrays[0][7];
        except
          Writeln('Player '+ToStr(i)+': Settings array set wrong, setting to defaults.');
          BankSlot1 := 1;
          BankSlot2 := 2;
          TakeBreaks := true;
          TakeSleeps := false;
          SleepTime := '23:00';
          RestForRun := true;
          HasCoalBag := false;
          DisableAntiBan := false;
        end;

        Case Lowercase(Players[i].Strings[1]) of
          'al kharid': AlKharid := True;
          'edgeville', 'edgeville (beta)': EdgeVille := True;
          'neitiznot': Neitiznot := True;
          else
          begin
            Writeln('Smelting location not choosen, setting to default (Al Kharid).');
            Players[i].Strings[1] := 'al kharid';
            AlKharid := true;
          end;
        end;

        if AlKharid then
        begin
          ClickFurnace := @AKClickFurnace;
          MyOpenBank := @AKOpenBank;
          Players[i].Loc := 'lost';
        end;

        if EdgeVille then
        begin
          ClickFurnace := @EdgeClickFurnace;
          MyOpenBank := @EdgeOpenBank;
          Players[i].Loc := 'at bank';
        end;

        WithDrawSeco := -1;

        if ArrInStr(['ring', 'necklace', 'bracelet', 'amulet'], CreateStr) then
        begin
          CraftGold := True;
          statsStr := 'Gold Bars Crafted';
          Coords.x := ArrInStrEx(['gold','sapphire','emerald','ruby','diamond','dragonstone'], CreateStr);
          Coords.y := ArrInStrEx(['ring','necklace','amulet','bracelet'], CreateStr);
          if (Coords.x < 0) or (Coords.y < 0) then
          begin
            Writeln('');
            Writeln('Player '+ToStr(i)+' create string not setup correctly, please fix.');
            TerminateScript;
          end;
          if (Pos('dragonstone', CreateStr)>0) and (Pos('amulet', CreateStr)>0) then
            XPper := 150.0//Dragonstone Amulet xp
          else
            XPper := Gem[Coords.x]+Kind[Coords.y];
          if (Coords.x = 0) then
            WithDrawMain := 28
          else
          begin
            WithDrawMain := 14;
            WithDrawSeco := 14;
          end;
        end;

        if (Pos('silver', CreateStr) > 0) and not(Pos('bars', CreateStr) > 0) then
        begin
          CraftSilver := True;
          XPper := 50.0;
          WithDrawMain := 28;
          statsStr := 'Silver Bars Crafted';
          Case CreateStr of
            'silver holy symbol':
              SmeltText := 'aradom';
            'silver unholy symbol':
              SmeltText := 'nholy';
            'silver sickle':
              SmeltText := 'ickle';
            'silver tiara':
              begin
                SmeltText := 'iara';
                XPper := 52.5;
              end;
            else
            begin
              Writeln('');
              Writeln('Player '+ToStr(i)+' create string not setup correctly, please fix.');
              TerminateScript;
            end;
          end;
        end;

        BagCount := 28;

        if (not CraftSilver) and (not CraftGold) then
        Case CreateStr of
          'cball','cballs', 'cannonballs', 'cannonballs from ores':
          begin
            BaseDivi := 3;
            XPper := 17.5;//steel
            SmeltText := 'teel';
            SmeltBars := True;
            CannonBall := True;
            statsStr := 'Steel Bars Melted';
          end;

          'steeltoball', 'bartoballs', 'steeltocballs', 'steeltoballs', 'cannonballs from bars':
          begin
            BaseDivi := 1;
            XPper := 17.5;//steel
            CannonBall := True;
            HasCoalBag := false;
          end;

          'iron', 'iron bars':
          begin
            BaseDivi := 1;
            SmeltText := 'ron';//set
            XPper := 12.5;
            SmeltBars := True;
            statsStr := 'Iron Bars Melted';
            HasCoalBag := false;
          end;

          'steel', 'steel bars':
          begin
            BaseDivi := 3;
            SmeltText := 'teel';//set
            XPper := 17.5;
            SmeltBars := True;
            statsStr := 'Steel Bars Melted';
          end;

          'mith','mithril', 'mithril bars':
          begin
            BaseDivi := 5;
            SmeltText := 'ithril';
            XPper := 30.0;
            SmeltBars := True;
            statsStr := 'Mithril Bars Melted';
          end;

          'addy','addamite','addamantite','addamantite bars':
          begin
            BaseDivi := 7;
            SmeltText := 'damant';//set
            XPper := 37.5;
            SmeltBars := True;
            statsStr := 'Adamant Bars Melted';
          end;

          'rune','runite', 'runite bars':
          begin
            BaseDivi := 9;
            SmeltText := 'une';//set
            XPper := 50.0;
            SmeltBars := True;
            statsStr := 'Runite Bars Melted';
          end;

          'copper', 'tin', 'bronze', 'bronze bars':
          begin
            BaseDivi := 2;
            SmeltText := 'ronze';//set
            XPper := 6.2;
            SmeltBars := True;
            statsStr := 'Bronze Bars Melted';
            HasCoalBag := false;
          end;

          'gold', 'gold bars':
          begin
            BaseDivi := 1;
            SmeltText := 'old'
            XPper := 22.5;
            SmeltBars := True;
            statsStr := 'Gold Bars Melted';
            HasCoalBag := false;
          end;

          'silver', 'silver bars':
          begin
            BaseDivi := 1;
            SmeltText := 'ilver';
            XPper := 13.7;
            SmeltBars := True;
            statsStr := 'Silver Bars Melted';
            HasCoalBag := false;
          end;
          else
            begin
              Writeln('');
              Writeln('Player '+ToStr(i)+' create string not setup correctly, please fix.');
              TerminateScript;
            end;
        end;
        if WithDrawMain < 1 then
        begin
          if HasCoalBag then
            BagCount := BagCount + 26;//Coal bag takes one spot so -1 for invy space
          WithDrawMain := BagCount / BaseDivi;
          if BaseDivi <> 1 then
            WithDrawSeco := (BaseDivi-1)*WithDrawMain
          else
            WithDrawSeco := -1;
        end;
        Debug('WithDrawMain: '+ToStr(WithDrawMain));
        Debug('WithDrawSeco: '+ToStr(WithDrawSeco));
      end;

      for i := 0 to HowManyPlayers-1 do
      if Players[i].Active then
      begin
        CurrentPlayer := i;
        Break;
      end;

      Writeln('CurrentPlayer = '+Players[CurrentPlayer].Name);

      WRiteln('AK Smelter v'+version);
      Writeln('  By Narcle');
      Debug('Runescape Loading...');
      While not RSReady do
        Wait(100);
      Debug('Logging in...');
      ResetTimer('Break');
      LoginPlayer;
    end;

    begin
      ScriptStartup;
      repeat
        if Playas[CurrentPlayer].AlKharid then
        Case Players[CurrentPlayer].Loc of
          'lost':
            if not AKFindPosition then
              LogoutSeq('Couldn''t find position');
          'at bank':
            if Bank then
              SetLoc('banked');
          'banked':
            if ToAKCactus(true) then
              SetLoc('to furnace');
          'to furnace':
            if ToAKFurnace then
              SetLoc('at furnace');
          'at furnace':
            if Smelt then
              SetLoc('smelted');
          'smelted':
            if ToAKCactus(False) then
              SetLoc('to bank');
          'to bank':
            if ToAKBank then
              SetLoc('at bank');
        end;

        if Playas[CurrentPlayer].Edgeville then
        Case Players[CurrentPlayer].Loc of
          'at bank':
            if Bank then
              SetLoc('to furnace');
          'to furnace':
            if ToEdgeFurnace then
              SetLoc('at furnace');
          'at furnace':
            if Smelt then
              SetLoc('to bank');
          'to bank':
            if ToEdgeBank then
              SetLoc('at bank');
          'lost': LogoutSeq('Couldn''t find position');
        end;

        DoChecks;
      until (AllPlayersInactive);
    end.
    Last edited by BigRedJapan; 06-16-2012 at 05:51 AM.

  16. #2266
    Join Date
    Jun 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [================================================== ====================]
    [ Nick | Active | Worked | Banked | Bars | Crafted | XP | XP/Hour ]
    [================================================== ====================]
    [ **** | True | 06:25:10 | 97 | 0 | 9068 | 57806 | 9005 ]
    [================================================== ====================]

    9k Cannonballs, brilliant!

    Many Kudos!

  17. #2267
    Join Date
    May 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SwitchToPlayer(PlayerNo: 0, Active: False);
    Player is not Active...
    All players not active!
    NextPlayer(True)

    anyone knows how to fix this, it keeps logging out after opening bank after doing about 2 loads it says failed to smith 2 times as well but it has already smith all the bars



    ps: how to make it dont take breaks anyone?

  18. #2268
    Join Date
    Jun 2012
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this bot is not working for me, in line 1787 ScreenShots := true; is missed up.
    after i delete that line it pops open another tab called smart where line 95 98 101 are also missed up plz help me

  19. #2269
    Join Date
    Jun 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by megashadow42691 View Post
    this bot is not working for me, in line 1787 ScreenShots := true; is missed up.
    after i delete that line it pops open another tab called smart where line 95 98 101 are also missed up plz help me
    same here.

  20. #2270
    Join Date
    Jul 2007
    Location
    Ottawa, Canada
    Posts
    930
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Your script is working great Narcle (After commenting the compile error )

    [================================================== ====================]
    [ Nick | Active | Worked | Banked | Bars | Crafted | XP | XP/Hour ]
    [================================================== ====================]
    [ SECRET | True | 02:15:29 | 117 | 0 | 1596 | 87780 | 38873 ]
    [================================================== ====================]

    Emerald Rings.
    I stopped it myself because I wanted to restart smart before bed
    ~ Metagen

  21. #2271
    Join Date
    Mar 2012
    Posts
    107
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    So the script loads properly but it only works 2-3 minutes and it comes up "Base" or "Failed to smelt 2 times" and then terminates.... Sometimes it doesn't bank the resources properly...

  22. #2272
    Join Date
    Apr 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Does anyone know how to stop the form from popping up. I have all my info put in (look below) but it still keeps on popping up. Any help would be appreciated. Also im not sure what the use player in script is used for but i have set that to both true and false and it still didnt work.

    Name := 'username'; //Character Name
    Pass := 'password'; //Character Pass
    Active := true; //Use player in script?
    Pin := ''; //Pin for bank
    Strings[0] := 'steel'; //What to smith/craft? [Create string]
    Strings[1] := 'Edgeville';//Where are you smithing? [Al Kharid, Edgeville]
    //cballs, steeltoball, steel, mith, addy, runite, iron, bronze, silver, gold
    Arrays[0] := [1, 2, true, false, '23:00', false, false, false];//Settings array
    //Settings array := [1st Bankslot, 2nd Bankslot, Take-Breaks, Take-Sleeps, Sleep-Time 'hh:mm', Rest for run, Use Coal bag];
    end;

  23. #2273
    Join Date
    Dec 2011
    Posts
    505
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    To fix the form issue

    look for line #1794
    You will see this, which is inside "ScriptStartUp":
    Simba Code:
    if (Players[0].Name = '') then
      begin
        SafeInitForm;
        if AKpf_SavePlayers then
          SavePlayers(True);
        if AKpf_Terminate then
          TerminateScript;
      end else

    Simply change all that which executes the form adding "//" before each of them:
    Simba Code:
    //  if (Players[0].Name = '') then
    //  begin
    //    SafeInitForm;
    //    if AKpf_SavePlayers then
    //      SavePlayers(True);
    //    if AKpf_Terminate then
    //      TerminateScript;
    //  end else

    That is it :P

  24. #2274
    Join Date
    May 2012
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok can someone please tell me how to remove the antiban from script itself as i am not using the form?????????????????

  25. #2275
    Join Date
    Apr 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by blinkblink View Post
    To fix the form issue

    look for line #1794
    You will see this, which is inside "ScriptStartUp":
    Simba Code:
    if (Players[0].Name = '') then
      begin
        SafeInitForm;
        if AKpf_SavePlayers then
          SavePlayers(True);
        if AKpf_Terminate then
          TerminateScript;
      end else

    Simply change all that which executes the form adding "//" before each of them:
    Simba Code:
    //  if (Players[0].Name = '') then
    //  begin
    //    SafeInitForm;
    //    if AKpf_SavePlayers then
    //      SavePlayers(True);
    //    if AKpf_Terminate then
    //      TerminateScript;
    //  end else

    That is it :P
    Thank you so much!! It actually is working without a form!! I really appreciate it!! Anyone who is having trouble with the form still appearing follow these exact directions! +1

Page 91 of 95 FirstFirst ... 41818990919293 ... LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Smelter 3.25
    By Neonknight77 in forum RS3 Outdated / Broken Scripts
    Replies: 9
    Last Post: 05-25-2008, 10:15 PM
  2. need help with me smelter!!
    By TheChineseMan in forum OSR Help
    Replies: 6
    Last Post: 05-04-2008, 08:11 AM
  3. Smelter
    By Bobzilla69 in forum RS3 Outdated / Broken Scripts
    Replies: 15
    Last Post: 04-14-2007, 02:11 AM
  4. Need Smelter
    By 2goodforu in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 01-30-2007, 07:38 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
  •