SRL Archive - OSR Help

Beginner WC Script Help


Bizketben

2013-06-24 18:23:26

Hi Guys,

I'm trying to write a line in my script to avoid spam clicking the tree when my character is already chopping the logs.

As such, I've written this line after my chop procedure:

Until not IsUpText('eak') or (InvFull);

Sometimes the uptext will read "eak" however my guy won't be chopping so it just sits there till AFK logout. I was wondering how I would go about adding an "or 20000" or something so that there is a time fallback incase an error happens. I tried this:

Until not IsUpText('eak') or (InvFull) or Wait(20000);

However it does not work.

If anyone could assist that would be greatly appreciated.

Thanks!

The Mayor

2013-06-24 18:33:50

From: Bizketben


If anyone could assist that would be greatly appreciated.

Thanks!


You would need something like a TimeFromMark for that, not a wait.


procedure whatever;
var
t: Integer;

begin
MarkTime(t)
repeat
wait(100) //or what ever you have here
until not IsUpText('eak') or InvFull or (TimeFromMark(t) > 20000)
end;

Bizketben

2013-06-24 18:44:58

From: The Mayor
You would need something like a TimeFromMark for that, not a wait.


Thanks for the fast response!

So I did this:

procedure ChopTree;
var x, y, t: integer;
begin
MarkTime(t)
repeat
if FindObj(x, y, 'own', 7382981, 10) then
begin
Mouse(x, y, 2, 2, true);
ChooseOption('hop');
wait(randomrange (7000, 9000));
end;
repeat
Until not IsUpText('eak') or (InvFull) or (TimeFromMark(t) > 20000);
Until(InvFull);
end;

Testing now, I will let you know if it doesn't work!

Thanks for your help :)

The Mayor

2013-06-24 18:48:24

From: Bizketben
Thanks for the fast response!

So I did this:

procedure ChopTree;
var x, y, t: integer;
begin
MarkTime(t)
repeat
if FindObj(x, y, 'own', 7382981, 10) then
begin
Mouse(x, y, 2, 2, true);
ChooseOption('hop');
wait(randomrange (7000, 9000));
end;
repeat
Until not IsUpText('eak') or (InvFull) or (TimeFromMark(t) > 20000);
Until(InvFull);
end;

Testing now, I will let you know if it doesn't work!

Thanks for your help :)



Actually I see this is for teaks. I helped another member make a Teak chopper for OSR once. It's hard to tell when your character is chopping because your character doesn't move (or something like that, I've never cut teaks before :p). If the inventory count doesn't increase within 10 seconds, it clicks the tree again.


procedure Chop;

begin
i := InvCount + 1;

if FindObj(x, y, 'own', 7382981, 35) then
begin
Case random(1) of
0: Mouse(x, y, 5, 5, true);

1: begin
Mouse(x, y, 5, 5, false);
ChooseOption('Chop');
end;
end;
end;
end;

begin // This is like your main loop
repeat
If Not WaitInvCount(I, 10000, ExactCT) then
Begin
WriteLn('No logs for 10s, clicking tree again');
Chop;
End;
until(InvFull);
end.

Bizketben

2013-06-24 19:10:59

From: The Mayor
Actually I see this is for teaks. I helped another member make a Teak chopper for OSR once. It's hard to tell when your character is chopping because your character doesn't move (or something like that, I've never cut teaks before :p). If the inventory count doesn't increase within 10 seconds, it clicks the tree again.


Sweet - I sent you a PM. Your method works with the MarkTime suggestion you made above, getting an error when I try what you just posted, sent you a PM.

Thnx