Results 1 to 5 of 5

Thread: Type Mismatch Error, Help!

  1. #1
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Type Mismatch Error, Help!

    I cant find the source of the error so, somone plz try to do it .

    SCAR Code:
    Line 266: [Error] (16472:57): Type mismatch in script C:\Program Files\SCAR 3.15\Scripts\AnchoPizza_Reborn.scar

    SCAR Code:
    program AnchoPizza_Reborn;
    {.Include SRL/SRL.Scar}
    {------------------------------------------------------------------------------}
    {DO NOT COPY OR USE ANYTHING FROM THIS SCRIPT WITHOUT MY PERMISSION, SEND ME
    A PRIVATE MESSAGE ON SRL-FORUMS TO: U L T R A, IF YOU WANT TO USE SOMETHING
    FROM THIS SCRIPT. IF I FIND OUT THAT YOU DO USE/COPY SOMETHING WITHOUT MY
    PERMISSION, I WILL REPORT TO A MOD/ADMIN IMMIDIANTLY.
    {------------------------------------------------------------------------------}

    {The idia of this script has been introduced by me(U L T R A), however the
    first-ever versions of this script have been made by Cnr Sport, Shuttleu and
    me. THIS PERTICULAR SCRIPT HAS BEEN MADE BY ME (U L T R A).}

    {------------------------------------------------------------------------------}
    {THIS SCRIPT WILL MAKE ANCHOVY PIZZAS IN VARROCK EAST BANK!}
    {------------------------------------------------------------------------------}
    {---Instructions on buying and selling---
    Buy Anchovies For Max Price.
    Buy Plain Pizzas For Med Price + 1 GP.
    Sell Anchovy Pizzas For Med-Highest Price.}

    {------------------------------------------------------------------------------}
    {---Instructions on using script---
    Have ingredients in the following order: Anchovies, Plain Pizza's.
    Have players in the varrock east bank, near the bank booths.
    Setup const & declare players.
    Run and enjoy.
    POST BUGS/IDIAS/REPORTS ON THE THREAD!!!
    {------------------------------------------------------------------------------}

    {-----------------------DO  NOT  TOUCH HERE------------------------------------}
    const
    Version = '1.5';//Version of the script, DO NOT TOUCH!
    {-----------------------DO  NOT  TOUCH HERE------------------------------------}
    {------------------------------------------------------------------------------}
    {//////////////////////////////////////////////////////////////////////////////}
    { SET UP HERE /////////////////////////////////////////////////////////////////}
    {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}

    CheckLost = True;//Check if the player is in the bank?
                     //NOT RECOMMENDED ON A POPULATED WORLD!!!
                     
    HaveSleep = True;//Log out every 7-9 mins, wait a little, and log back in?
                     //Recommended, helps reduce randoms.

    procedure DeclarePlayers;
    begin

      HowManyPlayers := 1;//How many players are going to auto in total?
      NumberOfPlayers(HowManyPlayers);//No Touching.
      CurrentPlayer := 0;//Which player will auto first?

      Players[0].Name :='';//Username.
      Players[0].Pass :='';//Password.
      Players[0].Nick :='';//Nickname. If you dont know what this is, press Alt+F4.
      Players[0].Active := True;//Is this player going to auto?

    end;
    {//////////////////////////////////////////////////////////////////////////////}
    { END OF SETUP, NO TOUCHING BELOW THESE LINES. ////////////////////////////////}
    {\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\}

    {------------------------------------------------------------------------------}
    var
    Anchovies, PlainPizza : Integer;//DTMs.
    X, Y : Integer;//X, Y Co-ordinates.
    AmountMade, ExpEarned, SleepMark, RandomSleepTime, Slept : Integer;//Integer Vars.
    Sleeping : Boolean;//Boolean Vars.
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure AntiBan;
    begin
     case Random(100) of

     0..8: RandomRClick;
     9..11: PickUpMouse;
     12..14: BoredHuman;
     15..18: GameTab(1+Random(13));
     19..25: MMouse(Random(300), Random(300), Random(10), Random(10));

    end;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function PlayerIsLost : Boolean;
    begin
     if CheckLost then
     begin
      if not FindSymbol(X, Y, 'bank') and not FindColorTolerance(X, Y, 1535151, MSX1, MSY1, MSX2, MSY2, 4) and not FindColorTolerance(X, Y, 3811119, MSX1, MSY1, MSX2, MSY2, 3) then
       begin
        Result:=True;
       end else
      Result:=False;
      end;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure DeclareDTMs;
    begin
      Anchovies := DTMFromString('78DA63E4616460C86540019EBE590CFF81345' +
           '086E13F1030720059590C6880118904D2FC40560501354C4498A3' +
           '0064651250230164151250230264951350C30A64151050C34BD8C' +
           'D00F65F0A86');

      PlainPizza := DTMFromString('78DA63B4656460C86240013BB74B30FC07D24' +
           '01986FF40C008525386AAA6AB2E0E4C3342F98C1E405611031A60' +
           '4455E30264951350630464151350A30F64651350E30364E510506' +
           '30E64951250E30964A5E35703004ADE0E2E');
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function OpenTheBank : Boolean;
    var M : Integer;
    begin
      if not (BankScreen) then
      begin
        MarkTime(M);
        repeat
          Wait(300+random(200));
          FindNormalRandoms;
          if OpenBank('veb', False, False) then
            Result:=True;
        until(TimeFromMark(M)>30000)or(Result=True);
        if(TimeFromMark(M)>30000)then
          LogOut;
        Wait(1000+random(500));
      end else
      Result:=True;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function IngredientsExist(Where:String{'bank', 'inv'}) : Boolean;
    begin

     case Where of

     'bank':
     begin
     Result := FindDTM(Anchovies, x, y, MSX1, MSY1, MSX2, MSY2) and
               FindDTM(PlainPizza, x, y, MSX1, MSY1, MSX2, MSY2);
     end;

     'inv':
     begin
     Result := FindDTM(Anchovies, x, y, MSX1, MSY1, MSX2, MSY2) or
               FindDTM(PlainPizza, x, y, MSX1, MSY1, MSX2, MSY2);
     end;

     end;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function InViewEnterAmount : Boolean;
    begin
     Result := FindColorTolerance(X, Y, 8388608, 258, 428, 259, 429, 2);
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure WithrawIngredients;
    begin
      if not (LoggedIn) then Exit;
      if OpenTheBank and not InvFull then
      begin
        if not IngredientsExist('bank') then
        begin
          CloseBank;
          LogOut;
        end else
        begin
       //Withraw Anchovies.
       if FindDTM(Anchovies, x, y, MSX1, MSY1, MSX2, MSY2) then
       Mouse(X, Y, 3, 3, False);
       Wait(200+Random(100));
       ChooseOption('X');
       while not InViewEnterAmount do Wait(50+random(50));
       TypeSend('14');
       Wait(3000+random(1000));
       //Withraw Plain Pizzas.
       if FindDTM(PlainPizza, x, y, MSX1, MSY1, MSX2, MSY2) then
       Mouse(X, Y, 3, 3, False);
       Wait(200+Random(100));
       ChooseOption('X');
       while not InViewEnterAmount do Wait(50+random(50));
       TypeSend('14');
       Wait(3000+random(1000));
       end;
     end;
     CloseBank;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function InViewCreatePizza : Boolean;
    begin
     Result := FindColorTolerance(X, Y, 1619896, 259, 411, 260, 412, 3);
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure CreateAnchoPizzas;
    var
    M : Integer;
    begin
     MarkTime(M);
     if CountItemsIn('inv', 'dtm', PlainPizza, [0])=CountItemsIn('inv', 'dtm', Anchovies, [0]) then AmountMade := AmountMade+CountItemsIn('inv', 'dtm', PlainPizza, [0]);
     if CountItemsIn('inv', 'dtm', PlainPizza, [0])>CountItemsIn('inv', 'dtm', Anchovies, [0]) then AmountMade := AmountMade+CountItemsIn('inv', 'dtm', Anchovies, [0]);
     if CountItemsIn('inv', 'dtm', PlainPizza, [0])<CountItemsIn('inv', 'dtm', Anchovies, [0]) then AmountMade := AmountMade+CountItemsIn('inv', 'dtm', PlainPizza, [0]);
     if FindDTM(Anchovies, X, Y, MIX1, MIY1, MIX2, MIY2) then
     Mouse(X, Y, 2, 2, False);
     Wait(100+random(50));
     ChooseOption('se');
     Wait(200+random(100));
     if FindDTM(PlainPizza, X, Y, MIX1, MIY1, MIX2, MIY2) then
     Mouse(X, Y, 2, 2, True);
     while not InViewCreatePizza do Wait(100+random(100));
     Mouse(259, 413, 5, 5, False);
     Wait(50+random(150));
     ChooseOption('ll');
     repeat
      if FindNormalRandoms then Exit;
      Wait(300+random(200));
     until(not(FindDTM(Anchovies, X, Y, MIX1, MIY1, MIX2, MIY2)))or(not(FindDTM(PlainPizza, X, Y, MIX1, MIY1, MIX2, MIY2)))or(TimeFromMark(M)>35000);
     AntiBan;
     if PlayerIsLost then LogOut;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure DepositAnchoPizzas;
    begin
     if not (LoggedIn) then Exit;
     if OpenTheBank then
     begin
      ExpEarned := AmountMade*39;
      DepositAll;
     end;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function AllPlayersFalse : Boolean;
    var ActivePlayers, i : Byte;
    begin
      for i := 0 to High(Players) do
      if Players[i].Active then Inc(ActivePlayers);
      if ActivePlayers = 0 then Result := True;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    function ActivePlayersAmount : Integer;
    var ActivePlayers, i : Byte;
    begin
      for i := 0 to High(Players) do
      if Players[i].Active then Inc(ActivePlayers);
      Result:=ActivePlayers;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure DoSleep;
    begin
     if TimeFromMark(SleepMark)>RandomSleepTime and HaveSleep=True then
      begin
      Sleeping := True;
      LogOut;
      Wait(RandomRange(5000, 7000);
      LogInPlayer;
      Sleeping :=False;
      Slept := Slept + 1;
      end;
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure MainLoop;
    begin
     repeat
    WithrawIngredients;
    CreateAnchoPizzas;
    DepositAnchoPizzas;
    DoSleep;
    Report;
     until(not(LoggedIn))and(not(Sleeping));
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    procedure Report;
    var
    PH : Integer;
    begin
     PH := 3600000 div (GetTimeRunning);
     ClearDebug;
     WriteLn('{----------------------------------------------------------}');
     WriteLn('{//////////////////////ANCHO-PIZZA\\\\\\\\\\\\\\\\\\\\\\\\\}');
     WriteLn('{-------------------MADE BY U L T R A----------------------}');
     WriteLn('{Version: ' + Version + '.}');
     WriteLn('{----------------------------------------------------------}');
     WriteLn('{Ran For: ' + TimeRunning + '.}');
     WriteLn('{Total Made: ' + IntToStr(AmountMade) + ' Anchovy Pizza''s.}');
     WriteLn('{Total Earned: ' + IntToStr(ExpEarned) + ' Exp.}');
     if HaveSleep then WriteLn('{Total Sleeps: ' + IntToStr(Slept) + '.}');
     if HaveSleep then Disguise('Time Till Sleep: ' + IntToStr(RandomSleepTime-TimeFromMark(SleepMark)) + '.');
     WriteLn('{Active Players: ' + IntToStr(ActivePlayersAmount) + '.}');
     WriteLn('{----------------------------------------------------------}');
     WriteLn('{P/H Pizza: ' + IntToStr(Round(PH * AmountMade)) + '.}');
     WriteLn('{P/H Exp: ' + IntToStr(Round(PH * AmountMade)*39) + '.}');
     WriteLn('{----------------------------------------------------------}');
     WriteLn('{POST: Bugs/Reports/Idias ON THE THREAD! THANKS FOR USING!!}');
     WriteLn('{----------------------------------------------------------}');
    end;
    {------------------------------------------------------------------------------}

    {------------------------------------------------------------------------------}
    begin
    SetUpSRL;
    DeclarePlayers;
    DeclareDTMs;
    if not loggedin then loginplayer;
    repeat
    MarkTime(SleepMark);
    RandomSleepTime := 7*1000*60+Random(2*1000*60);
    MainLoop;
    if(AllPlayersFalse)then TerminateScript;
    until(AllPLayersFalse);
    if(AllPlayersFalse)then TerminateScript;
    end.
    {------------------------------------------------------------------------------}

    {
    -Version Log-
    ---
    1.0-
    First version of script, yet is not perfected!
    ---
    1.1-
    Added sleeping.
    Fixed some stuff up.
    ---
    1.2-
    Removed sleeping, it wasnt working. Gonna remake it.
    Fixed stuff up.
    ---
    1.3-
    Remade the DTMs.
    ---
    1.4-
    Added a per/hour report.
    ---
    1.5-
    Remade sleeping.
    Fixed stuff up :P.
    ---
    }


    {(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}{(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}
    {(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}{(C) COPYRIGHT U L T R A's & Shuttleu's SCRIPTS}
    Woot woot.

  2. #2
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Post line?


  3. #3
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Replace line 266 with this:
    SCAR Code:
    if (TimeFromMark(SleepMark)>RandomSleepTime) and HaveSleep then
    You didn't need the = True part, and the error was caused by not wrapping the TimeFromMark(SleepMark)>RandomSleepTime with parenthesis.

    Also, line 270 contains a fairly obvious error.

  4. #4
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Owsm, thanks.
    Woot woot.

  5. #5
    Join Date
    Jan 2009
    Location
    Somewhere
    Posts
    240
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ***OffTopic***
    SCAR Code:
    Players[0].Nick :='';//Nickname. If you dont know what this is, press Alt+F4.

    Rofl

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ERROR type mismatch
    By shaman in forum OSR Help
    Replies: 5
    Last Post: 12-17-2008, 01:02 AM
  2. Type Mismatch Error?
    By crossback7 in forum OSR Help
    Replies: 2
    Last Post: 06-23-2007, 05:28 PM
  3. Type mismatch error...
    By Hobbit in forum OSR Help
    Replies: 8
    Last Post: 02-13-2007, 04:45 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
  •