SRL Archive - OSR Help

Progress Report Help


Gushers

2011-12-19 02:34:37

This is some of the code for my Tea Stealer, when it runs it calculates the exp but after it finishs the script when it repeats it restarts the exp. Probally because I'm using PlusOne on the Inv. I have it to where it cleardebug so that it doesn't build up progress reports like crazy. Each time you steal a tea you get 16 exp, how do I get it to calculate the tea steals with the exp while still being able to cleardebug, is it even possible? Help please?
Procedure Report;
Var
PlusOne: Integer;
Exp: Extended;
begin
ClearDebug;
Exp := 16;
PlusOne:= InvCount +1;
WriteLn('==================================================');
WriteLn('============ Tea Stealer - By Gushers ============');
WriteLn('Time Running: '+ TimeRunning);
WriteLn('Thieving EXP: '+ FloatToStr(PlusOne * Exp));
WriteLn('======== EXP Counter Resets Help Fix It? =========');
WriteLn('==================================================');
end;

begin
SetupLogin;
SetupSRL;
DeclarePlayers;
ActivateClient;
repeat
Report;
StealTea;
If InvFull Then
DropTea;
until(false);
end.

YoHoJo

2011-12-19 02:36:20

So wait wait?
So one problem or two?
To clear debug just call ClearDebug; :p!

Anything else wrong?

Gushers

2011-12-19 02:44:12

From: YoHoJo
So wait wait?
So one problem or two?
To clear debug just call ClearDebug; :p!

Anything else wrong?


It debugs so that it doesn't stack up on progress reports, but when the script finishes the exp just restarts.. I want it to ClearDebug so that it doesn't stack up on progress reports while having the exp not restart every time the script repeats.

YoHoJo

2011-12-19 02:48:28

First off, why do you add 1 to invcount?
Second you need a global variable, let's call it TotalTea.
(Global means at top of script, before all procedures do
var
TotalTea:Integer;)

Now before each drop/bank/whatever you do before getting rid of inventory do.
IncEx(TotalTea, InvCount);

Which will increase the integer TotalTea by however many things are in your inventory.

Get it?

Hero

2011-12-19 02:50:32


var
Count:Integer;
Exp: Extended;
Put the Above Variables right under {$i DEFINE} etc or your consts.


procedure Report;

begin
Exp := 16;
ClearDebug;
WriteLn('==================================================');
WriteLn('============ Tea Stealer - By Gushers ============');
WriteLn('Time Running: '+ TimeRunning);
WriteLn('Thieving EXP: '+ FloatToStr(Count * Exp) + ' ');
WriteLn('Tea cups stolen : ' +ToStr(Count)+ ' ');
WriteLn('=========================================');
WriteLn('==================================================');
FindNormalRandoms;
end;


IncEx(Count, 1);
Throw the line above right under the click that clicks steal from the tea stall.

Don't forget to put
Report;
in your MAIN loop under the whole theft process.


Edit:Posted too late and now out of order topic lol

Gushers

2011-12-19 02:51:42

From: YoHoJo
First off, why do you add 1 to invcount?
Second you need a global variable, let's call it TotalTea.
(Global means at top of script, before all procedures do
var
TotalTea:Integer;)

Now before each drop/bank/whatever you do before getting rid of inventory do.
IncEx(TotalTea, InvCount);

Which will increase the integer TotalTea by however many things are in your inventory.

Get it?


Yeah I get you mean man, thanks!
I have PlusOne because as it adds one to the inv it multiplies it by 16(the exp).. But once their all dropped (I drop them) it restarts..

Hero

2011-12-19 02:55:27

From: Gushers
Yeah I get you mean man, thanks!
I have PlusOne because as it adds one to the inv it multiplies it by 16(the exp).. But once their all dropped (I drop them) it restarts..



Look at the procedure I posted. I use the set up with my powerminer. Just but the IncEx line after your drop process and change 1 to how many every equals a full inventory.

Gushers

2011-12-19 03:03:46

From: MrDerp
Look at the procedure I posted. I use the set up with my powerminer. Just but the IncEx line after your drop process and change 1 to how many every equals a full inventory.


Wow thanks man! Here's my steal and drop stuffs (YoHoJo helped me with this from his tutorials) Tell me where I should put the:
IncEx(Count, 1); and should I changed the 1 to a 28 because it drops 28 or keep it at 1?
Function StealTea:Boolean;
Var
X, Y, PlusOne, TreeCounter: Integer;
begin
SetAngle(true);
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
If FindObj(x,y,'Ste',13821939,5) then
begin
StatsGuise('Hooray, We Stole');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(X, Y, 5, 5, True);
1: begin
Mouse(X, Y, 5, 5, False);
WaitOption('Ste', 500);
end;
end;

Flag;
MarkTime(TreeCounter);
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Steal');

repeat
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Steal');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting');
Antiban;
Wait(5000);
until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 5000)
end;
end;

Procedure DropTea;
Var
X, Y, TeaDTM, I:Integer;
SlotBox:TBox;
TeaPattern:TIntegerArray;

begin
MarkTime(TooLong);
TeaDTM := DTMFromString('mbQAAAHicY2VgYIhkZmCIBuJcIM4H4mwgjmFkYCiE4nQgjgBiBgYmLBgTMGLBYAAAZNAEIQ==');
TeaPattern:=[1,5,9,13,17,21,25,2,6,10,14,18,22,26,3,7,11,15,19,23,27,4,8,12,16,20,24,28]

For I:=0 To 27 Do
begin
FindNormalRandoms;
StatsGuise('Dropping Tea:' + IntToStr(I));
SlotBox:=InvBox(TeaPattern[I]);
If FindDTM(TeaDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2,SlotBox.Y2) Then
begin
MouseItem(TeaPattern[I],False);
ChooseOption('Dro');
end;
end;
MarkTime(TooLong);
end;

Hero

2011-12-19 03:19:42


If FindDTM(TeaDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2,SlotBox.Y2) Then
begin
MouseItem(TeaPattern[I],False);
ChooseOption('Dro');
IncEx(Count, 1);//Will count every single 1 that is dropped.

This is assuming you did what I said prior. It should work if the drop cycle is looped by the DTM being found 28 times. It might be slower but you could instead just use


DropAll;
IncEx(Count, 28);

Gushers

2011-12-19 04:20:41

From: MrDerp

If FindDTM(TeaDTM,x,y,SlotBox.X1,SlotBox.Y1, SlotBox.X2,SlotBox.Y2) Then
begin
MouseItem(TeaPattern[I],False);
ChooseOption('Dro');
IncEx(Count, 1);//Will count every single 1 that is dropped.

This is assuming you did what I said prior. It should work if the drop cycle is looped by the DTM being found 28 times. It might be slower but you could instead just use


DropAll;
IncEx(Count, 28);


Wow, Thanks man! I got the progress report working perfectly.
But the only bug is that it takes like 15 seconds to steal one tea once it's there vs. 3 seconds now that I've changed it up..
Think if I post my script you could help me out?

Hero

2011-12-19 04:31:12

You mean it tries to steal tea every 3 seconds instead of 15? What change did you do to cause this? Try running it with the dropall; and with its prior script piece.

Gushers

2011-12-19 05:02:52

From: MrDerp
You mean it tries to steal tea every 3 seconds instead of 15? What change did you do to cause this? Try running it with the dropall; and with its prior script piece.


It used to wait till the tea popped up in the stall and than click them 3 seconds after they were there, now it takes 13 seconds or so.
I think its the FailSafe or something because it says 'Antiban and Waiting' while its just sitting there.. Than after 13 seconds or so it steals (Ill put a // next to where I think its happening.
Procedure Antiban;
begin
Case Random(250) Of
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('thieving', False) GameTab(28) End;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); End;
end;
end;

Procedure FailSafe(Reason:String);
begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
Writeln(Reason);
TerminateScript;
end;

Function StealTea:Boolean;
Var
X, Y, PlusOne, TreeCounter: Integer;
begin
SetAngle(true);
MarkTime(TooLong);
FindNormalRandoms;
PlusOne:= InvCount +1;
IncEx(Count, 1);
If FindObj(x,y,'Ste',13821939,5) then
begin
StatsGuise('Hooray, We Stole');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(X, Y, 5, 5, True);
1: begin
Mouse(X, Y, 5, 5, False);
WaitOption('Ste', 500);
end;
end;

Flag;
MarkTime(TreeCounter);
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Steal');

repeat
If (TimeFromMark(TooLong) > 30000) Then
FailSafe('Could Not Steal');
FindNormalRandoms;
StatsGuise('AntiBan and Waiting'); // RIGHT HERE I BELIEVE.
Antiban;
Wait(1000);
until (InvCount=PlusOne) Or (TimeFromMark(TreeCounter) > 5000)
end;
end;