← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #220729]: Errors from beginner's script

 

Question #220729 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/220729

    Status: Answered => Open

Daniel Ford is still having a problem:
RaiMan,

Many thanks for your assistance, thanks to which I'm making progress
(but still not out of the woods!).

I replaced my script with yours, except that I guessed that 'img' was
meant to be 'button'.  But I missed the missing opening bracket on that
line - Sikuli-IDE picked it up though!

So with those corrections, your script works fine.  But I have problems
when executing it from my batch file...

As I mentioned earlier, the Sikuli/SurCode step is just one in a long
sequence of operations in my batch file, each operation depending on the
results of the previous one.  But using your suggested method (even
after fixing Sikuli-IDE-w.bat for Win2k) returns to the batch file
*before* SurCode is finished (it returns immediately after being called,
rather than waiting till the Sikuli script has finished).

In my previous 'executable' version I used:
-----
pushd "C:\Program Files\SurCodeCD_ProDTS"
start surcodedts.exe
call "D:\DOS\Batch\DTSreenc.skl"
popd
-----
to ensure that the batch file waited till the script had finished.  But 'call' doesn't work with your suggested command.

I tried further modifying Sikuli-IDE-w.bat by adding /WAIT before the
/B, but it still returned immediately and thus caused an error in my
subsequent batch operations.  Your suggested batch command works without
errors (starts SurCode encoding, and kills it when finished encoding),
but by returning to my batch file before completion, the subsequent step
fails from lack of an input file (Sarcode's output).

I'll keep playing round after brushing up my rusty DOS knowledge, but if
you can see a quick fix for this problem I'd appreciate any comments.

Regarding the poor documentation, I been to doc.sikuli.org recently, but
found no user manual for the IDE.  And the 'Complete Guide to Sikuli
Script' is still an awful HTML document rather than an easily printed
and read-offline PDF document.  Furthermore it lacks example code for
many of the functions, to make clear the usage syntax for those of us
who are not Java programmers.

That said, I have to say a big THANK YOU to you and the Sikuli team for
a fantastic product, and especially for making it freely available.  I
understand that you get no financial reward for writing and supporting
it, and I know that many programmers, sadly, don't have great
documentation skills.  But I still appreciate the work that's gone into
Sikuli, and I especially appreciate your continued support of the
product.

Regards,
Daniel
(Gerroa, Australia)


> -----Original Message-----
> From: bounces@xxxxxxxxxxxxx [mailto:bounces@xxxxxxxxxxxxx]On Behalf Of
> RaiMan
> Sent: Friday, 1 February 2013 7:46 PM
> To: dfnojunk@xxxxxxxxx
> Subject: Re: [Question #220729]: Errors from beginner's script
> 
> 
> Your question #220729 on Sikuli changed:
> https://answers.launchpad.net/sikuli/+question/220729
> 
>     Status: Open => Answered
> 
> RaiMan proposed the following answer:
> --1. forget Sikuli executables ...
> ... they are just zipped .sikuli, that cannot be reopened in the IDE.
> 
> --2. Regions identical:
> # a script version for Sikuli X
> reg = Region(274,509,100,36)
> button = Pattern("1359700184703.png").similar(0.91)
> reg.click(button)
> wait(1)
> reg.wait(img), 180)
> Region(726,181,47,38).click("L1.png")
> 
> the 2 regions you need might be calculated with respect to some 
> fixed visual object (e.g. logo, header):
> ref = find("some-ref-image.png")
> buttonReg = Region(ref.x+x1, ref.y+y1, 100, 36) # x1, y1 
> evaluate/measure somehow
> buttonReg.click(button)
> This would make it independent from the app window position at runtime.
> 
> BTW: inside() is no longer needed
> reg.xxx() : xxx is always inside the region
> 
> --3. running outside IDE
> supposing, you have a regular Sikuli and Java installation (look 
http://www.sikuli.org/download.html for the latest version and faq 2005), then you can run your script from command line using 

"%ProgramFiles%\Sikuli X\Sikuli-IDE-w.bat" -s -r path-to-your-
script.sikuli

Errors will now be displayed on command line.

I guess in your case, it is a FindFailed problem at runtime.

BTW: it might be worth to have a look through the new Sikuli X docs at:
doc.sikuli.org

-- 
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/sikuli/+question/220729/+confirm?answer_id=0

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/sikuli/+question/220729

You received this question notification because you asked the question.

You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.