SRL Archive - OSR Beginner Scripting Tutorials

How to make a 'Status' for your script!


rj

2013-01-06 17:35:01

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

2013-01-06 18:30:09

Seems unnecessary but good job nonetheless

rj

2013-01-06 19:09:52

From: SwagDaddy
Seems unnecessary but good job nonetheless


whats unnecessary about a status update lol

John

2013-01-06 20:00:10

From: SwagDaddy
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

2013-01-06 20:21:21

From: John
It is extremely helpful for debugging due to it telling you where it was up to when it fails.


This ^

Rezozo

2013-01-06 20:39:10

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

2013-01-06 20:43:33

From: Rezozo
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

2013-01-06 20:49:15

From: John
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

2013-01-06 21:21:19

From: SwagDaddy
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

2013-01-06 21:38:58

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

2013-01-07 00:32:14

From: SwagDaddy
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

2013-01-07 01:53:39

From: rjj95
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

2013-01-07 10:03:33

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

2013-04-13 13:17:14

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

2013-04-13 13:18:36

From: mafia miles
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

2013-04-27 13:27:23

Whats the difference between writeln and status?

rj

2013-04-27 13:36:33

From: randy marsh
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