SRL Archive - OSR Help

Taking Break Help


Ian

2013-01-19 18:55:42

I'm trying to add break-taking into my script, but the problem that I'm having is that whenever it's time for a break it doesn't break.

My break procedure:
procedure Breaker;
var
BreakingTime:Integer;
begin
if (Loads > (LoadsBeforeBreak + (RandomRange(-(LoadsBeforeBreak / 10), LoadsBeforeBreak / 10)))) or (TimeSinceBreak > (HoursBeforeBreak + (RandomRange(-(HoursBeforeBreak / 10), HoursBeforeBreak / 10))) * (3600000)) then
begin
MarkTime(BreakingTime);
Status := 'Breaking';
Proggy;
ExitToLobby;
repeat
wait(RandomRange(1000, 10000))
until((TimeFromMark(BreakingTime) > ( BreakTime + (RandomRange(-(BreakTime / 10), BreakTime / 10)))));
LoginPlayer;
end;
end;

My constants:
LoadsBeforeBreak = 1; //About how any loads to do before taking a break?

HoursBeforeBreak = 4; //About how many hours to run before taking a break?

BreakTime = 1; //About how many minutes to break for?

The part of my mainloop with breaking:
MineOre;
DropOre;
Breaker;
Proggy;
DropGems;

Sorry if it's a bit hard to tell what's going on, but I'll try to explain more if needed.

It ran for a few hours and 24 loads without taking a break, so I don't know what's up.

Le Jingle

2013-01-19 19:12:55

Have you considered the breaking mehtod Echo_ (I think) made a while back? I'm pretty sure it's a good breaker, nonetheless it can show you what needs to be done to break during a script (iirc Flight uses this and Asha uses this, or at least somethign like it)

As for the code you posted, I would have it be based off of a time const/counter, as I think it may be more definite than after x-loads.

-Lj

Ian

2013-01-19 19:38:00

From: Le Jingle
Have you considered the breaking mehtod Echo_ (I think) made a while back? I'm pretty sure it's a good breaker, nonetheless it can show you what needs to be done to break during a script (iirc Flight uses this and Asha uses this, or at least somethign like it)

As for the code you posted, I would have it be based off of a time const/counter, as I think it may be more definite than after x-loads.

-Lj


Thanks, I did look at Echo's method but I didn't want to use it because I thought it was too complicated.

As for mine, I had made it to go until it reached a certain amount of loads or a certain amount of time, whichever happened first.

Ashaman88

2013-01-19 19:46:46

Echo's might be complicated, but it is pretty easy to implement! You could even edit it a bit to put in loads as well

Echo_

2013-01-20 00:07:08

Jesus, people still use my breaker? I completely forgot I wrote that thing.

riwu

2013-01-20 02:52:06

Try posting the whole script? If the status didn't turn Breaking it probably has to do with the 2 conditions not being met.

What's Echo's breaker? I can't imagine how complicated a break system can be :p

Ian

2013-01-20 22:02:27

From: Echo_
Jesus, people still use my breaker? I completely forgot I wrote that thing.

Yeah, it's working like a charm :)
From: riwu
Try posting the whole script? If the status didn't turn Breaking it probably has to do with the 2 conditions not being met.

What's Echo's breaker? I can't imagine how complicated a break system can be :p


I know I probably should've posted the whole thing, I just thought there was a problem in my logic which had made it nt work. And I thought the conditions were met, but maybe not. And Echo's breaker :http://villavu.com/forum/showthread.php?t=62216

Olly

2013-01-21 00:02:17

From: Echo_
Jesus, people still use my breaker? I completely forgot I wrote that thing.


Loads do :p also im pretty sure Flight and Ashaman use them in near enough every script :p

Ashaman88

2013-01-21 07:49:42

From: Ollybest
Loads do :p also im pretty sure Flight and Ashaman use them in near enough every script :p


yep if it ain't broked, don't fix it!

Kyle Undefined

2013-01-21 16:01:06

From: Echo_
Jesus, people still use my breaker? I completely forgot I wrote that thing.


Haha yup, I use it in every script I wrote.