Results 1 to 14 of 14

Thread: Line 228: [Warning] (13952:22): Calculation always evaluates to False in script

  1. #1
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Line 228: [Warning] (13952:22): Calculation always evaluates to False in script

    ermm ok i have a new error which i have never seen in my life
    SCAR Code:
    Line 228: [Warning] (13952:22): Calculation always evaluates to False in script
    however i cant work out why i get it, its not so muich an error but warning cant be good
    i get this twice in the script
    i have a feeling its to do with the way i use "and", and im not sure u can but i thought why not?

    Line 228:
    SCAR Code:
    Procedure FindMyAxe;
    begin
      Gametab(4);
      for I := 1 to 10 do
      begin
        AxeTol := AxeTol+5;
        AxeArea:= AxeArea+1;
        If FindDTM(AxeDDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
        begin
          MMouse(x, y, 1, 1);
          If IsUpText('roken') and // Line 228,
          (GoFixAxe) then
           OnWardsToFixAxe;
           Fixing;
        end else
          Mouse(x, y, 1, 1, true);
          Writeln('Axe Equiped');
          Writeln('It was a '+IntToStr(Axation)+' axe');
        end;
      If not FindDTM(AxeDDTM, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        Writeln(' Dont equpid the axe yet, next rls will allow it');
        terminatescript;
      end;
    end;

    is there a certain way to use the and command?

    ~Spaz

  2. #2
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe try and if?

  3. #3
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GoFixAxe is a constant set to false, right?

    Just think about it for a second. Since you're using "if (boolean) AND (boolean)", it's impossible for the code after the "if... then" statement to be run if one of the booleans is false. Since you're making one always set to false (the constant), it will always evaluate to false.

    It doesn't do anything so you don't really have anything to worry about. If you set that constant to true it should say that it'll always evaluate to true.

    There's nothing wrong with your use of ifs or ands on line 228 btw.
    Temporarily inactive.

  4. #4
    Join Date
    Jun 2007
    Location
    Ohio
    Posts
    341
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah, add an if before the (gofixaxe) thing.

    that should do it

  5. #5
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i was only wondering, i just like a clean script, no errors or hints or anything...

    so is there a way to have if (boolean) AND (boolean) with no warning?

    ~Spaz

  6. #6
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Make GoFixAxe a global variable and have the user set it to false manually in DeclarePlayers or some other easily located procedure.

    The script will think that it will change since it's a variable, but we know better
    Temporarily inactive.

  7. #7
    Join Date
    Mar 2007
    Location
    Netherlands->Amersfoort.
    Posts
    1,615
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    srl members link:
    http://www.villavu.com/forum/showthr...s+False+script

    Quote Originally Posted by mastaraymond View Post
    Here..
    SCAR Code:
    program New;
    begin
      if not false and true   then
        Writeln('test');
      if not false xor true=false  and true then
        Writeln('hoi');
    end.
    Try this one
    ^^

    that one is funny.
    anyway,, like ducels said. you messed up the with vars and const etc.

  8. #8
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well its a const atm,
    so
    SCAR Code:
    const
      TreeColor0            = 4083788;    //feel free to change these if they dont work, but they should
      TreeColor1            = 2120016;
      TreeColor2            = 3896170;
      SleepTime             = 45;         // Time for Sleep in Minutes
      UseObscureWillowPlace = False;       // New Willow loc,                       [!]* Not Tested Fully* [!]
      GetNewAxe             = False;      // go to Tutor and Get new axe if needed, [!]* Not Tested Fully* [!]
      GoFixAxe              = False;      // Will go to bob and fix axe,            [!]* Not Tested Fully* [!]

    so there all consts but bring up that same warning

    ~Spaz

  9. #9
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      UseObscureWillowPlace, GetNewAxe, GoFixAxe : Boolean;
     
    procedure DeclarePlayers;
    begin

      UseObscureWillowPlace := False;
      GetNewAxe := False;
      GoFixAxe := False;

      players[0].name := 'zezima';
      players[0].password := 'isabotter';
      players[0].nick := 'ezim';
      players[0].active := True;
    end;

    begin
      SetupSRL;
      DeclarePlayers
    end.

    That's how you'd do it for writing them as variables.

    I think that's what you were asking, didn't really understand your latest post so if that's not what you're looking for please elaborate.
    Temporarily inactive.

  10. #10
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks so much dude, lol now one more thing while im here, when making DDTM's and u change the name of the final DTM, so
    instead of:
    SCAR Code:
    result := AddDTM(TempDDTMSkel);
    //you have
    MyDTM := AddDTM(TempDDTMSkel);
    but you get Line 100: [Hint] (13824:10): Variable 'Result' never used in script

    will that always stay? or do u have to call the DTM result? which in theory wouldn't work with more than one DTM

    ~Spaz

  11. #11
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    MyDTM = global integer?

    Just change the DDTM setup functions to procedures and don't bother with result, like so:

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    var
      TheDDTM : Integer;
     
    procedure SetupDDTM;
    var
      RoadMainPoint : TDTMPointDef;
      RoadSubPoint : array[0..3] of TDTMPointDef;
      YRoadDTM1 : TDTM;
    begin

      RoadMainPoint.x:=603;
      RoadMainPoint.y:=128;
      RoadMainPoint.areasize:=1;
      RoadMainPoint.areashape:=0;
      RoadMainPoint.color:=5555;
      RoadMainPoint.tolerance:=3;

      RoadSubPoint[0].x:=613;
      RoadSubPoint[0].y:=127;
      RoadSubPoint[0].areasize:=1;
      RoadSubPoint[0].areashape:=0;
      RoadSubPoint[0].color:=5555;
      RoadSubPoint[0].tolerance:=3;

      RoadSubPoint[1].x:=602;
      RoadSubPoint[1].y:=121;
      RoadSubPoint[1].areasize:=1;
      RoadSubPoint[1].areashape:=0;
      RoadSubPoint[1].color:=5555;
      RoadSubPoint[1].tolerance:=3;

      RoadSubPoint[2].x:=604;
      RoadSubPoint[2].y:=109;
      RoadSubPoint[2].areasize:=1;
      RoadSubPoint[2].areashape:=0;
      RoadSubPoint[2].color:=5555;
      RoadSubPoint[2].tolerance:=3;

      RoadSubPoint[3].x:=587;
      RoadSubPoint[3].y:=112;
      RoadSubPoint[3].areasize:=1;
      RoadSubPoint[3].areashape:=0;
      RoadSubPoint[3].color:=5555;
      RoadSubPoint[3].tolerance:=3;


      YRoadDTM1.MainPoint := RoadMainPoint;
      YRoadDTM1.SubPoints := RoadSubPoint;
      TheDDTM := AddDTM(YRoadDTM1);
    end;

    begin
      SetupSRL;
      SetupDDTM;
    end.
    Temporarily inactive.

  12. #12
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yup all my DDTM's are global integers
    as in after the {.include}
    but before the first procedure,
    yet i still get that annoying result thing and since i have like 5 DDTM's
    i have lots of result things which make the starting part look quite untidy :P
    PS also i am kinda OCD in a way and want everything to work perfectly, kinda like a perfectionist :P

    ~Spaz

  13. #13
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I can't really say why they are giving that hint without seeing the actual script. You can fix it by doing what I said in the post above, though. If they are procedures instead of functions, result shouldn't even exist.
    Temporarily inactive.

  14. #14
    Join Date
    Dec 2006
    Location
    UK!!
    Posts
    910
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ahhhhh, ur amazing i had them all as functions and not procedures....
    now ive changed it i get no more errors thanks Ducels no more error or anything

    CLEAN!!!

    ~Spaz

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need a 10 line script
    By smokekills in forum RS3 Outdated / Broken Scripts
    Replies: 10
    Last Post: 05-19-2008, 09:56 PM

Posting Permissions

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