Results 1 to 8 of 8

Thread: Need help with script

  1. #1
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Need help with script

    I am getting an error with my script when I try to add multiple rocks into it.

    SCAR Code:
    program VWMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/Mining.scar}

    Const
      Whatore = Tin; //Valid are Tin, Iron and Clay
      Loads = 3; //Loads to do before switching
      Usebank = false; //True if you want to bank ores

    Var
    x, y, ores, Gasses, LoadsNumB, PikDTM, TinDTM, BrokeDTM, Walk1DTM, Walk2DTM, Walk3DTM, BankDTM:integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers  :=3;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:=0;

      Players[0].Name :='';//username
      Players[0].Pass :='';//password
      Players[0].Nick :='';//2-4 letters of username
      Players[0].Active := True;//Want to use player?

      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := True;

      Players[2].Name := 'UserName';
      Players[2].Pass := 'Password';
      Players[2].Nick := '3-4 letters of UserName';
      Players[2].Active := False;
    end;

    procedure LoadDTMs;
    begin
      PikDTM := DTMFromString('78DA63B465626078CA800274E558C1342394C' +
           'F680954F389010D30A2AA0900AA7948408D1350CD35026A4C806A' +
           '6E1350E305547387801A57C2760100B5120859');
      BrokeDTM := DTMFromString('78DA63CC60626078C280020C95D8C0342394C' +
           'F580A54738F010D30A2AA2906AAB94B404D2150CD6D026AAA816A' +
           'EE1350930454738B08359F08A84901AA794F8439AF09A8C906AAB' +
           '9815F0D0087120D93');
      TinDTM := DTMFromString('78DA63CC65626078C280026A4B4BC0342394C' +
           'F5804547383010D30A2AAA900AA794D404D3550CD7D026AD2816A' +
           '3E1150130B54F382809A44A09A7B04D46402D55CC7AF0600177C0' +
           'C03');
      Walk1DTM := DTMFromString('78DA634C61626050634001F1B9DE0CFF81342' +
           '310FF0702C64AA09A40881C33544D6F82130317540D08301601D5' +
           'F813A1269E809A6CA09A6CFC6A00621D0ED3');
      Walk2DTM := DTMFromString('78DA630C636260D065400131B9DE0CFF81342' +
           '310FF0702C60EA09A1C881C33544D6F82130317540D0830F601D5' +
           '9410A1A682801A905D2D04D4B401D5141350B30AA8C619554DA2A' +
           '5188A1A00B5D21386');
      Walk3DTM := DTMFromString('78DA63CC61626090614001A1B9DE0CFF81342' +
           '310FF0702C6C54035B6103966A89A444B31062EA81A10605C0254' +
           '634D408D2F504D34AA9A848C1C54355E40359E04D45803D584125' +
           '0E34A580D005ACF114F');
      BankDTM := DTMFromString('78DA63CC646260B06640016FDEBC61F80FA41' +
           '981F83F10302602D5B843E498A16AFEFC6162E082AA0101B01A6B' +
           '54355FBF3260AA3126A0261EA84687805D20356AA86ACE9C41332' +
           '70EA84616BF39000ED7178B');
    end;

    Procedure Loadores;
    begin
      case Whatore of
        'Tin' : begin
                  orecolor1 := 8882066;
                end;
        'Iron' : begin
                   orecolor1 := 2766939;
                 end;
        'Clay' : begin
                   orecolor1 := 6005188;
                 end;
      end;
    end;

    Procedure randoms;
    begin
      if(not(LoggedIn))then Exit;
        FindTalk;
        FindNormalRandoms;
        SolveChatRandom;
        FindLamp('Mining');
        If(FindFight)Then
        begin
          MakeCompass('N');
          RunTo('N', True);
          Wait(7000 +Random(3000));
          RunTo('S', True);
        end;
      end;

    procedure AntiBanz;
    begin
      if(not(LoggedIn))then Exit;
      case Random(4) of

        0: begin
             HoverSkill('Mining', false);
             wait(2000+random(1000));
             GameTab(4);
           end;

        1: PickUpMouse;

        2: begin
             case random(3) of
               0: TypeSend('Mining lvls?');

               1: TypeSend('Smithing levels');

               2: TypeSend('Im bored..');

               3: TypeSend('blah, blah, blah');
             end;
           end;

        3: begin
             HoverSkill('Smithing', false);
             wait(2000+random(1000));
             GameTab(4);
           end;

         end;
       end;


    procedure Scripty;
    begin
      MouseSpeed := 16;
      MakeCompass('N');
    end;

    procedure Findpik;
    begin
      if not LoggedIn then Exit;
        Gametab(4);
        Wait(1000);
        if not FindDTM(PikDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
          wait(200);
          Logout;
          Nextplayer(false);
          Writeln('No pick axe noob, get one.');
        end;
      end;

    procedure Brokenpik;
    begin
      GameTab(4);
      wait(300);
      if FindDTM(BrokeDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Logout;
        Nextplayer(false);
        WriteLn('Broken pickaxe, logging out');
      end;
    end;

    Procedure Mineore;
    var
      Minetime: integer;
    begin
      if not LoggedIn then
        Exit;
        MarkTime(MineTime);
        repeat
          if FindObjCustom(x, y, ['Min', 'ine'], orecolor1, 7) then
          begin
            Findgas(MSCX, MSCY);
            Randoms;
            mouse(x, y, 0, 0, false);
            Wait(500);
            ChooseOption('ine');
            Wait(4000);
            randoms;
          end;
        until (InvFull) or (TimeFromMark(Minetime) > 600000+random(60000));;
      end;

    procedure Dropore;
    begin
      if Usebank = (false) then
      begin
        if InvFull then
        repeat
          if not LoggedIn then Exit;
            Gametab(4);
            wait(300);
            if FindDTM(TinDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
            begin
              Wait(225 + random(25));
              Mouse(x, y, 2, 2, false);
              wait(150 + random(25));
              Chooseoption('rop');
              Wait(300);
              Randoms;
            end;
          until not (FindDTM(TinDTM, x, y, MIX1, MIY1, MIX2, MIY2)) or not(loggedin);
        end;
      end;


    procedure Proggy;
    begin
      ClearDebug;
      WriteLn(' _____ _              _                 ');
      WriteLn('/__   (_)_ __   /\/\ (_)_ __   ___ _ __ ');
      WriteLn('  / /\/ |  _ \ /    \| |  _ \ / _ \  __|');
      WriteLn(' / /  | | | | / /\/\ \ | | | |  __/ |   ');
      WriteLn(' \/   |_|_| |_\/    \/_|_| |_|\___|_|   ');
      WriteLn('TinMiner ran for ' + TimeRunning + '.');
      WriteLn('Mined ' + inttostr(Ores)+' tin ores.');
      WriteLn('Found ' + inttostr(Gasses)+' Gases.');
    end;

    procedure Tobank;
    begin
      if Usebank = (True) then
      begin
        if  DTMRotated(Walk1DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
        begin
          Mouse(x, y, 1, 1, True);
          Flag;
        end;
          begin
            if  DTMRotated(Walk2DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
            begin
              Mouse(x, y, 1, 1, True);
              Flag;
            end;
            begin
              if  DTMRotated(Walk3DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
              begin
                Mouse(x, y, 1, 1, True);
                Flag;
              end;
              begin
                RadialRoadWalk(FindRoadColor, 330, 358, 76, 0, 0);
                Flag;
                RadialRoadWalk(FindRoadColor, 50, 88, 55, 0, 0);
                Flag;
              end;
              begin
                if  DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
                begin
                  Mouse(x, y, 1, 1, True);
                  Flag;
                end;
              end;
            end;
          end;
        end;
        FreeDTM(Walk1DTM);
        FreeDTM(Walk2DTM);
        FreeDTM(Walk3DTM);
        FreeDTM(BankDTM);
      end;

    begin
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      Scripty;
      LoadDTMs;
      LoadOres;
      Findpik;
      Repeat
        Brokenpik;
        Mineore;
        Dropore;
        Ores:= Ores + 27;
        LoadsNumB:= LoadsNumB + 1;
        begin
          if(LoadsNumB=Loads)then
          begin
            NextPlayer(True);
            LoadsNumB:=0;
            MakeCompass('N');
            Writeln('Switched players successfully! :)');
          end;
          Proggy;
        end;
      until(false);
    end.

    The error is:

    SCAR Code:
    Line 6: [Error] (12899:11): Unknown identifier '' in script C:\Program Files\SCAR 3.14\Scripts\Vwmine4.scar

    Any help is appreciated.
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Tin needs to be a string. 'Tin'. That problem solved


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  3. #3
    Join Date
    Mar 2008
    Location
    England
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In your script in:

    procedure DeclarePlayers;
    begin
    HowManyPlayers :=3;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer:=0;

    You need to put "2" instead of three.
    Either that or it's somthing that your havn't added in your variables.

    Sorry if i didn't help

    ~ShadowMinion

  4. #4
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by ShadowMinion View Post
    In your script in:

    procedure DeclarePlayers;
    begin
    HowManyPlayers :=3;
    NumberOfPlayers(HowManyPlayers);
    CurrentPlayer:=0;

    You need to put "2" instead of three.
    Either that or it's somthing that your havn't added in your variables.

    Sorry if i didn't help

    ~ShadowMinion
    The numbers in SCAR start at 0. His HowManyPlayers is already correct


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

  5. #5
    Join Date
    Mar 2008
    Location
    England
    Posts
    21
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    Tin needs to be a string. 'Tin'. That problem solved
    Forget about what I said, sorry

  6. #6
    Join Date
    Apr 2007
    Posts
    277
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I have one more error, it is on the line I mark // this line


    SCAR Code:
    program VWMiner;
    {.include SRL/SRL.scar}
    {.include SRL/SRL/Skill/Mining.scar}

    Const
      Whatore = 'Tin'; //Valid are Tin, Iron and Clay
      Loads = 3; //Loads to do before switching
      Usebank = false; //True if you want to bank ores

    Var
    x, y, ores, Orecolor1, Gasses, LoadsNumB, PikDTM, TinDTM, BrokeDTM, Walk1DTM, Walk2DTM, Walk3DTM, BankDTM:integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers  :=3;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:=0;

      Players[0].Name :='';//username
      Players[0].Pass :='';//password
      Players[0].Nick :='';//2-4 letters of username
      Players[0].Active := True;//Want to use player?

      Players[1].Name := '';
      Players[1].Pass := '';
      Players[1].Nick := '';
      Players[1].Active := True;

      Players[2].Name := 'UserName';
      Players[2].Pass := 'Password';
      Players[2].Nick := '3-4 letters of UserName';
      Players[2].Active := False;
    end;

    procedure LoadDTMs;
    begin
      PikDTM := DTMFromString('78DA63B465626078CA800274E558C1342394C' +
           'F680954F389010D30A2AA0900AA7948408D1350CD35026A4C806A' +
           '6E1350E305547387801A57C2760100B5120859');
      BrokeDTM := DTMFromString('78DA63CC60626078C280020C95D8C0342394C' +
           'F580A54738F010D30A2AA2906AAB94B404D2150CD6D026AAA816A' +
           'EE1350930454738B08359F08A84901AA794F8439AF09A8C906AAB' +
           '9815F0D0087120D93');
      TinDTM := DTMFromString('78DA63CC65626078C280026A4B4BC0342394C' +
           'F5804547383010D30A2AAA900AA794D404D3550CD7D026AD2816A' +
           '3E1150130B54F382809A44A09A7B04D46402D55CC7AF0600177C0' +
           'C03');
      Walk1DTM := DTMFromString('78DA634C61626050634001F1B9DE0CFF81342' +
           '310FF0702C64AA09A40881C33544D6F82130317540D08301601D5' +
           'F813A1269E809A6CA09A6CFC6A00621D0ED3');
      Walk2DTM := DTMFromString('78DA630C636260D065400131B9DE0CFF81342' +
           '310FF0702C60EA09A1C881C33544D6F82130317540D0830F601D5' +
           '9410A1A682801A905D2D04D4B401D5141350B30AA8C619554DA2A' +
           '5188A1A00B5D21386');
      Walk3DTM := DTMFromString('78DA63CC61626090614001A1B9DE0CFF81342' +
           '310FF0702C6C54035B6103966A89A444B31062EA81A10605C0254' +
           '634D408D2F504D34AA9A848C1C54355E40359E04D45803D584125' +
           '0E34A580D005ACF114F');
      BankDTM := DTMFromString('78DA63CC646260B06640016FDEBC61F80FA41' +
           '981F83F10302602D5B843E498A16AFEFC6162E082AA0101B01A6B' +
           '54355FBF3260AA3126A0261EA84687805D20356AA86ACE9C41332' +
           '70EA84616BF39000ED7178B');
    end;

    Procedure Loadores;
    begin
      case Whatore of
        'Tin' : begin
                  orecolor1 := 8882066;
                end;
        'Iron' : begin
                   orecolor1 := 2766939;
                 end;
        'Clay' : begin
                   orecolor1 := 6005188;
                 end;
      end;
    end;

    Procedure randoms;
    begin
      if(not(LoggedIn))then Exit;
        FindTalk;
        FindNormalRandoms;
        SolveChatRandom;
        FindLamp('Mining');
        If(FindFight)Then
        begin
          MakeCompass('N');
          RunTo('N', True);
          Wait(7000 +Random(3000));
          RunTo('S', True);
        end;
      end;

    procedure AntiBanz;
    begin
      if(not(LoggedIn))then Exit;
      case Random(4) of

        0: begin
             HoverSkill('Mining', false);
             wait(2000+random(1000));
             GameTab(4);
           end;

        1: PickUpMouse;

        2: begin
             case random(3) of
               0: TypeSend('Mining lvls?');

               1: TypeSend('Smithing levels');

               2: TypeSend('Im bored..');

               3: TypeSend('blah, blah, blah');
             end;
           end;

        3: begin
             HoverSkill('Smithing', false);
             wait(2000+random(1000));
             GameTab(4);
           end;

         end;
       end;


    procedure Scripty;
    begin
      MouseSpeed := 16;
      MakeCompass('N');
    end;

    procedure Findpik;
    begin
      if not LoggedIn then Exit;
        Gametab(4);
        Wait(1000);
        if not FindDTM(PikDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
          wait(200);
          Logout;
          Nextplayer(false);
          Writeln('No pick axe noob, get one.');
        end;
      end;

    procedure Brokenpik;
    begin
      GameTab(4);
      wait(300);
      if FindDTM(BrokeDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Logout;
        Nextplayer(false);
        WriteLn('Broken pickaxe, logging out');
      end;
    end;

    Procedure Mineore;
    var
      Minetime: integer;
    begin
      if not LoggedIn then
        Exit;
        MarkTime(MineTime);
        Loadores;
        repeat
          if FindObjCustom(x, y, ['Min', 'ine'], orecolor1, 7) then // This line
          begin
            Findgas(MSCX, MSCY);
            Randoms;
            mouse(x, y, 0, 0, false);
            Wait(500);
            ChooseOption('ine');
            Wait(4000);
            randoms;
          end;
        until (InvFull) or (TimeFromMark(Minetime) > 600000+random(60000));;
      end;

    procedure Dropore;
    begin
      if Usebank = (false) then
      begin
        if InvFull then
        repeat
          if not LoggedIn then Exit;
            Gametab(4);
            wait(300);
            if FindDTM(TinDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
            begin
              Wait(225 + random(25));
              Mouse(x, y, 2, 2, false);
              wait(150 + random(25));
              Chooseoption('rop');
              Wait(300);
              Randoms;
            end;
          until not (FindDTM(TinDTM, x, y, MIX1, MIY1, MIX2, MIY2)) or not(loggedin);
        end;
      end;


    procedure Proggy;
    begin
      ClearDebug;
      WriteLn(' _____ _              _                 ');
      WriteLn('/__   (_)_ __   /\/\ (_)_ __   ___ _ __ ');
      WriteLn('  / /\/ |  _ \ /    \| |  _ \ / _ \  __|');
      WriteLn(' / /  | | | | / /\/\ \ | | | |  __/ |   ');
      WriteLn(' \/   |_|_| |_\/    \/_|_| |_|\___|_|   ');
      WriteLn('TinMiner ran for ' + TimeRunning + '.');
      WriteLn('Mined ' + inttostr(Ores)+' tin ores.');
      WriteLn('Found ' + inttostr(Gasses)+' Gases.');
    end;

    procedure Tobank;
    begin
      if Usebank = (True) then
      begin
        if  DTMRotated(Walk1DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
        begin
          Mouse(x, y, 1, 1, True);
          Flag;
        end;
          begin
            if  DTMRotated(Walk2DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
            begin
              Mouse(x, y, 1, 1, True);
              Flag;
            end;
            begin
              if  DTMRotated(Walk3DTM, x, y, MMX1, MMY1, MMX2, MMY2) then
              begin
                Mouse(x, y, 1, 1, True);
                Flag;
              end;
              begin
                RadialRoadWalk(FindRoadColor, 330, 358, 76, 0, 0);
                Flag;
                RadialRoadWalk(FindRoadColor, 50, 88, 55, 0, 0);
                Flag;
              end;
              begin
                if  DTMRotated(BankDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
                begin
                  Mouse(x, y, 1, 1, True);
                  Flag;
                end;
              end;
            end;
          end;
        end;
        FreeDTM(Walk1DTM);
        FreeDTM(Walk2DTM);
        FreeDTM(Walk3DTM);
        FreeDTM(BankDTM);
      end;

    begin
      SetupSRL;
      DeclarePlayers;
      LoginPlayer;
      Scripty;
      LoadDTMs;
      Findpik;
      Repeat
        Brokenpik;
        Mineore;
        Dropore;
        Ores:= Ores + 27;
        LoadsNumB:= LoadsNumB + 1;
        begin
          if(LoadsNumB=Loads)then
          begin
            NextPlayer(True);
            LoadsNumB:=0;
            MakeCompass('N');
            Writeln('Switched players successfully! :)');
          end;
          Proggy;
        end;
      until(false);
    end.

    The error is :

    SCAR Code:
    Line 172: [Error] (13065:54): Type mismatch in script C:\Program Files\SCAR 3.14\Scripts\vwmine5.scar

    Once again, any help is appreciated.
    Current Script: Al-Kharid Fighter and Banker
    Status : Just Started

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

    Default

    you just need to put orecolor1 into square brackets ( so it's "[orecolor1]").
    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.

  8. #8
    Join Date
    Feb 2007
    Location
    South East England
    Posts
    2,906
    Mentioned
    2 Post(s)
    Quoted
    8 Post(s)

    Default

    And its not really necissary but you can just put
    SCAR Code:
    ['Mi','ne']
    Jus' Lurkin'

Thread Information

Users Browsing this Thread

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

Posting Permissions

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