PDA

View Full Version : Making a Progress Report



WhiteShadow
04-28-2006, 06:28 AM
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....

Shows how long script has been running
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
10-20-2006, 11:54 AM
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
10-20-2006, 09:57 PM
This is good, I tried it, and it works. Thanks a lot. :)

da_professa
10-23-2006, 09:21 PM
I am gonna try that for my auto monk fighter...Soon to be in the free scripts section

JAD
02-21-2007, 10:09 PM
oh sweet dude! thanks, have been looking for a tut so i can learn to make proggies. thanks for making this.

3Garrett3
03-02-2007, 11:17 PM
thanks very much, good tut, helped me out alot

deathbyvirus
03-15-2007, 04:15 AM
good tut, fairly basic but gets to the point, * thumps up*

rkroxpunk
03-25-2007, 04:15 AM
err is there another TUT on how to create a bit more complicated one.......nice TUT btw easy to understand

Smartzkid
03-25-2007, 05:21 AM
Aha! So that's how you make the script say how long it has been running for!

:p Thanks

Johura
03-28-2007, 09:46 AM
Thanks
+rep

i am foolish
03-28-2007, 09:53 AM
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
05-02-2007, 05:10 PM
sweet.. tyvm for posting this

PwNZoRNooB
05-10-2007, 04:33 PM
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
05-10-2007, 11:25 PM
I usually just prefer using

i:= CountItemDTM(logdtm); .

NumberOfTreesChopped:= NumberOfTreesChopped + i;

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

Something like that.

kooldude
05-17-2007, 07:43 PM
Nice Tut, Used The Debug Progress report in my script, Till i get my own style of one. TY!

crossback7
06-23-2007, 06:42 PM
Nice Tut. It was very helpful.

kryptonite
07-23-2007, 01:06 AM
Thanks Alot! Helped me get started

passiondrive
08-01-2007, 06:04 PM
Good tut, helped me when I struggled.

mumu720
08-02-2007, 05:55 AM
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
08-05-2007, 11:59 AM
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
12-30-2011, 02:41 AM
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;