Results 1 to 5 of 5

Thread: Ok lil help on my (unf) maker?

  1. #1
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Ok lil help on my (unf) maker?

    ok so i made this caus i needed one and figured that i'de just make instead of serching and what not, and i was going to post it but its a lil buggy. Can some help me out by making a better main loop as well as failsafes?
    heres the script:
    SCAR Code:
    {=========================================================================]<--Credit to WT-Fakawi For this layout.
    [           NAME        : (unf) Potion Maker                              ]
    [           WRITER      : Mikevskater                                     ]
    [           CATEGORY    : Herblore                                        ]
    [           DESCRIPTION : Makes any (unf) potion that involves a herb     ]
    [           USAGE       : To Raise Your Herblore Level                    ]
    [           CONTACT     : Pm Mikevskater On Srl                           ]
    [=========================================================================]
    [                           Instructions.                                 ]
    [=========================================================================]
    [ 1. USE Runescape With Low Detail, Very Bright.                          ]
    [ 2. Set your Screen To 32 bit TRUE color.                                ]
    [ 3. Position Players In Bank                                             ]
    [ 4. Set Playernames And Passwords / SRL Id And Pass in Player Setup      ]
    [ 5. Start with either 14 herbs and vials of water in inv or it will bank ]
    [ 6. Have Herbs in first bank spot and vials of water in secound          ]
    [ 7. Please Post Proggies/Bugs                                            ]
    [=========================================================================]
    [Valid banks are:                                                         ]
    [    'akb': 'al kharid'/\ 'lb': 'lumbridge'/\ 'veb': 'varrock east'       ]
    [    'vwb': 'varrock west'/\ 'feb': 'falador east'/\ 'fwb': 'falador west']
    [    'db': 'draynor' /\ 'eb': 'edgeville bank'                            ]
    [=========================================================================}

    program Mikevskaters_unf_Pot_Maker;
    {.include srl/srl.scar}

    var
      x, y, Herbs, Vials, NumofHerbs, NumofVials, NumofPots :integer;
      Potting :Boolean;

    const
      Bank = 'veb'; //What Bank To Use (look at "Valid Banks" above for letters)
      Dir = 'N';    //Run Away Direction (N, S, W, E)
    ////////////////////////////////////////////////////////////////////////////////
    procedure PlayerSetup;
    begin
      SRLID     := '';
      SRLPassword   := '';
      CurrentPlayer   := 0;
      HowManyPlayers  := 1;
      NumberOfPlayers(HowManyPlayers);
     
      Players[0].Name        := '';         //UserName
      Players[0].Pass        := '';         //Password
      Players[0].Nick        := '';         //NickName
      Players[0].Strings[0]  := '';         //BankPin, Leave blank if you don't have one.
      Players[0].Active      := True;

    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Dtms(which :string);
    begin
      case which of
      'herb': Herbs := DTMFromString('78DA637461626078CA800242CAF9C1342394C' +
           'F680554F392010D30A2AA0199F38E801A5FA09AE704D4F803D5DC' +
           'C1AF0600EFCC06D0');
      'vial': Vials := DTMFromString('78DA6374646260A860644006ABD61E01D3305' +
           '1462B4C353059B81A0BA09A1A026ABC816A6A09A8F100AA2923A0' +
           'C609A8A619BF1A00BF1C06A9');
      'both': begin
                Herbs := DTMFromString('78DA637461626078CA800242CAF9C1342394C' +
           'F680554F392010D30A2AA0199F38E801A5FA09AE704D4F803D5DC' +
           'C1AF0600EFCC06D0');
                Vials := DTMFromString('78DA6374646260A860644006ABD61E01D3305' +
           '1462B4C353059B81A0BA09A1A026ABC816A6A09A8F100AA2923A0' +
           'C609A8A619BF1A00BF1C06A9');
              end;
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Free(which :string);
    begin
      case which of
      'herb': freedtm(herbs);
      'vial': freedtm(vials);
      'both': begin
                freedtm(herbs);
                freedtm(vials);
              end;
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure BankError;
    begin
      Writeln('We have had an error in the bank, might not have any more herbs...');
      Writeln('Post Proggy');
      Status('ERROR! Post Proggy');
      TerminateScript;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure RandomFind;
    begin
      FindNormalRandoms;
      if FindFight then
        RunAway(Dir, true, 1, 1000);
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Bankopen;
    begin
      OpenBankFast(Lowercase(bank));
      InPin(Players[Currentplayer].Strings[0]);
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Firstthing;
    begin
      ClearDebug;
      Writeln('Unfinished Potion Maker By MikeVSkater');
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure FirstBank;
    begin
      Bankopen;
      Depositall;
      FixBank;
      wait(750);
      if FindDtm(Herbs, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        MMouse(x,y,0,0);
        if IsUpText('lean') then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('X');
          wait(1000);
          typesend('14');
        end;
      end else
        BankError;
      if FindDtm(Vials, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        MMouse(x,y,0,0);
        if IsUpText('ial of water') then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('All');
        end;
      end else
      begin
        BankError;
      end;
      CloseBank;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    function Count(which : string) : integer;
    var
      Thedtm, i :integer;
      Points :TBox;
    begin
      Dtms(which);
      case which of
        'vial': Thedtm := Vials;
        'herb': Thedtm := Herbs;
      end;
      for i := 1 to 28 do
      begin
        if ExistsItem(i) then
        begin
          Points := InvBox(i);
          if FindDTM(Thedtm, x, y, Points.x1, Points.y1, Points.x2, Points.y2) then
            Result := Result + 1;
        end;
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure UseFirst;
    begin
      Dtms('herb');
      if FindDtm(Herbs, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        MMouse(x, y, 0, 0);
        wait(250 + random(250));
        if IsUpText('Clean') then
        begin
          wait(250 + random(250));
          Mouse(x, y, 0, 0, false);
          repeat
          wait(250 + random(250));
          until(ChooseOption('Use'));
        end;
      end;
      Free('herb');
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure UseSecound;
    begin
      Dtms('vial');
      if FindDtm(Vials, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        MMouse(x, y, 0, 0);
        wait(250 + random(250));
        if IsUpText('Vial of water') then
        begin
          wait(250 + random(250));
          Mouse(x, y, 0, 0, false);
          repeat
          wait(250 + random(250));
          until(ChooseOption('Use'));
        end;
      end;
      Free('vial');
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Clickonpot;
    begin
      MMouse(240, 400, 20, 20);
      wait(200+random(100));
      GetMousePos(x, y);
      Mouse(x, y, 1, 1, false);
      if not(ClickOption('All', 3)) then Exit;
      Potting := true
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure WaitWhilstPotting;
    begin
      if Potting = true then
      begin
        Dtms('herb');
        repeat
          wait(250);
          RandomFind;
        until(not(FindDtm(Herbs, x, y, MIX1, MIY1, MIX2, MIY2)));
        Free('herb');
        Potting := False;
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    Function Randoms :Boolean;
    begin
      if FindBox then
      begin
        CloseBank;
        SolveBox;
        FirstBank;
        Result := true;
      end;
      if not(InvCount = 14) then
      begin
        FirstBank;
        Result := true;
      end;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure BankNormal;
    begin
      Dtms('both');
      NumofHerbs := Count('herb');
      NumofVials := Count('vial');
      if (NumofHerbs = 14) and (NumofVials = 14)then
      begin
        exit;
      end;
      if FindDtm(Herbs, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        MMouse(x,y,0,0);
        if IsUpText('lean') then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('All');
        end;
      end else
      begin
        BankError;
      end;
      MouseItem(1, False);
      ChooseOption('All');
      if FindDtm(Vials, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        MMouse(x,y,0,0);
        if IsUpText('ial of water') then
        begin
          Mouse(x, y, 0, 0, false);
          ChooseOption('All');
        end;
      end else
      begin
        BankError;
      end;
      NumofPots := NumofPots + 14;
      ReportVars[0] := ReportVars[0] + 14;
      CloseBank;
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure Proggy;
    begin
      ClearDebug;
      Writeln('/-----------------------------------\');
      Writeln('|  (unf) Pot Maker by MikeVSkater   |');
      Writeln('\-----------------------------------/');
      Writeln('/-----------------------------------\');
      Writeln('Pots Made: ' + inttostr(NumofPots));
      Writeln('Time: ' + TimeRunning);
      Writeln('\-----------------------------------/');
    end;
    ////////////////////////////////////////////////////////////////////////////////
    procedure mainloop;
    begin
      if not LoggedIn then
      begin
        LoginPlayer;
        MakeCompass('N');
        SetAngle(True);
      end;
      Dtms('both');
      NumofHerbs := Count('herb');
      NumofVials := Count('vial');
      if not(NumofHerbs = 14) and not(NumofVials = 14)then
      begin
        firstbank;
        free('both');
      end;
      repeat
         UseFirst;
         UseSecound;
         RandomFind;
         ClickOnPot;
         WaitWhilstPotting;
         BankOpen;
         if (not(randoms)) then
         begin
           BankNormal;
         end;
         RandomFind;
         Proggy;
      until(false)
    end;
    ////////////////////////////////////////////////////////////////////////////////
    begin
      FirstThing
      Playersetup;
      setupsrl;
      ScriptId := '701';
      activateclient;
      wait(1000);
      mainloop;
    end.
    Kindof Inactive...

  2. #2
    Join Date
    Jan 2008
    Location
    Alberta
    Posts
    727
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Use DTMRotated not FindDTM, heres the thing for DTMRotated.

    SCAR Code:
    {*******************************************************************************
    function DTMRotated(DTM: Integer; var x, y: Integer; x1, y1, x2, y2: Integer): Boolean;
    By: Yakman
    Description: First looks for a DTM without rotation, then increases the amount
    of rotation around 0 gradually until it finds the DTM. A bit like the
    ProgressiveTol Bitmap Engines.
    *******************************************************************************}

    Maybe add a little bit more randomness to your MMouse/Mouse.

    Use 2-4 for the randomness for it.

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Actually, he doesn't need DTMRotated because he's checking the bank and inventory where they stay the same, though if the issues have been with DTM's then you could try that. Also, in count you have this:
    SCAR Code:
    Dtms(which);
      case which of
        'vial': Thedtm := Vials;
        'herb': Thedtm := Herbs;
      end;
    and I think that may be an error while coding, though I'm not sure (looks like you copied it from your Dtms procedure and took a little too much).
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    Actually, he doesn't need DTMRotated because he's checking the bank and inventory where they stay the same, though if the issues have been with DTM's then you could try that. Also, in count you have this:
    SCAR Code:
    Dtms(which);
      case which of
        'vial': Thedtm := Vials;
        'herb': Thedtm := Herbs;
      end;
    and I think that may be an error while coding, though I'm not sure (looks like you copied it from your Dtms procedure and took a little too much).
    No i typed that myself, it sets the dtm to look for to whatever i put in when i call the procedure.
    Kindof Inactive...

  5. #5
    Join Date
    Dec 2007
    Location
    Michigan, USA
    Posts
    280
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    anyone mind helpin me out here? I was thinking for the vial click, would making a dtm with the herb with white trim work? and like make sure it finds that before it clicks on the vial of water?
    Kindof Inactive...

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. TPA Maker!
    By BazzBarrett in forum RS3 Outdated / Broken Scripts
    Replies: 4
    Last Post: 09-15-2008, 11:28 AM
  2. New Air Rune Maker
    By Pura in forum RS3 Outdated / Broken Scripts
    Replies: 0
    Last Post: 01-12-2008, 10:24 AM
  3. money maker!
    By s1cky in forum RS3 Outdated / Broken Scripts
    Replies: 7
    Last Post: 10-10-2007, 11:54 AM
  4. Looking for sig maker!
    By kooldude in forum Semi Stupid Pictures
    Replies: 7
    Last Post: 08-12-2007, 03:43 PM
  5. Best money maker
    By nhstarter10 in forum RS3 Outdated / Broken Scripts
    Replies: 1
    Last Post: 06-16-2007, 12:13 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
  •