Help svp

Vous voulez de l'aide ? Postez ici :)
Post Reply
macmantis
Posts: 5
Joined: 02 Sep 2021, 17:38

Help svp

Post by macmantis »

Bonjour, j'aimerais savoir si c'est possible de programmer actiona pour faire une action de touche "entré" sur un changement de variable sur un élément de page web console?
Exemple si le numéro "0" est remplacer par un "1" ou "2" ou 3" voir plus
Web console.jpg
Web console.jpg (130.55 KiB) Viewed 1744 times
francois
Posts: 456
Joined: 18 Oct 2010, 10:33
Location: France

Re: Help svp

Post by francois »

Bonjour,

Actiona ne va pas modifier la page HTML.

Par contre, avec Actiona, via l'action 'Trouver Image', on peut - dans votre cas - détecter "0"
Puis avec l'action 'touche', provoquer l'appui sur '1' par exemple
macmantis
Posts: 5
Joined: 02 Sep 2021, 17:38

Re: Help svp

Post by macmantis »

La solution trouver une image peu marcher je pense.

Mais dans mon cas c'est de cibler l'endroit exact du "0" et que si il se transforme en "1" exemple que actiona reconnais le 1 pour valider une touche "enter" du clavier
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Help svp

Post by eureka »

From your explanation I would try this:

First capture two screenshots of the target window (maximised)
for state "0" and state "1".

Clip the two screenshots to only show the target field ("0" or "1").

Save these clips at image1.jpg and image2.jpg

Now in Actiona GUI use the Find Image object twice in succession to search for image1.jpg ([ 0 ]) and image2.jpg ([ 1 ])

If image1.jpg is found (state 0) then exit the script and return later to check. You can use a delay to restart the scan .. or .. if you are in Linux create a cronjob to relaunch Actiona script. This depends on how frequently you want to test the window state.

If image1.jpg is not found proceed to test for image2.jpg ("1" state").

If that is found jump to Key object to hit Enter.

...

There are other methods to try which do not use images, but give this a shot first.

You can also locate the exact position of the field by Move Cursor object provided that the window is always maximised, to ensure an x,y reference.
macmantis
Posts: 5
Joined: 02 Sep 2021, 17:38

Re: Help svp

Post by macmantis »

Merci Eureka pour la réponse mais j'aimerais trouver une solution sur une position de l'écran ou sur la fenêtre de discord comme cela je peux laissé discord sur l'écran côté gauche et regarde un stream sur le côté droit sans cela soit gênant.
ecran.jpg
ecran.jpg (656.12 KiB) Viewed 1697 times
Voila mon écran, la case rouge c'est la position que je vise et j'aimerais que lorsque il y a un "1" à la place du "0" que actiona ta juste "enter"

donc mon idée est de faire reconnaitre a actiona que dans ce petit carré que si le 1 apparaît il tape la commande suivante.

Maintenant je sais pas du tout comment faire pour faire connaître une position d'un petit carré et uniquement dans ce carré à actiona d'une image cible sur écran et comment le codé avec un script.
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Help svp

Post by eureka »

I can now see that you are in Windows.

21 JumpClick? https://21jumpclick.fr/

Now it would simplify your task greatly (dispensing with matching screen images) if you can find in Windows the path to the file where your variables are saved (0, 1 etc). There must be a hidden config file somewhere for your app and its console. At least that is where I would start.

Then it should be a matter of parsing that file to look for changes in the element / property.

...

If you must use image matching then open Actiona GUI.

Double click on Find Image which is where you configure the object to .. find your target image (in the red box you show).

In that "Edit action" setup you see a link to the left of Cancel |OK buttons.

Click on that to open the Wiki page which helps.

It is here ...

https://wiki.actiona.tools/doku.php?id= ... nfindimage
macmantis
Posts: 5
Joined: 02 Sep 2021, 17:38

Re: Help svp

Post by macmantis »

Merci encore Eureka, mais le problème c'est que c'est un serveur discord donc je ne peux pas avoir c'est info de variable. Hors si je colle un bot au serveur discord et de la me faire ban pour request sur le serveur. Ou sur une page web discord mais le problème reste le même car trop de requête pour connaître la variable si elle a changé je risque le ban ip.

C'est pour cela que je veux tenter de le faire par image, et ta première idée avec les 2 images je pense qui est mieux.
Mais malheureusement il me faudrait un script pour que actiona compare les 2 images et la position exact du 0 sur mon écran
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Help svp

Post by eureka »

I read your first post which shows code and assumed that you had access to this.
How/where did you retrieve this flex code from Discord server?
<div class="EmbedFieldValue-nEqts">0</div> .... ???

If you can see this then surely you can extract value from image.

Better that you write the script using earlier suggestions of image1 and image2.

I have not used Windows recently but you can research how to take screen snapshots cut down to area of field.
In Ubuntu I would use Snapshot but you might use Windows Snipping Tool.

https://support.microsoft.com/en-us/win ... 299b865f6b

Then just follow the Actiona Wiki Help for two tests ..
image1 and image2

Best way of learning rather from your own tests than expecting a custom script.
macmantis
Posts: 5
Joined: 02 Sep 2021, 17:38

Re: Help svp

Post by macmantis »

Sur le premier message c'était la console web de chrome.

Je viens de regarder avec snipping tool le problème c'est de trouver les cordonnées x et y du carré sur l'écran pour pouvoir trouver l'image

Après je sais pas si actiona avec l'option "image où chercher" a les cordonnée de mon écran
Capture.PNG
Capture.PNG (25.53 KiB) Viewed 1668 times
Après j'y connais rien en script ou code, j'ai regardé sur le site mais y a trop d'information et je m'y perd la tête dans ça !!
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Help svp

Post by eureka »

The mistake you mave made is to search an image rather than search a window.

Go to your Discord console in browser.

Start with field set to “0”.

To invoke Windows Clipping Tool hit three keys ..

[Windows]+[Shift]+[S]

After some seconds the screen dims (showing that Clipping Tool is running)
and then use cursor cross hairs to select a rectagular clip containing the [0] field (your "red box")

A few seconds later a message notification pops up in Windows bottom taskbar.
Launch the app to save the clip into a location to be accessed by your Actiona script.

Repeat this process with the field set to [1].

You now have two clips.

Now you need to create an Actiona script which targets the Discord console and you can test if field [0] or field [1] is found. Two actions will be needed (one for each clip).


We choose the Find Image object (find image on the screen, on a window, or on another image).

You need to find on a window and not an image.

Read this again:

https://wiki.actiona.tools/doku.php?id= ... nfindimage

You require to search for an image (your [0] or [1] field) within a window, not within an image.

thus your settings are:

Standard tab:

Input Parameters:

Source: Window

Window name: select the window of Discord console

Image to search in: (disabled)

Image to find: the clip you created.

=============================
Tip:

You can embed images (clips) in an Actiona script.
Look at Toolbar > Script > Resources and include your clip image(s).
This avoids defining a filepath to the image. Simply name the image to find.
0.jpg

=============================

You can run tests in sequence (pause between each Find Image test):

Find image [0]
Find image [1]

and take actions accordingly.

=============================

Another tip:

Clear the clutter on your desktop.
You can switch between virtual workspaces.
Separate windows can be in separate virtual workspaces.
Then use keys to toggle between them.
Not strictly necessary but can streamline your workflow.


Use Deepl.com to translate English <--> French.
Post Reply