Results 1 to 17 of 17

Thread: How to make a 'Status' for your script!

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default How to make a 'Status' for your script!

    Here is my tutorial on how to make a status for your script. Of course you have to have your own script, but this will outline the basics.

    First, declare a GLOBAL string variable like so:

    Simba Code:
    var
      Status:string

    To change the status just do this everytime before a WriteLn:

    Simba Code:
    Status := ('Write your status here')

    A example of Just the WriteLn status:

    Simba Code:
    Writeln('Status:' + Status)

    You can change this variable as much as you want. I personally change it before each procedure for a accurate status update. Here is a example script of status being used:

    Simba Code:
    Program Status;

    var
      Bye, Hello: Integer;
      Status: string;

    procedure GoodByeWorld;
    begin
      IncEx(Bye, 1);
      Status := ('Doing Procedure GoodByeWorld')
      ClearDebug;
      Writeln('Status:' + Status)
      Writeln('Bye:' + IntToStr(Bye));
      Writeln('Hello:' + IntToStr(Hello));
      Wait(1000);
    end;

    procedure HelloWorld;
    begin
      IncEx(Hello, 1);
      Status := ('Doing Procedure HelloWorld')
      ClearDebug;
      Writeln('Status:' + Status)
      Writeln('Bye:' + IntToStr(Bye));
      Writeln('Hello:' + IntToStr(Hello));
      Wait(1000);
      GoodByeWorld;
    end;

    begin
      HelloWorld;
      repeat
        HelloWorld
      until False;
    end.

    I hope this tut helped, It works great for me!

  2. #2
    Join Date
    Mar 2012
    Location
    Alberta
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Seems unnecessary but good job nonetheless

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by SwagDaddy View Post
    Seems unnecessary but good job nonetheless
    whats unnecessary about a status update lol

  4. #4
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by SwagDaddy View Post
    Seems unnecessary but good job nonetheless
    It is extremely helpful for debugging due to it telling you where it was up to when it fails.

  5. #5
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by John View Post
    It is extremely helpful for debugging due to it telling you where it was up to when it fails.
    This ^


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  6. #6
    Join Date
    Dec 2011
    Location
    Nj
    Posts
    2,341
    Mentioned
    1 Post(s)
    Quoted
    18 Post(s)

    Default

    I would suggest adding a space after the colon, as it would look a bit awkward without it. (unless you start all your statuses/sentences with spaces )
    ~Rez

    For the basics of the basics of pascal, try my TuT. ||Photoshop Editing ||MapleResourceDung Script || Book a flight! BuySellTrip

  7. #7
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Rezozo View Post
    I would suggest adding a space after the colon, as it would look a bit awkward without it. (unless you start all your statuses/sentences with spaces )
    ~Rez
    Some people like it read
    Simba Code:
    Hi:2
    Bye:2

    Other then

    Simba Code:
    Hi: 2
    Bye: 2

    It's up to you lol

  8. #8
    Join Date
    Mar 2012
    Location
    Alberta
    Posts
    52
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by John View Post
    It is extremely helpful for debugging due to it telling you where it was up to when it fails.
    I meant making a tutorial on using it.

  9. #9
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by SwagDaddy View Post
    I meant making a tutorial on using it.
    Why not? It helps people with their WriteLn's and I wanted to know how to do with for my progress reports around a month ago and couldn't find a tutorial.To be honest I don't even know why you posted in the first place because your post has no useful contribution to the topic.

  10. #10
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    I use to love adding this to my scripts, it helps the users report a problem to the script writer & great for testing scripts.

    Good Tut you got here Mate, keep it coming!

  11. #11
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by SwagDaddy View Post
    I meant making a tutorial on using it.
    Well everyone starts somewhere. Why not come here and learn proper debugging?

    It is more useful then you realise.

  12. #12
    Join Date
    Jan 2012
    Location
    Calgary, AB, Canada
    Posts
    1,819
    Mentioned
    5 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    Why not? It helps people with their WriteLn's and I wanted to know how to do with for my progress reports around a month ago and couldn't find a tutorial.To be honest I don't even know why you posted in the first place because your post has no useful contribution to the topic.
    Lol can't see how it would help people with WriteLn's as the are VERY simple to figure out without a tutorial on them.

    Good job on the tut though
    Current Project: Retired

  13. #13
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    I always thought status would be more easy then just your debug getting spammed like:

    Code:
    clicking rock
    Waiting
    Clicking rock
    Antiban
    Dropping ores
    Dropping ores
    Dropping ores
    clicking rock
    Waiting
    Clicking rock
    Antiban
    Dropping ores
    Dropping ores
    Dropping ores

  14. #14
    Join Date
    Dec 2011
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    This saved my cball making script. I couldnt figure out why it clicked on the furnace after it started smithing. thank you so much!
    Now for questions
    what is: IncEx(Bye, 1); whats the incex stand for? the 1?

  15. #15
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by mafia miles View Post
    This saved my cball making script. I couldnt figure out why it clicked on the furnace after it started smithing. thank you so much!
    Now for questions
    what is: IncEx(Bye, 1); whats the incex stand for? the 1?
    IncEx adds to the variable, its more easy to do

    bye := bye+1

  16. #16
    Join Date
    Jun 2007
    Location
    south park
    Posts
    1,160
    Mentioned
    0 Post(s)
    Quoted
    62 Post(s)

    Default

    Whats the difference between writeln and status?
    http://www.youtube.com/user/YoHoJoSRL
    Good scripting guides on youtube
    Formerly known as (djcheater)

  17. #17
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by randy marsh View Post
    Whats the difference between writeln and status?
    None, writeln is probably better for debuging, status is more to make the finished script look better, for example telling the user what it is doing

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
  •