SRL Archive - Outdated Tutorials

Making a Progress Report


WhiteShadow

2006-04-28 02:28:19

Making a Progress Report Tutorial

by : WhiteShadow


Difficulty: pfft, easy. :]

Progress reports are reports that are debugged in Scar's Debug. It shows your autoing progress.

They should display….
  1. Shows how long script has been running
  2. How much you've gained, a value of some sort Ex. ('You've mined 10 loads!')

Alright, so how do you show a certain value in your report? I will be using mining examples since they are most common these days.

Set a Global Variable that stores the value.

Example:

program Miner;
{.include SRL/SRL.Scar}

var//Global Variable SetUp
Loadz : Integer;//Change Loadz to any var name you want

const

Now how does that "Loadz" add more instead of just 0? Whatever your doing, mining, fishing, w/e, after that thing is done, Ex. (A load of ore or fish dropped, a load banked)
Inside that procedure you do Loadz:= Loadz + 1

Examples :
procedure DropOre;
begin
DropAll;//Dropped a full load of iron!
Loadz := Loadz + 1;//Loads done would be added 1
end;

procedure BankAll;
begin
repeat
OpenBank;//Repeats till finds bank screen opened
until(BankScreen)
Deposit2(1, 28);//Deposits All A load deposited
Loadz:= Loadz + 1;//Ah, Loadz Done plus another
end;

procedure Killer;//Just more Examples
begin
if(FinObj(x, y, 'Attack', Monster, 10))then//Finds Monster
Mouse(x, y, 1, 1, true);//if finds, clicks
repeat
Wait(100);//repeats wait till not find status bar
until(not(FindColorSpiral(x, y, GreenStatusColor, x1, y1, x2, y2)))//No time for coords
Killed:= Killed + 1//Kills Plus + 1
end;

Now how do I make it get displayed as a string so it can appear in the debug?

procedure Report;//Starts procedure off
begin
Writeln('[]-------------------------------------------[]');//Do any style you want
Writeln('Worked For : ' + ScriptTime2(2))//Displays how long it worked for
Writeln('Mined/Dropped '+ IntToStr(Loadz) + ' Loads');
Writeln('[]--------------------------------------------[]');
end;

Ok I will explain. ScriptTime2(2) displays how long script worked for as a string. You can use other functions or options, look in SRL includes for more options.Or just use my way.

IntToStr(Loadz) it retuns your Global Variable as a string instead of a stored variable integer.

Integer to String.

When you need to add more text use "+" ore your going to get some kind of comma error.


Well thats about it. I have a headache, blah. Sorry for any mistakes, this computer doesn't even have SCAR right now so.

Hope you guys learned something!

~WhiteShadow

mohua

2006-10-20 07:54:22

Pretty good tut, makes sense to me. Im going to try it when I get home…
Can't believe no one posted for such a good tutorial.

imported_Aftermath_96

2006-10-20 17:57:50

This is good, I tried it, and it works. Thanks a lot. :)

da_professa

2006-10-23 17:21:47

I am gonna try that for my auto monk fighter…Soon to be in the free scripts section

JAD

2007-02-21 17:09:42

oh sweet dude! thanks, have been looking for a tut so i can learn to make proggies. thanks for making this.

3Garrett3

2007-03-02 18:17:36

thanks very much, good tut, helped me out alot

deathbyvirus

2007-03-15 00:15:35

good tut, fairly basic but gets to the point, * thumps up*

rkroxpunk

2007-03-25 00:15:33

err is there another TUT on how to create a bit more complicated one…….nice TUT btw easy to understand

Smartzkid

2007-03-25 01:21:26

Aha! So that's how you make the script say how long it has been running for!

:p Thanks

Johura

2007-03-28 05:46:17

Thanks
+rep

i am foolish

2007-03-28 05:53:18

this sounds good because u can do a lot of math with it and figure things out..(ex. 30 loads x 28 slots= how many you have x price = $$ rollin' in $$

wired16

2007-05-02 13:10:15

sweet.. tyvm for posting this

PwNZoRNooB

2007-05-10 12:33:23

I just want to ask, sry this is a bit off-topic but, how could you do a chopped log counter when chopping oak?
Example:
You login
Welcome to Runescape.
You swing your axe at the tree.
You get some logs.

If you'd use InChatMulti 2 times, would it count the same text 2 times or would it see that the chat has stayed the same?

Or will you just have to count them when you drop them?

WhiteShadow

2007-05-10 19:25:49

I usually just prefer using

i:= CountItemDTM(logdtm); .

NumberOfTreesChopped:= NumberOfTreesChopped + i;

Writeln('Totally chopped'+IntTOStr(NumberOfTreesChopped) + ' trees.');

Something like that.

kooldude

2007-05-17 15:43:50

Nice Tut, Used The Debug Progress report in my script, Till i get my own style of one. TY!

crossback7

2007-06-23 14:42:27

Nice Tut. It was very helpful.

kryptonite

2007-07-22 21:06:32

Thanks Alot! Helped me get started

passiondrive

2007-08-01 14:04:22

Good tut, helped me when I struggled.

mumu720

2007-08-02 01:55:54

helped alot but i used it and i think repeat is messing it up because when i try starting the script it says '.' is expected after the end so it never gts to the report any suggestions

Skalla

2007-08-05 07:59:25

Nice tutorial,

was wondering, I'm making a Autotyper, and i want to have a progress report on that to kinda :bart: but i want it to say "Messages sent: *number*" how do i make that?

:bart: ~~Skalla~~

EDIT: Nvm, Got it, just that time shows 275 hours instead of 0 hours :bart:

HardRockers

2011-12-29 21:41:58

Hey I am having trouble getting the Exp/Hr to compile.

procedure ProgressReport;
Var
ExpPHr:Integer;
begin
Exp := 35;
ExpPHr := ((Count*exp)/TimeRunning);
ClearDebug;
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn('~~~~~~~~~~~~~ HardRockin Iron Miner ~~~~~~~~~~~~~~');
WriteLn('Time Running: '+ TimeRunning);
WriteLn('Mining EXP: '+ FloatToStr(Count * Exp) + ' ');
WriteLn('Iron Ore Mined : ' +ToStr(Count)+ ' ');
WriteLn('Mining EXP/HR : ' +ToStr(ExpPHr)+ ' ');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
WriteLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
FindNormalRandoms;
end;