SRL Archive - Reflection Help

Procedure not working


guyver

2009-05-22 17:09:34

Hi all, Just wondering if anyone could help with the following procedure. For some reason the repeat ends even though the condition is not met. ie the condition is the FindNpcChatText. Any ideas please?


procedure ClayWait;
var
counter1: Integer;
begin
if(not(LoggedIn)) then Exit;
MarkTime(counter1);
writeln('Start to wait for the clay');
repeat
Wait(500);
if(TimeFromMark(counter1) > 15000) then
begin
WalkAwayandBack;
MarkTime(counter1);
end;
until(FindNpcChatText('Demon butler', nothing));
CheckForAllRandoms;
if(PayServant) then
begin
Writeln('Paid the servant! Need to Find Servant again');
FindServant;
end;
MarkTime(counter1);
repeat
Wait(500);
until(GotClay) or (TimeFromMark(counter1) > 60000);
if(not(GotClay)) then
begin
WalkAwayandBack;
ClayWait;
end;
end;

Thanks for any help.:)

Naum

2009-05-22 17:14:30

What does it input in the DebugBox before it stops ?

footballjds

2009-05-22 17:18:18

whole script please? its easier to help with an entire script ;)

guyver

2009-05-22 17:19:03

Sorry probably didn't make it clear but I mean that it doesn't sit and wait for the time to elapse or for the chat text to appear. Sometimes it just thinks the servant is talking to me when it isn't. Could this be a Reflection problem? Or is it just the way I wrote the procedure?

I don't want to post whole script just yet…Work in progress

footballjds

2009-05-22 17:20:22

can u post up the script?
its easier to find bugs if we see the whole thing :p

Naum

2009-05-22 17:24:39

Maybe because it will exit after 15 secs?
Try changing the timemark to 60000

guyver

2009-05-22 17:30:48

Ummm I may regret this but ok here is the whole script.

SCRIPT REMOVED

I guess you can make other comment as well if you wish.

Still looking for any help please with the clay wait procedure. See full post for details.

bugger0001

2009-05-24 19:34:00

What does the WalkAwayandBack do? I can't see anything else breaking the loop…

guyver

2009-05-25 04:53:04

The WalkAwayandBack procedure justs moves position two tiles west and one north then waits a bit then returns to the original starting spot. Like I said this procedure has got me stumped. Sometines it waits until the chat screen pops up and other times (prob 10% of the time) it doesn't.

Still working on it. May have to change how I do this I guess.