Results 1 to 24 of 24

Thread: Creating Progress Reports

  1. #1
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Creating Progress Reports

    Hey, this is my tutorial on creating a progress report, so enjoy

    What's A "Progress Report"?
    A progress report, or proggy, is text that is outputted into the debug box at the bottom of scar, letting you know stats from the script running. To me, it is a great thing to add into your script.


    Writing The Procedure
    Firstly, create a procedure, name is anything you want of course.
    Code:
    procedure Report;
    begin
    end;
    Then, add ClearDebug; to your procedure. This will clear everything in the debug screen.
    Code:
    procedure Report;
    begin
      ClearDebug;
    end;

    Counting a Action
    Progress reports count things that your script does to let their users know, so this can be helpful in letting the user know how many times their script has performed anti ban procedures. We do this by following these steps:


    Creating The Variable
    At the top of your script, you should have something like this:
    Code:
    var
      x, y: integer;
    Add this to it:
    Code:
    var
      x, y, AntibanUsed: integer;

    Inserting the Addition
    Find you antiban procedure, this is an example procedure:

    Code:
    procedure AntiBan;
    begin
      if(not(LoggedIn))then Exit;
      wait(200+random(125)+random(138));
      keyup(VK_DOWN);
      wait(random(232));
      SendArrow(0);
      case random(4) of
        0: PickUpMouse;
        1: RandomMovement;
        2: RandomRClick;
        3: BoredHuman;
      end;
    end;
    And change it to this:
    Code:
    procedure AntiBan;
    begin
      if(not(LoggedIn))then Exit;
      wait(200+random(125)+random(138));
      keyup(VK_DOWN);
      wait(random(232));
      SendArrow(0);
      case random(4) of
        0: PickUpMouse;
        1: RandomMovement;
        2: RandomRClick;
        3: BoredHuman;
      end;
      inc(AntibanUsed);
    end;
    Useful Info:
    The function "inc" is short for increment, which means that even time the script comes to that inc, it will change the amount of the variable "AntibanUsed" to 1, and when the script comes by again, it will change to 2, and so on.



    Gathering And Outputting the Information
    Remember your Report Procedure?, Go back to it and change it to this:
    Code:
    procedure Report;
    begin
      ClearDebug;
      WriteLn('Antibans Performed: ' + IntToStr(AntibanUsed));
    end;
    Useful Info:
    The function WriteLn stands for Write Line. It will type out "AntiBans Performed (How many times it was done).
    IntToStr stands for Insert Into String, which means it will insert the number saved by the function inc(AntibanUsed);.


    Calling The Report
    You must tell the script when to print out the function, right? A good time to do this is when the script has just banked a load of logs, or just did a run of runecrafting. To make the report show up in the debug box, just enter this after you close the bank screen or wherever.
    Code:
    Report;

    Beautifying Your Proggy
    If you have ever seen a progress report come out of the debug box all messy and not lined up, well this part is to show you how to fix it.

    Your old report procedure had looked like this:
    Code:
    procedure Report;
    begin
      ClearDebug;
      WriteLn('Antibans Performed: ' + IntToStr(AntibanUsed));
    end;
    To fix it, and make it lined up, you can do this:

    Code:
    procedure Report;
    begin
      ClearDebug;
      WriteLn('=====================================================================');
      WriteLn(Padr('|| AntiBans Performed: ' + IntToStr(AntiBanUsed), 67) + '||');
      WriteLn('=====================================================================');
    end;
    Useful Info:
    Padr stand for pad right, which is the part which lines up the progress report. There is also Padl, and Padz. The 67 near the end may not make sense, but the means how many spaces to use after it prints out the sentence, making it line up with all the = signs, giving your progress report a nice clean box look.


    There, you made it! I hope you enjoy it and learned something

  2. #2
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    nice tut hey this may sound nooby but i never learned how to make a multy player proggy maybe u could add how to do that

  3. #3
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    nice tut hey this may sound nooby but i never learned how to make a multy player proggy maybe u could add how to do that
    your not alone on that one:P Ill add it when i learn it

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by D1zl3 View Post
    your not alone on that one:P Ill add it when i learn it
    lol ok ill be waiting

  5. #5
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

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

    Default

    Nice tut. Although some terminology is a bit off. Inc is short for Increment, not include. And Padr is short for Pad Right. There's also a Padl, which is short for Pad Left.

  7. #7
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  8. #8
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by D1zl3 View Post
    lol great thanks alot ill change it
    Great Tutorial, Gives me an idea .
    Add Padz.
    Rep+

  9. #9
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Great Tutorial, Gives me an idea .
    Add Padz.
    Rep+
    added, thanks

  10. #10
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    And IncEx for adding more than one two a var. (Logs/load and things like that )

  11. #11
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by 99_ aka ian. View Post
    And IncEx for adding more than one two a var. (Logs/load and things like that )
    And DecEx for subtraction

  12. #12
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  13. #13
    Join Date
    Mar 2008
    Location
    In a cave
    Posts
    345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, I do multiplayer proggys by using the player array. You get like a hundred global integers, extendeds, strings and booleans with it for EACH player. Then simply do something like that:
    SCAR Code:
    procedure ForProggy(LogsGot: integer);
    begin
      IncEx(Players[CurrentPlayer].Integers[0], LogsGot);//You have to count the logs for it ;)
    end;
    The same applies for antibans/errors/randoms/pickups/failsafes and so on
    A Chinese wiseman once said: "Shu ciu!", it was considered very smart, but now people know it means: "Something stinks here!"
    FalBuggySmelter v.1.31
    [Updated on the 1st of March 2010]
    RimmBugger BETA V1.8

  14. #14
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    And DecEx for subtraction
    And Dec for that matter.

  15. #15
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Example of multiplayer proggies:
    SCAR Code:
    // lets say that players[x].Integers[0] is "Ores mined" and
    // players[x].Integers[1] is "Loads Banked" and
    // players[x].Strings[0] is "Oretype"

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

      players[0].Name := 'killer';
      players[0].Pass := 'pass123';
      players[0].Strings[1] := 'mithril';
      players[0].Active := true;

      players[1].Name := 'purepk13';
      players[1].Pass := 'pass123';
      players[1].Strings[1] := 'coal';
      players[1].Active := true;

      players[2].Name := 'thedragonman';
      players[2].Pass := 'pass123';
      players[2].Strings[1] := 'iron';
      players[2].Active := true;
    end;

    procedure MineOre;
    begin
      FindOre;
      ClickOre;
      Inc(players[currentplayer].Integers[0]);
    end;

    procedure Bank;
    begin
      WalkToBank;
      DepositAllOres;
      Inc(players[currentplayer].Integers[1]);
    end;

    procedure Report;
    var
      i: integer;
    begin
      writeln('~~ Awesome example miner! - by marpis ~~');
      for i := 0 to (HowManyPlayers -1) do
      begin
        writeln(players[i].Name);
        writeln('  Oretype :       '+players[i].Strings[0]);
        writeln('  Ores mined:    '+IntToStr(players[i].Integers[0]));
        writeln('  Loads banked: '+IntToStr(players[i].Integers[1]));
        writeln(''); // empty line
      end;
      writeln('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
      writeln('Thanks for using my script! Remember to post proggy!');
    end;

    for example, this could output
    Code:
    ~~ Awesome example miner! - by marpis ~~
    killer
      Oretype:        mithril
      Ores mined:    28
      Loads banked: 1
    
    purepk13
      Oretype:        coal
      Ores mined:    56
      Loads banked: 2
    
    thedragonman
      Oretype:        iron
      Ores mined:    100
      Loads banked: 4
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    Thanks for using my script! Remember to post proggy!
    Last edited by marpis; 07-22-2009 at 10:49 PM.

  16. #16
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could, of course, use SRL's?

  17. #17
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    You could, of course, use SRL's?
    some ppl - including me - rather make their own proggys

  18. #18
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks for the multiplayer proggy marpis. May i add it in, giving you the credits?

  19. #19
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    D1zl3 try this:
    SCAR Code:
    program ProgressReport;
    {.include SRL/SRL.scar}

    procedure DeclarePlayers;
    var
      i, ii : integer;
    begin
      HowManyPlayers := 3;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
     
      players[0].Name := 'killer';
      players[0].Pass := 'pass123';
      players[0].Strings[0] := 'mithril';
      players[0].Active := true;

      players[1].Name := 'purepk13';
      players[1].Pass := 'pass123';
      players[1].Strings[0] := 'coal';
      players[1].Active := true;

      players[2].Name := 'thedragonman';
      players[2].Pass := 'pass123';
      players[2].Strings[0] := 'iron';
      players[2].Active := true;

      for i := 0 to 2 do
        for ii := 0 to 2 do
          players[i].Integers[ii] := Random(300);
    end;

    var
      h, i : integer;
     
    begin
      DeclarePlayers;
      Writeln('|-------------------------------------------------------------------|');
      Writeln('|Test                                                   Version 1.0 |');
      Writeln('|-------------------------------------------------------------------|');
      Writeln('| Name           | Oretype     | Ore Mined  | Loads Banked | Active |');
      Writeln('|-------------------------------------------------------------------|');
      h := high(Players);
      for i := 0 to h do
        Writeln(Format('| %s| %s| %s| %s| %s|', [Padr(Players[i].Name, 15),
                                                 Padr(Players[i].Strings[0], 12),
                                                 Padr(IntToStr(Players[i].Integers[0]), 11),
                                                 Padr(IntToStr(Players[i].Integers[1]), 13),
                                                 Padr(BoolToStr(Players[i].Active), 7)]));
    end.

  20. #20
    Join Date
    Oct 2006
    Location
    United States
    Posts
    672
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  21. #21
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Lol, nope. Just one I made.

  22. #22
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,851
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default

    Quote Originally Posted by D1zl3 View Post
    thanks for the multiplayer proggy marpis. May i add it in, giving you the credits?
    yes ofcourse

  23. #23
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Da 0wner loved the Format function. It might be useful to add in here, if you understand it.

  24. #24
    Join Date
    Oct 2010
    Location
    Mordor
    Posts
    72
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This was really helpful. Thank you for posting this

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
  •