Page 1 of 2 12 LastLast
Results 1 to 25 of 34

Thread: CheckRun

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

    Default CheckRun

    Pretty basic, quite handy.

    SCAR Code:
    {*******************************************************************************
    procedure CheckRun
    Description: Checks your run % and clicks on run if it is above your percentage
    By: Torrent of Flame
    *******************************************************************************}

    function CheckRun(WhatPercent: Byte): Boolean;
    var
     Runcolor: string;
     
    begin
      Result := (GetMMLevels('run', runcolor) > WhatPercent);
      if Result then SetRun(True);
    end;

    Can Change Energy to whatever you want.

    In Use;

    SCAR Code:
    CheckRun(75);
    Jus' Lurkin'

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    I like it.

    Maybe Ill use in my new Script?

    Should be out soon

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

    Default

    Cool ^.^
    Jus' Lurkin'

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

    Default

    Why make it a boolean if it is goig to return true every time?
    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

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

    Default

    a > b

    a:
    SCAR Code:
    {*******************************************************************************
    procedure DoRun;
    Description: Checks your run % and clicks on run if it is above your percentage
    By: Torrent of Flame
    *******************************************************************************}

    procedure DoRun(WhatPercent: integer);
    var
     Energy: Integer;
     Runcolor: string;
    begin
      Energy:= GetMMLevels('run', runcolor);
      if(Energy > WhatPercent) then SetRun(True);
    end;

    Yours is b.

    No need to make it a function, let alone a boolean.

  6. #6
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    change
    SCAR Code:
    if(Energy > WhatPercent) then SetRun(True);
      Result := True;

    to
    SCAR Code:
    if(Energy > WhatPercent) then begin SetRun(True);
      Result := True;
      end else
      result := false;
    I do visit every 2-6 months

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

    Default

    There is not a bloolean needed. TViYH's is sufficient. Fine function though ToF.
    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

  8. #8
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    i think a boolean would be great because,

    SCAR Code:
    if not checkrun(75) then writeln('You do not have the run requirement for this part of the quest.');

    ^ would be useful if you are making a quester that needs 75% run energy or a guaranteed fail would happen.
    I do visit every 2-6 months

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

    Default

    Ill make it a procedure.
    Jus' Lurkin'

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

    Default

    Quote Originally Posted by zasz View Post
    i think a boolean would be great because,

    ScarScript:By Drunkenoldma
    if not checkrun(75) then writeln('You do not have the run requirement for this part of the quest.');

    ^ would be useful if you are making a quester that needs 75% run energy or a guaranteed fail would happen.
    But how his procedure would do would always return true.

  11. #11
    Join Date
    Oct 2007
    Location
    http://ushort.us/oqmd65
    Posts
    2,605
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by TViYH View Post
    But how his procedure would do would always return true.
    Im saying with my fix I posted earlier, it makes it return true/false
    I do visit every 2-6 months

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

    Default

    Ah it doesnt matter, to be honest
    Jus' Lurkin'

  13. #13
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by zasz View Post
    change
    SCAR Code:
    if(Energy > WhatPercent) then SetRun(True);
      Result := True;

    to
    SCAR Code:
    if(Energy > WhatPercent) then begin SetRun(True);
      Result := True;
      end else
      result := false;
    Or

    SCAR Code:
    Result := Energy > WhatPercent;
    If Result Then
      SetRun(True);



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    I made it a procedure. It isnt really necessary to have a boolean to be honest.
    Jus' Lurkin'

  15. #15
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    haha I remember when I taught you how to use this bout maybe two weeks ago, good to see you still use it and are making it even more useful. I see you are even still using the same variables name that I used to teach you same variable names I use.

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

    Default

    ^ You didnt really teach it too me. you told me about the run colour to I modified your ideas
    Jus' Lurkin'

  17. #17
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    SCAR Code:
    procedure CheckRun(WhatPercent: integer);
    var
     Energy: Integer;
     Runcolor: string;
     
    begin
      Energy:= GetMMLevels('run', runcolor);
      if(Energy > WhatPercent) then SetRun(True);
    end;

    SCAR Code:
    Function CheckRun(WhatPercent: integer) : Boolean;
    Var
     RunColor: string;
    Begin
      Result := (GetMMLevels('run', RunColor) >= WhatPercent);
      If Result Then
        SetRun(True);
    End;

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

    Default

    It doesnt need to be a function!!
    Jus' Lurkin'

  19. #19
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    ok it doesnt it doesnt need that extra var tho

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

    Default

    What Runcolour?

    The procedure for the MM needs to have Runcolor, or the procedure will not work.
    Jus' Lurkin'

  21. #21
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    It's funny how much arousal that can be caused by two lines.

    As Wizzup? said, this would be the best solution IMO.

    SCAR Code:
    function CheckRun(WhatPercent: Byte): Boolean;
    var
     Runcolor: string;
     
    begin
      Result := (GetMMLevels('run', runcolor) > WhatPercent);
      if Result then SetRun(True);
    end;

    E: Why not have it as a boolean function? An extra feature can't hurt.

  22. #22
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    yea I pretty much teached it to you. You were going to just do SetRun(True); when you wanted to run, I showed you how to check but I don't care. I'm just glad this is being used more now, I never really saw to many people use this and I searched these forums for a while to find a procedure/function that does what GetMMLevels does. And I agree why not make it a function? it would makke it a little better so you can do if/thens.

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

    Default

    ^.^


    Fiine. If it matters that much, Ill put it as EC has said.
    Jus' Lurkin'

  24. #24
    Join Date
    Mar 2008
    Location
    New Jersey
    Posts
    1,673
    Mentioned
    1 Post(s)
    Quoted
    9 Post(s)

    Default

    what evilchicken said is good and all, but I think it should be like this:

    SCAR Code:
    function CheckRun(WhatPercent: Byte; color: String): Boolean;
    var
     Runcolor: string;
     
    begin
      Result := (GetMMLevels('run', runcolor) > WhatPercent) or (GetMMLevels('run', runcolor) = color);
      if Result then SetRun(True);
    end;

    and for the color variable they can enter 'Green', 'Yellow', 'Orange', or 'Red'. Incase they want to turn run on/off at a certain color, and not number, just what I'd do to make it more user friendly.

  25. #25
    Join Date
    Mar 2007
    Location
    <3
    Posts
    2,683
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This has been done before..

    had one in my anti crabber script ages ago ^^

Page 1 of 2 12 LastLast

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
  •