SRL Archive - OSR Help

Help with some timing problems :S


tocxic1

2014-03-15 19:12:26

I'm trying to make a Tip Sender i really don't know why this isn't working please help me it keeps spamming the the Text1
Need some quick help please

repeat
MarkTime(TipTime);
repeat
if (TimeFromMark(TipTime) >= 2000) then
begin
TypeSendCustom(Text1);
Exit;
end;
if (TimeFromMark(TipTime) >= 4000) then
begin
TypeSendCustom(Text2);
wait(1000)

end;
if (TimeFromMark(TipTime) >= 6000) then
begin
TypeSendCustom(Text3);
wait(1000)

end;
if (TimeFromMark(TipTime) >= 8000) then
begin
TypeSendCustom(Text4);
wait(1000)
Exit;
end;
if (TimeFromMark(TipTime) >= 10000) then
begin
TypeSendCustom(Text5);
wait(1000)
Exit;
end;
until(TimeFromMark(TipTime) >= 10500)
until(false)

Frement

2014-03-15 19:16:18

You wait 15 seconds, and after that time, your loop is broken because TimeFromMark(TipTime) is greater then 10.5 seconds.

tocxic1

2014-03-15 19:18:07

i mean i added that wait just to test if i can make it type once any other problem?

Frement

2014-03-15 19:24:13

Remove the exits.

tocxic1

2014-03-15 19:27:39

Removed exits and wait isn't working .-.

repeat
MarkTime(TipTime);
repeat
if (TimeFromMark(TipTime) >= 480000) then
begin
TypeSendCustom(Text1);
end;
if (TimeFromMark(TipTime) >= 540000) then
begin
TypeSendCustom(Text2);
end;
if (TimeFromMark(TipTime) >= 800000) then
begin
TypeSendCustom(Text3);
end;
if (TimeFromMark(TipTime) >= 1200000) then
begin
TypeSendCustom(Text4);
end;
if (TimeFromMark(TipTime) >= 1500000) then
begin
TypeSendCustom(Text5);
end;
until(TimeFromMark(TipTime) >= 1500010)
until(false)

Olly

2014-03-15 19:34:39

Actually nvm, read it wrong.

Frement

2014-03-15 19:35:02

program new;
{$I SRL-OSR/SRL.Simba}

const
Text1 = 'Text1';
Text2 = 'Text2';
Text3 = 'Text3';
Text4 = 'Text4';
Text5 = 'Text5';

var
TipTime: Integer;

begin
repeat
MarkTime(TipTime);
repeat
if (TimeFromMark(TipTime) >= 1000) then
begin
Writeln(Text1);
Wait(1000);
end;
if (TimeFromMark(TipTime) >= 2000) then
begin
Writeln(Text2);
Wait(1000);
end;
if (TimeFromMark(TipTime) >= 3000) then
begin
Writeln(Text3);
Wait(1000);
end;
if (TimeFromMark(TipTime) >= 4000) then
begin
Writeln(Text4);
Wait(1000);
end;
if (TimeFromMark(TipTime) >= 5000) then
begin
Writeln(Text5);
Wait(1000);
end;
until(TimeFromMark(TipTime) >= 6000);
until(False);
end.