Originally Posted by
Sjoe
instead of If
use this:
Simba Code:
if WaitUptext('ard', 300) then
It could be that you're not giving simba enough time to read the uptext.
That's good advice. One of the methods I actively use for determining which part in a piece of code isn't working correctly is step-by-step printing to indicate exactly which stage as been reached. It's hard to explain so I'll use Justin's piece of code as an example.
Simba Code:
program DTMTest;
{$I SRL-OSR\SRL.simba}
var
WizardRobe, X, Y: Integer;
begin
SetupSRL;
WizardRobe := DTMFromString('mwQAAAHic42RgYHBigmBHIPYDYh8gNgdiMy C2AGJfIH4EVPcGiG8C8WMgfgfE74H4KRDfgWI+7wIgyYiCDRQU 0MQIA0YiMBwAAHhZC7o=');
if FindDTM(WizardRobe, X, Y, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('A'); // The DTM was found, moving on
MMouse(X, Y, 7, 7);
Writeln('B'); // Mouse was moved to the DTM's X/Y coordinate
if IsUpText('ard') then
begin
Writeln('C'); // Uptext was found
Mouse(X, X, 0, 0, true);
end;
end;
FreeDTM(WizardRobe);
end.
If Simba writes 'A' in the debug then we know the DTM-finding part was successful, if 'B' is written we know the mouse was successfully moved to that coordinate, and if 'C' was written then it's certain the UpText-finding was also successful. If any of these are not printed then we know exactly which part was unsuccessful. Actively debugging is essential when first making a procedure/function.
Edit:
Oh yeah, if UpText is your problem I suggest you take a look at Warpie's OCR Engine for a much more accurate way of reading UpText.