Results 1 to 11 of 11

Thread: error when running a script plz help

  1. #1
    Join Date
    Jan 2008
    Location
    inside you! :O
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    error when running a script plz help

    Code:
    Line 432: [Hint] (10388:1): Variable 'OLDMS' never used in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 67: [Error] (12333:1): Unknown identifier 'NickNameBMP' in script C:\Documents and Settings\test\Local Settings\Temporary Internet Files\Content.IE5\S9URG12V\Draynor%20Wood%20Cutter%20and%20Banker[1].scar
    Notice: Silent mouse has been turned on
    Failed when compiling
    Line 432: [Hint] (10376:1): Variable 'OLDMS' never used in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 32: [Error] (12299:12): Unknown identifier 'BOOLEAN1' in script 
    Notice: Silent mouse has been turned on
    Failed when compiling
    Line 432: [Hint] (10376:1): Variable 'OLDMS' never used in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 32: [Error] (12299:12): Unknown identifier 'BOOLEAN1' in script 
    Notice: Silent mouse has been turned on
    Failed when compiling
    Line 432: [Hint] (10376:1): Variable 'OLDMS' never used in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 32: [Error] (12299:12): Unknown identifier 'BOOLEAN1' in script
    thanks

  2. #2
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Well the first thing that it says in line 432 isnt an erroe an you dont need to worry about it, and the second bit I need to see some more of the script to see whats actually wrong with it. But I think that its just you havent identified the Boolean1 thing you have.

  3. #3
    Join Date
    Jan 2008
    Location
    inside you! :O
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program choppernbanker;    // always give a program name
    {.include /SRL/SRL.scar}
    {.include /SRL/SRL/skill/WoodCutting.scar}
    var
      x, y, i2, watercolor2:integer;  //i'd switch i2 to h for example
    
    const
      WillowColorA = 2319190;  //these are better as constables, because they don't change,
      WillowColorB = 2319190;  // we only put things as variables when we intend to make them
      WillowColorC = 1791306;  // change during the script
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := '';
      Players[0].Loc        := '';
      Players[0].Active     := True;
      Players[0].Integers[1] := 0;
      Players[0].Integers[2] := 30; //Loads to do before switching players
    
      NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    // why did u have the wilow colors in declare players?
    end;
    
    function AllPlayersInactive(number : integer) : boolean;
    var
      thisi : integer;
      thisi2 : integer;
    begin;
      thisi := 0;
      thisi2 := 0;
      for thisi := 0 to number do
      begin;
        if(Players[thisi].Active = True) then
        begin;
          Result:=False;
        end else
        begin;
          thisi2:= thisi2 +1;
          if(thisi2=number) then result:=true;
        end;
      end;
    end;
    
    procedure Proggy;
    begin;
      writeln('Player: ' + Players[CurrentPlayer].name);
      writeln('Chopped approximately: ' + inttostr(Players[CurrentPlayer].Integers[1]) + ' willows');
    end;
    
    function FindFastRandoms: Boolean; //By WT-Fakawi.
    var
      i: Integer;
    begin
      for i := 1 to 8 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
          3: if FindMime then
              Result := True;
          4: if FindMaze then
              Result := True;
          5: if FindQuiz then
              Result := True;
          6: if FindDemon then
              Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
        end;
        wait(1);
      end;
    end;
    
    procedure FindRandoms;
    begin;
      if not loggedin then exit;
      FindFastRandoms;
      FindNormalRandoms;
    end;
    
    procedure Chop;
    begin;
      if not loggedin then exit;
      if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
      findcolor(x,y,willowcolorB,0,0,1400,1400) or
      findcolor(x,y,willowcolorC,0,0,1400,1400) then
      begin //you have begin; here, usually we only put begin without the ";"
        disguise('Chopping...')
        MMouse(x,y,3,3);
        if isuptext('hop') then
        begin;
          GetMousePos(x,y);
          Mouse(x,y,0,0,true);
          Flag;                       //when you use flag it'll wait until the flag is gone,
          wait(4000 + random(1000));  // i guess this wait is to give it time to chop?
        end else
        begin;
          i2 := 0;
          while(i2 < 39) do
          begin
            if findcolortolerance(x,y,WillowcolorA,0,0,1400,1400,25) or
            findcolortolerance(x,y,willowcolorB,0,0,1400,1400,25) or
            findcolortolerance(x,y,willowcolorC,0,0,1400,1400,25) then
            begin
              MMouse(x,y,1,1);
              if isuptext('hop') then
              begin;
                GetMousePos(x,y);
                Mouse(x,y,0,0,true);
                Flag;
              end;
            end else
              wait(4000 + random(1000));
          end;
        end;
    
      end else
        i2 := i2 + 1;
      if(i2 = 39) then
      begin;
        Players[currentplayer].loc := 'lost';
        Players[currentplayer].active := False;
        nextplayer(Players[currentplayer].active);
        {you had next player (true) here, that means it'd get lost
        but it would still try to play again next time. nextplayer(true) means
        that the current player will be left to true.
        next player false means that you'll switch to next player but that this
        one will be left false. and you should only switch the player at the end
        of the cycle in the mainloop, so that the next player doesn't start in
        this programming loop, looking for the trees.
        }
      end;                 .
    end;
    
    procedure ToBank;
    begin;
      if not LoggedIn then exit;
      disguise('Going to bank');
      findsymbol(x,y,'bank');
      Mouse(x,y,1,1,true);
      Flag;
    end;
    
    procedure ToWillow;
    begin;
      if not loggedin then exit;
      wait(1000 + random(50))
      makecompass('E');
      disguise('Going to willow')
      HighestAngle;
      watercolor2:=FindWaterColor;
      if(findcolor(x,y,watercolor2,0,0,1400,1400)) then
      begin;
        wait(2000 + random(100));
        mouse(x,y,1,1,true);
        wait(100 + random(100)); //the fish symbol will constantly be changing place,
        Flag;                    // do not rely too much on this, although it does work
        MakeCompass('E');        // most the time. for other symbols like bank it might
        FindSymbol(x,y,'fish');  // totally screw up your script, like it may click the bank script
        Mouse(x,y,1,1,true)      // and actually go to a wall on the outside part of the bank
        Flag;
      end else
      begin;
        writeln('Cant find watercolor. Next Player.');
        Players[currentplayer].loc := 'lost';
        Players[currentplayer].active := 'False';
        NextPlayer(False);  //same mistake as before, this should be in the mainloop, and false, not true
      end;
    end;
    
    procedure BankWillows;
    begin;
      if not loggedin then exit;
      disguise('Starting banking procedure')
      if(invFull) then
      begin;
        ToBank;
        Disguise('Opening bank and banking.')
        OpenBankQuiet('db');
        DepositAll;
        MakeCompass('E');
        Players[currentplayer].Integers[1] := Players[currentplayer].Integers[1] + 1;
        if(Players[currentplayer].Integers[1] >= Players[currentplayer].Integers[2]) then
        begin;
          Proggy;                                  // this should not be false,
          Players[currentplayer].Active := False;  // it should be true, because that way,
          nextplayer(true);                        //when all the other players have done
                                                   //their loads, it can always come back to this
        end;                                       //one and keep on going forever
    
      end;
    end;
    
    //mainloop
    begin
      SetupSRL;
      MouseSpeed:=10; // SetupSRL already sets the mousespeed
      DeclarePlayers;
      wait(1000 + random(50)); // why wait here?
      ActivateClient;
      if not LoggedIn then LoginPlayer;
      repeat
        MakeCompass('E');
        ToWillow;
        FindRandoms;
        repeat
          if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
          findcolor(x,y,willowcolorB,0,0,1400,1400) or
          findcolor(x,y,willowcolorC,0,0,1400,1400) then
          begin;
            MMouse(x,y,1,1);
            FindEnt(x,y,true)
          end;
          Chop;
          FindRandoms;
        until(invFull)
        FindRandoms;
        BankWillows;
      until(AllPlayersInactive(1))
    end.
    
    {your FindRandoms should also be inside the chopping procedure,
    because while you're chopping is when it's most likely to get a random
    ~RMagician
    }

  4. #4
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    I'm not quite sure then, because i went down to line 32 and I didnt see any Boolean1 there. just to try though, put boolean1 in your variables

  5. #5
    Join Date
    Jan 2008
    Location
    inside you! :O
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    Line 26: [Error] (12490:1): Unknown identifier 'NickNameBMP' in script

  6. #6
    Join Date
    Jan 2008
    Location
    inside you! :O
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i added you on msn

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

    Default

    Please use the edit button instead of double posting in the future. To fix the error, just remove the line 'NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);' and it should compile.

  8. #8
    Join Date
    Jan 2008
    Location
    inside you! :O
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    now i got a nother error

    Line 66: [Error] (12530:7): Unknown identifier 'FindMime' in script

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

    Default

    If you followed an older tutorial to learn how to script or it's someone elses, then it might be that it isn't updated to the latest version of SRL. I'm guessing fixing an error will just give another, but I'll go through it anyway.

    Edit: There were only a couple more errors, so you got lucky. FindMime and FindDemon aren't used anymore (FindDemon has a new name) and HighestAngle had to be chnaged to 'SetAngle(True)' and lastly, you had a false enclosed in 's, so it though it was a string, giving you a type mismatch.
    SCAR Code:
    program choppernbanker;    // always give a program name
    {.include SRL/SRL.scar}
    {.include SRL/SRL/skill/WoodCutting.scar}
    var
      x, y, i2, watercolor2:integer;  //i'd switch i2 to h for example

    const
      WillowColorA = 2319190;  //these are better as constables, because they don't change,
      WillowColorB = 2319190;  // we only put things as variables when we intend to make them
      WillowColorC = 1791306;  // change during the script

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

      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := '';
      Players[0].Loc        := '';
      Players[0].Active     := True;
      Players[0].Integers[1] := 0;
      Players[0].Integers[2] := 30; //Loads to do before switching players

    //  NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    // why did u have the wilow colors in declare players?
    end;

    function AllPlayersInactive(number : integer) : boolean;
    var
      thisi : integer;
      thisi2 : integer;
    begin;
      thisi := 0;
      thisi2 := 0;
      for thisi := 0 to number do
      begin;
        if(Players[thisi].Active = True) then
        begin;
          Result:=False;
        end else
        begin;
          thisi2:= thisi2 +1;
          if(thisi2=number) then result:=true;
        end;
      end;
    end;

    procedure Proggy;
    begin;
      writeln('Player: ' + Players[CurrentPlayer].name);
      writeln('Chopped approximately: ' + inttostr(Players[CurrentPlayer].Integers[1]) + ' willows');
    end;

    function FindFastRandoms: Boolean; //By WT-Fakawi.
    var
      i: Integer;
    begin
      for i := 1 to 8 do
      begin
        case I of
          1: if FindDead then
              Result := True;
          2: if FindMod then
              Result := True;
    //      3: if FindMime then
    //          Result := True;
    //      4: if FindMaze then
    //          Result := True;
          5: if FindQuiz then
              Result := True;
    //      6: if FindDemon then
    //          Result := True;
          7: begin
              if NoGameTab then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'No GameTab';
                Logout;
                Exit;
              end;
            end;
          7: begin
              if InBlack then
              begin
                Result := True;
                Players[CurrentPlayer].loc := 'InBlack';
                Logout;
                Exit;
              end;
            end;
          8: RC;
        end;
        wait(1);
      end;
    end;

    procedure FindRandoms;
    begin;
      if not loggedin then exit;
      FindFastRandoms;
      FindNormalRandoms;
    end;

    procedure Chop;
    begin;
      if not loggedin then exit;
      if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
      findcolor(x,y,willowcolorB,0,0,1400,1400) or
      findcolor(x,y,willowcolorC,0,0,1400,1400) then
      begin //you have begin; here, usually we only put begin without the ";"
        disguise('Chopping...')
        MMouse(x,y,3,3);
        if isuptext('hop') then
        begin;
          GetMousePos(x,y);
          Mouse(x,y,0,0,true);
          Flag;                       //when you use flag it'll wait until the flag is gone,
          wait(4000 + random(1000));  // i guess this wait is to give it time to chop?
        end else
        begin;
          i2 := 0;
          while(i2 < 39) do
          begin
            if findcolortolerance(x,y,WillowcolorA,0,0,1400,1400,25) or
            findcolortolerance(x,y,willowcolorB,0,0,1400,1400,25) or
            findcolortolerance(x,y,willowcolorC,0,0,1400,1400,25) then
            begin
              MMouse(x,y,1,1);
              if isuptext('hop') then
              begin;
                GetMousePos(x,y);
                Mouse(x,y,0,0,true);
                Flag;
              end;
            end else
              wait(4000 + random(1000));
          end;
        end;

      end else
        i2 := i2 + 1;
      if(i2 = 39) then
      begin;
        Players[currentplayer].loc := 'lost';
        Players[currentplayer].active := False;
        nextplayer(Players[currentplayer].active);
        {you had next player (true) here, that means it'd get lost
        but it would still try to play again next time. nextplayer(true) means
        that the current player will be left to true.
        next player false means that you'll switch to next player but that this
        one will be left false. and you should only switch the player at the end
        of the cycle in the mainloop, so that the next player doesn't start in
        this programming loop, looking for the trees.
        }

      end;
    end;

    procedure ToBank;
    begin;
      if not LoggedIn then exit;
      disguise('Going to bank');
      findsymbol(x,y,'bank');
      Mouse(x,y,1,1,true);
      Flag;
    end;

    procedure ToWillow;
    begin;
      if not loggedin then exit;
      wait(1000 + random(50))
      makecompass('E');
      disguise('Going to willow')
      SetAngle(True);
      watercolor2:=FindWaterColor;
      if(findcolor(x,y,watercolor2,0,0,1400,1400)) then
      begin;
        wait(2000 + random(100));
        mouse(x,y,1,1,true);
        wait(100 + random(100)); //the fish symbol will constantly be changing place,
        Flag;                    // do not rely too much on this, although it does work
        MakeCompass('E');        // most the time. for other symbols like bank it might
        FindSymbol(x,y,'fish');  // totally screw up your script, like it may click the bank script
        Mouse(x,y,1,1,true)      // and actually go to a wall on the outside part of the bank
        Flag;
      end else
      begin;
        writeln('Cant find watercolor. Next Player.');
        Players[currentplayer].loc := 'lost';
        Players[currentplayer].active := False;
        NextPlayer(False);  //same mistake as before, this should be in the mainloop, and false, not true
      end;
    end;

    procedure BankWillows;
    begin;
      if not loggedin then exit;
      disguise('Starting banking procedure')
      if(invFull) then
      begin;
        ToBank;
        Disguise('Opening bank and banking.')
        OpenBankQuiet('db');
        DepositAll;
        MakeCompass('E');
        Players[currentplayer].Integers[1] := Players[currentplayer].Integers[1] + 1;
        if(Players[currentplayer].Integers[1] >= Players[currentplayer].Integers[2]) then
        begin;
          Proggy;                                  // this should not be false,
          Players[currentplayer].Active := False;  // it should be true, because that way,
          nextplayer(true);                        //when all the other players have done
                                                   //their loads, it can always come back to this
        end;                                       //one and keep on going forever

      end;
    end;

    //mainloop
    begin
      SetupSRL;
      MouseSpeed:=10; // SetupSRL already sets the mousespeed
      DeclarePlayers;
      wait(1000 + random(50)); // why wait here?
      ActivateClient;
      if not LoggedIn then LoginPlayer;
      repeat
        MakeCompass('E');
        ToWillow;
        FindRandoms;
        repeat
          if findcolor(x,y,WillowcolorA,0,0,1400,1400) or
          findcolor(x,y,willowcolorB,0,0,1400,1400) or
          findcolor(x,y,willowcolorC,0,0,1400,1400) then
          begin;
            MMouse(x,y,1,1);
            FindEnt(x,y,true)
          end;
          Chop;
          FindRandoms;
        until(invFull)
        FindRandoms;
        BankWillows;
      until(AllPlayersInactive(1))
    end.

    {your FindRandoms should also be inside the chopping procedure,
    because while you're chopping is when it's most likely to get a random
    ~RMagician
    }

  10. #10
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    The reason it says unknown identifier FindMime is that you no longer need to have those sort of antirandoms as you can just put FindNormalRandoms in the Anti-random bit. All you should do is delete the lines to do with that bit, you might have to do the same with about 3 others too.

  11. #11
    Join Date
    Jan 2008
    Location
    inside you! :O
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ty guys i owe u

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help running script
    By Alco13 in forum OSR Help
    Replies: 4
    Last Post: 04-27-2008, 07:11 PM
  2. please help! error running code
    By xiao5136 in forum OSR Help
    Replies: 4
    Last Post: 12-10-2007, 03:19 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
  •