Results 1 to 12 of 12

Thread: need help fixing this script

  1. #1
    Join Date
    Sep 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default need help fixing this script

    All problems solved! Thanks.
    Below is the final (I guess) finished script! Hope it helps people that find it!

    Thank you Shuttleu for fixing the last problem for me
    If you want to use this to smelt mithril ore into bars (using mage) then...
    1st: Have coins in 1st bank spot, then Mithril ore in 2nd and last have coal in 3rd spot.
    2nd: Start in fally east bank with bank screen up!
    3rd: Have nature runes in last inv. spot!
    4th: Weild a fire staff!

    5th: Have fun! =)


    SCAR Code:
    program SuperHeat;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/magic.scar}
    {
    |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
    |                This Script Superheat Mithril Ores!                       |
    |==========================================================================|
               Created for scar 3.15+ and you must have the latest SRL
     
     1. Use Runescape with Low Detail, Very Bright.
     2. Set up in falador West Bank with...
     3. Fire staff equiped.
     4. Nature runes in your last inventory space.
     5. Set up so u have withdraw-22 as an option in your bank.
        (Just click withdraw-X then type 22... then restore that item.)
     6. Have your coins in the 1st bank space, mithril ore in 2nd and coal in 3rd.
     7. Prefered that you stand next to a bank booth with the bank screen up.
     8. Have fun =)
    ==========================================================================
    }

    var
      l, loads, x, y, nat: integer;
     
    const
      StartPlayer = 0;             // Determines who will play first
      MSpeed = 1000;               //speed of the mouse (lower=lower higher=higher)
      // MySRLID       = '';       // Must be a string!
      // MySRLPassword = '';       // Must be a string!
      VersionNumber = 1;           // No need to change
     
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;               // Set Number of Players here.
      NumberOfPlayers(HowManyPlayers);   // Sets the Players Array Length;
      CurrentPlayer := StartPlayer;      // CurrentPlayer = Array Index
     
      Players[0].Name := 'user';            //username
      Players[0].Pass := 'pass';            //password
      Players[0].Nick := 'Nick';            //3-4 consecutive letters of your user name(NOT First letter)
      Players[0].Strings[0] := 'mithril';   //type of bar bronze,iron,steel,mith,adamantite,runite,gold,silver,
      Players[0].integers[0] := 5;          //how many times to cast superheat
      Players[0].Active := True;            //are you going to use this player
    end;

    function FindOre(oreType: string; var rx, ry: integer; x1, y1, x2, y2: integer):
      boolean;
    var
      ore, oreColor: integer;
      oreMP: TDTMPointDef;
      oreSP: array of TDTMPointDef;
      oreSkel: TDTM;
    begin
      case lowercase(oreType) of
        'coal': oreColor := 2570553;
        'mithril': oreColor := 7425357;
      else
        begin
          writeln('ore type not found');
          exit;
        end;
      end;
      setarraylength(oreSP, 4);
     
      oreMP.x := 580;
      oreMP.y := 229;
      oreMP.areasize := 1;
      oreMP.areashape := 0;
      oreMP.color := oreColor;
      oreMP.tolerance := 15;
     
      oreSP[0].x := 576;
      oreSP[0].y := 227;
      oreSP[0].areasize := 0;
      oreSP[0].areashape := 0;
      oreSP[0].color := 65536;
      oreSP[0].tolerance := 0;
     
      oreSP[1].x := 574;
      oreSP[1].y := 229;
      oreSP[1].areasize := 0;
      oreSP[1].areashape := 0;
      oreSP[1].color := 65536;
      oreSP[1].tolerance := 0;
     
      oreSP[2].x := 563;
      oreSP[2].y := 230;
      oreSP[2].areasize := 0;
      oreSP[2].areashape := 0;
      oreSP[2].color := 65536;
      oreSP[2].tolerance := 0;
     
      oreSP[3].x := 592;
      oreSP[3].y := 227;
      oreSP[3].areasize := 0;
      oreSP[3].areashape := 0;
      oreSP[3].color := 65536;
      oreSP[3].tolerance := 0;
     
      oreSkel.MainPoint := oreMP;
      oreSkel.SubPoints := oreSP;
      ore := AddDTM(oreSkel);
     
      result := findDTM(ore, rx, ry, x1, y1, x2, y2);
      freeDTM(ore);
    end;
     
    procedure WithdrawOres;
    begin;
      l := 0
        if (not (Loggedin)) then exit;
      if (not (bankscreen)) then exit;
      case lowercase(players[currentplayer].Strings[0]) of
        'mithril':
          begin
            if findOre('mithril', x, y, msx1, msy1, msx2, msy2) then
            else
            begin
              writeln('Can not find mithril');
              terminatescript;
            end;
            begin
            Withdraw(2,1,5);
              wait(100 + random(100));
            end;
            wait(500 + random(500));
            if findOre('coal', x, y, msx1, msy1, msx2, msy2) then
            else
            begin
              writeln('Can not find coal');
              terminatescript;
            end;
            begin
            Withdraw(3,1,22);
              wait(100 + random(100));
              CloseBank;
              begin
              end;
            end;
          end;
       end;
    end;

    procedure CastSuperheat1;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('ith') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end else Writeln('uptext not right');
      end else
      begin
        writeln('Can not find ore');
        exit;
      end;
    end;

    procedure CastSuperheat2;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('ith') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end else Writeln('uptext not right');
      end else
      begin
        writeln('Can not find ore');
        exit;
      end;
    end;
     
    procedure CastSuperheat3;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('ith') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end else Writeln('uptext not right');
      end else
      begin
        writeln('Can not find ore');
        exit;
      end;
    end;
     
    procedure CastSuperheat4;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('ith') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end else Writeln('uptext not right');
      end else
      begin
        writeln('Can not find ore');
        exit;
      end;
    end;
     
    procedure CastSuperheat5;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('ith') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end else Writeln('uptext not right');
      end else
      begin
        writeln('Can not find ore');
        exit;
      end;
    end;

    procedure Bank;
    var
      Bar, time: Integer;
    begin
      Bar := DTMFromString('78DA63946660601062400113DBDB19B880342' +
        '310FF0702460520839B010D302291401A648E0C01353C40429880' +
        '1A652021825F0D00B24D0699');
     
      MarkTime(time);
      repeat
        if (not (Loggedin)) then break;
        OpenBankQuiet('feb')
      until (BankScreen or (TimeFromMark(time) > 120000));
      if Bankscreen then
         else terminatescript;
      begin
        IsUpText('Mithril')
        Deposit(1, 10, True);
        loads := + 1
      end;
      FreeDTM(Bar);
    end;
     
    procedure ProgressReport;
    begin
      ClearDebug;
      Writeln('<|~-+[]<------The Super Superheater!------>[]+-~|>');
      Writeln('     / \  ( ) /0 0\  =      _____');
      Writeln('    < + > /\ \ \__/  =     /___ /|');
      Writeln('     \ / /\ \ \ \ \  =     [Mith|/');
      Writeln('        /  \ V \ \/  =');
      Writeln(' Auto mithril Superheater version 1 by: wtfwtfwtf');
      Writeln(' Worked for ' + TimeRunning);
      Writeln(' Banked ' + inttostr(Loads) + ' times');
      Writeln('<|~-+[]<----For Smelting Mithril Bars!---->[]+-~|>');
      Writeln('Thanks to Shuttleu for helpping solve the last prob.');
    end;
     
    procedure Setup;
    begin;
      SetupSRL;
      ActivateClient;
      Mousespeed := Mspeed;
      DeclarePlayers;
      LoginPlayer;
      MakeCompass('n');
      SetAngle(true);
      OpenBankQuiet('feb');
    end;
     
    begin
      setup;
      repeat
        OpenBankQuiet('feb');
        WithdrawOres;
        CastSuperheat1;
        CastSuperheat2;
        CastSuperheat3;
        CastSuperheat4;
        CastSuperheat5;
        FindNormalRandoms;
        Bank;
        ProgressReport;
      until (Loads = Players[currentplayer].integers[0]);
      if (LoggedIn) then
      LogOut;
      if (Players[CurrentPlayer].Active = false) then
        terminatescript;
    end.

  2. #2
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    1) we are on scar3.15
    2) we are on srl 25 /26
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  3. #3
    Join Date
    Sep 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by djcheater View Post
    1) we are on scar3.15
    2) we are on srl 25 /26
    I put that in the script now, I didn't know for sure what versions it was. Please someone test it out and fix it, it shouldn't take long, it just needs to click sometimes, sometimes it doesn't click, and it goes to the banking procedure, but it cannot find the bank because it has option
    [use Superheat item-] and it cannot click the bank that way.
    Thank you!!! =)

  4. #4
    Join Date
    Sep 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think the problem is in between here...

    SCAR Code:
    procedure CastSuperheat1;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2)
        then
      else
      begin
        writeln('Can not find ore');
        exit;
      end;
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('Mithril ore') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end;
      end;
    end;
     
    procedure CastSuperheat2;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2)
        then
      else
      begin
        writeln('Can not find ore');
        exit;
      end;
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('Mithril ore') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end;
      end;
    end;
     
     
    procedure CastSuperheat3;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2)
        then
      else
      begin
        writeln('Can not find ore');
        exit;
      end;
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('Mithril ore') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end;
      end;
    end;
     
     procedure CastSuperheat4;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2)
        then
      else
      begin
        writeln('Can not find ore');
        exit;
      end;
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('Mithril ore') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end;
      end;
    end;
     
    procedure CastSuperheat5;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2)
        then
      else
      begin
        writeln('Can not find ore');
        exit;
      end;
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('Mithril ore') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end;
      end;
    end;
     
    procedure Bank;
    var
      Bar, time: Integer;
    begin
      Bar := DTMFromString('78DA63946660601062400113DBDB19B880342' +
        '310FF0702460520839B010D302291401A648E0C01353C40429880' +
        '1A652021825F0D00B24D0699');
     
      MarkTime(time);
      repeat
        if (not (Loggedin)) then break;
        OpenBankQuiet('feb')
      until (BankScreen or (TimeFromMark(time) > 120000));
      if Bankscreen then
         else terminatescript;
      begin
        IsUpText('Mithril')
        Deposit(1, 27, True);
      end;
      FreeDTM(Bar);
    end;

    Or is there a way that after the 5th smelt that it can click on something?
    It wont bank sometimes because it forgets to click on the mith ore sometimes... not always. Someone please respond

  5. #5
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    i would recomend using something like
    SCAR Code:
    IsUpText('ith')
    instead of
    SCAR Code:
    IsUpText('Mithril ore')
    or
    SCAR Code:
    IsUpText('Mithril')
    might help it

    ~shut

    EDIT:you could also put a little bit of debugging in there
    SCAR Code:
    procedure CastSuperheat1;
    begin
      if (not (Loggedin)) then exit;
      Cast('Superheat Item');
      Wait(700 + random(150));
      if findOre(players[currentplayer].Strings[0], x, y, MIX1, MIY1, MIX2, MiY2) then
      begin
        MMouse(x, y, 2, 2);
        wait(50 + random(150));
        if IsUpText('ith') then
        begin
          Mouse(x, y, 5, 5, True);
          Wait(450 + random(150));
        end else Writeln('uptext not right');
      end else
      begin
        writeln('Can not find ore');
        exit;
      end;
    end;
    EDIT2: why is there CastSuperheat1, CastSuperheat2, CastSuperheat3 etc. when they are all the same?

  6. #6
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    He was probably thinking fail safes?
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  7. #7
    Join Date
    Sep 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks, im not sure if this has helped yet, cuz its a long term issue when using it. I couldn't get it to loop on the superheat so I just made 5 of them cuz that was the only way I could loop it and get it to work. Anyways, looks good thank you. The 1st post is now the final copy if anyone wants it =P... I suggest you watch over it once in a while until the new anti-randoms come out.

  8. #8
    Join Date
    Sep 2008
    Location
    Tasmania; Australia
    Posts
    22
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    soz.. i got no idea.. i kant even write the beggining of a script.. =)

  9. #9
    Join Date
    Jul 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What would I need to change this to another type of bar? like.. Adamantite?

  10. #10
    Join Date
    Jul 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    What would I have to change for this to work with..say.. Adamantite or rune?

  11. #11
    Join Date
    Jan 2007
    Location
    Nomming bits in your RAM
    Posts
    385
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Darando View Post
    What would I have to change for this to work with..say.. Adamantite or rune?
    Add:
    'Desired_Ore': oreColor := Ore_Color;

    After
    case lowercase(oreType) of

    and Before
    'mithril': oreColor := 7425357;
    else
    Current Project: Catching up. XD. Potentially back for the summer, depending on how things go.

  12. #12
    Join Date
    Jul 2008
    Posts
    18
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Macro_FTW View Post
    Add:
    'Desired_Ore': oreColor := Ore_Color;

    After
    case lowercase(oreType) of

    and Before
    'mithril': oreColor := 7425357;
    else
    It half spams me with;
    'ore type not found
    Can not find ore'

    Here's what I put in.

    case lowercase(oreType) of
    'iron': oreColor := 2503249;
    'coal': oreColor := 2570553;
    'mithril': oreColor := 7425357;

    I also changed the WithdrawOres proc to iron

    Changed a few bits, now it just sits there doing nothing.
    At least it Isn't telling me it cant find the ores..right?

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. help fixing a script
    By Raskolnikov in forum OSR Help
    Replies: 1
    Last Post: 01-15-2008, 12:16 AM
  2. Script Fixing Help? Fix my Auto Miner?
    By MacroHawk in forum OSR Help
    Replies: 8
    Last Post: 07-06-2007, 06:46 PM
  3. [Copper Mashed] Need Script Fixing Help!
    By MacroHawk in forum OSR Help
    Replies: 5
    Last Post: 05-17-2007, 05:38 AM
  4. Help Fixing Things with my first script
    By japman in forum OSR Help
    Replies: 12
    Last Post: 01-04-2007, 05:39 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
  •