SRL Archive - OSR Help

Progress Report


Wetish

2012-01-31 19:17:11

Im really confused. How would you create a progress report for a script. I looked for a tutorial but I couldn't find one anywhere. I am creating a fishing script that catches swordfish and tuna. I was think of creating a dtm for each of them in order to count the amount caught after a full inventory but I do not know the code to count the amount of something in your inventory. Also what code do you use to write on the screen of smart?

PatDuffy

2012-01-31 19:19:24

you have to add global variables to count various things, then create a procedure that prints them out.

Wetish

2012-01-31 19:22:10

Ok. But what command would you use to print it on the screen?
Edit:
Nvm. I found it. Thanks anyway

Runaway

2012-01-31 19:22:55

To gather data for the progress report, use the Inc() procedure when you validate that a fish has been caught:


var
FishCaught: integer;

...
if CatchFish then Inc(FishCaught);
...

Then when you want to display how many fish have been caught, use the WriteLn() procedure:


WriteLn('Fish Caught:' + IntToStr(FishCaught));
// the IntToStr() procedure is used to convert the FishCaught variable
// from an integer to a string since the WriteLn() procedure requires a string.

EDIT: :ninja:'d