SRL Archive - Help and Support

Progress Report Help


Ejjman

2006-04-26 22:32:16

Can anyone help me with a progress report?! I just want a simple one that says 'You've mined X ores!' Can any1 help me? Here is my current code, and it works great.

//Walk here by Ejjman1
//Runs over and clicks on a copper rock to mine.
{Version 1-Put character next to rock LOL.
Version 2-Moved mouse to rock.
Version 3-Added SRL
Version 4-Started using FindColorSpirals
Version 5-Successfully got 1 Copper Ore
Version 6-Successful to get a full load}

program New;
{.include SRL\SRL.scar}

procedure coppermine;
begin
SetupSRL;
If(FindColorSpiral(x,y,607076,255,222,273,238))or
(FindColorSpiral(x,y,607076,255,222,273,238))then
MMouse(x,y,2,2)
wait(1000);
ClickMouse(x,y,True)
wait(4000+random(10000));
end;

begin
repeat
coppermine;
until(false);
end.

Pwnd

2006-04-26 23:03:13

Add a variable in there (Call it counter or something.)

And every time you mine a rock put counter:= counter + 1;

And then for your progress report do:

WriteLn('You'#39've mined ' + counter);

phantombmx

2006-04-26 23:11:59

Pwnd.. may i ask why that #39 is in there for? you just need
WriteLn('You''ve mined ' +counter);

there is 2 apostrophes make a single apostrophe on scar.. so
WriteLn('''')
would result in '

WhiteShadow

2006-04-26 23:26:22

//Walk here by Ejjman1
//Runs over and clicks on a copper rock to mine.
{Version 1-Put character next to rock LOL.
Version 2-Moved mouse to rock.
Version 3-Added SRL
Version 4-Started using FindColorSpirals
Version 5-Successfully got 1 Copper Ore
Version 6-Successful to get a full load}

program New;
{.include SRL\SRL.scar}

var
Mined : Integer;

procedure CopperMine;
begin
SetupSRL;
if(FindColorSpiral(x, y, 607076, 255, 222, 273, 238))or
(FindColorSpiral(x, y, 607076, 255, 222, 273, 238))and//and if that text is up
(IsUpText('Mine'))then
begin
MMouse(x, y, 2, 2)
Wait(1000);
Mouse(x, y, 1, 1, true);//ClickMouse is detectable, changed it to mouse
Wait(4000 + random(10000));
Mined:= Mined + 1//When you mine an ore it adds one to this variable
end;
end;

begin
repeat
CopperMine;
Writeln('Mined : '+ IntToStr(Mined))//Write's in debug (Mined)
until(false);
end.

Modded with a simple report.
I added //comments

Btw, good job so far. XD

driger1592

2006-04-26 23:28:01

And if counter is an integer (as that's the easiest variable to work with) you have to do
Writeln('You''ve mined '+IntToStr(counter));
IntToStr changes Counter to a string temporarily (basically) so that Writeln can use it. I'll have a progress report tutorial (though it is quite small) out, hopefully either in May or June. Don't hold your breath though.

Ejjman

2006-04-26 23:32:58

OK, thanks guys, you are great! I am gonna start working with making it drop the ore…