• Welcome to Jose's Read Only Forum 2023.
 

Get Ready for the next SPR Update Q3/21

Started by Theo Gottwald, July 28, 2021, 06:02:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

For the next Update the SPR has been lifted to a new Dimension of visual Automations.
Sounds like Advertizing?

With this new version the Robot can find any Pattern on Screen within a Part of a second.
So you will need to Locate the Top-Window of the target Application just as before.
But no need to find out "How to get to that GUI-Element" as it was in the Past sometimes.

How do you do it?
You can take the "Human-Eye-Recorder-Tool" and Record the Target as a "Pattern".
A Pattern generally is a small Picture of a Button or Text-Element or WHATEVER.
Its somehow a Picture.

Now using the new Pattern-Commands the Robot can search this Pattern and locate it, click there or do whatever at this Place or nearby.
He can also check if there are several such Patterns - or not.
For example you can find out if a Pattern is ...15 times on a WEB-Site or not.
This makes it easy to check WEB-Sites.

As a side-effect of the new Pattern-Engine the SPR get a lot of Image-Manipulation Commands.
Need to remove a watermark from an Image?
Maybe the SPR can now do it with a few commands.

There is a Sample Script in the help for this at the new ANA.Logic-Command:

' This Script is not intended for removing Copyright Artefacts
' yet i have nothing else at hand so i take such as an example
$$PAT=?path\Resized
$$FIA=$$PAT\BTC_1060.png

' We make a IR that is completely filled with the artefacts color
ANA.New|0|1060|1060
ANA.Fill|0|&H6f6d6e
ANA.Show|0!

' We load the Picture that contains the unwanted artefacts
ANA.Load|1|$$FIA
ANA.Show|1!

' We use the Logic Command to distribute the artefacts
ANA.Logic|2|1|0|A OR B
ANA.Show|2!

' Now we remove the artefacts using the "remove-color -with-Tolerance" Command.
ANA.rct|2|&H6f6d6f|10|0
ANA.rct|2|&H7f7d7f|10|0
ANA.Show|2!
ENR.


This is just one example what you can automatically do with images using the SPR.
Maybe "Remove Background" is also possible.

So what are the new commands?
There are many ANA.-Imageprocessing Commands. Currently some of them are not yet documented.
As you can see with the Script above they are a bit hard to use.
Lots of Parameters. I wanted to make this new thing very Simple.

So we got a Bunch of Dedicated "Pattern-Search Commands".
These are all Commands that you need, build your Script completely using the Pattern-Engine.

Very Simple Example, you record an "Image" or Pattern using the HE-Recorder and save it.
Now you can use the new
STW.<window>
LFP.<Image>
MLI.


And have the Robot click on the Pattern.
Of course there are some Parameters that you can change.
But they are hidden from the User because most often you may not need to change them - they are automatic.
If you want to change them, the 2 new commands:
SFP.<Parameter>|<Value>
GFP.<Parameter>

are used for that.

To keep it simple, The LFP.-Command has just 3 Parameters.
' P1 - Patternfile
' P2 - Coordinate-Shift (Move the target Point by these Cordinates)
' Variable for Result
LFP.<Patternfile>|-10,70|

and the later 2 Parameters are optional.

So a complete Script could be:

STW.
LFP.
MLC.


And we stay with this easy doing also with the other new Pattern-Commands.
They are:

' IF - you can make a decision base on the fact ifa Patern is found or not.
IFP. - / NFP - If Pattern Found [ELS. ... EIF.]

' Directly Jump to a Label if a Pattern is found or Not
JFP. / JNP. - Jump If Pattern

' Wait for a Pattern to appear or dissappear
WFP. - Wait For Pattern

And we have one new Command that is a part of the "SELECT CASE ... END SELECT" Construct.
Its used if you have multiple Patterns that may appear and you want to react on that.

So the new Command is
CFP. - Case Find Pattern


Its used in Combination with the SCS.-Command like this

STW.Act|TFrmHelp|- Help
$$PA1=?pattern\Tabelle.bmp
$$PA2=?pattern\SCS02.bmp
' Select Case Construct
SCS.1
' Here comes the first Pattern
CFP.$$PA1
  MBX.PA1
' Here comes the second Pattern, number is not limited so you can react on an unlimited Number of Patterns
CFP.$$PA2
  MBX.PA2
CAE.
  PRT.None of the Patterns was found
ESC.
MBX.OK
ENR.


And because i assume that in many such cases you wouldwant to Jump again to the SCS: if nothing was found,
we have a new Replacement for the ESC. (END SELECT) also: ESL.
Which means "End Select Loop".


STW.Act|TFrmHelp|- Help
$$PA1=?pattern\Tabelle.bmp
$$PA2=?pattern\SCS02.bmp
' Select Case Construct
SCS.1
' Here comes the first Pattern
CFP.$$PA1
  MBX.PA1
' Here comes the second Pattern, number is not limited so you can react on an unlimited Number of Patterns
CFP.$$PA2
  MBX.PA2
ESL.
MBX.OK
ENR.


So in this case the Script will Loop between the SCS. and the ESL. until one of the Patterns was found.
Thats in short the News for the next Update.

Let me add that this way the SPR can now work in any Browser or GUI without having any sort of AddON
it will just do what a human user would do - it will search the Pattern, recognize the Pattern and click whatever.

Then there are other Improvements. The HE-Recorder got a "Distance Tool" for Recording, to avoid Mouse-Over Effects.
And much more.