PDA

View Full Version : How to make a 'Status' for your script!



rj
01-06-2013, 10:35 PM
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:

var
Status:string

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

Status := ('Write your status here')

A example of Just the WriteLn status:

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:

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!

SwagDaddy
01-06-2013, 11:30 PM
Seems unnecessary but good job nonetheless

rj
01-07-2013, 12:09 AM
Seems unnecessary but good job nonetheless

whats unnecessary about a status update lol

John
01-07-2013, 01:00 AM
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.

DannyRS
01-07-2013, 01:21 AM
It is extremely helpful for debugging due to it telling you where it was up to when it fails.

This ^

Rezozo
01-07-2013, 01:39 AM
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 :p)
~Rez

rj
01-07-2013, 01:43 AM
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 :p)
~Rez

Some people like it read

Hi:2
Bye:2

Other then


Hi: 2
Bye: 2


It's up to you lol

SwagDaddy
01-07-2013, 01:49 AM
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.

rj
01-07-2013, 02:21 AM
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.

P1nky
01-07-2013, 02:38 AM
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!

John
01-07-2013, 05:32 AM
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.

Gucci
01-07-2013, 06:53 AM
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

rj
01-07-2013, 03:03 PM
I always thought status would be more easy then just your debug getting spammed like:


clicking rock
Waiting
Clicking rock
Antiban
Dropping ores
Dropping ores
Dropping ores
clicking rock
Waiting
Clicking rock
Antiban
Dropping ores
Dropping ores
Dropping ores

mafia miles
04-13-2013, 05:17 PM
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?

rj
04-13-2013, 05:18 PM
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

randy marsh
04-27-2013, 05:27 PM
Whats the difference between writeln and status?

rj
04-27-2013, 05:36 PM
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