Jump to content

Number detection on the screen


Recommended Posts

Hello friends.

What I want to do. I want it to detect numbers in the x y coordinate in a certain part of the screen. The numbers are constantly changing, and I want them to keep them in memory. How can I make it perceive these numbers? For example, where the autoit forum logo is, there are numbers and it is constantly changing.,,

 

This number will appear constantly on the panel. Example https://www.autoitscript.com/forum/topic/112865-solved-create-panel-control/ such a panel.

Link to post
Share on other sites
  • Moderators

serkan,

Welcome to the AutoIt forums.

From what kind of application are you trying to read these numbers? Does the AutoIt Window Info tool offer any indications of the type of control which holds them? Perhaps a screenshot of the app would help.

Please help us to help you.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

Here's one way to do it without using a browser --

#include <InetConstants.au3>
#include <StringConstants.au3>
#include <Array.au3>

Local $sHTML = BinaryToString(InetRead("https://covid19asi.saglik.gov.tr/", $INET_FORCERELOAD))
Local $aMatch = StringRegExp($sHTML, "(?:var asiyapilankisisayisi = )(.*);", $STR_REGEXPARRAYMATCH)
_ArrayDisplay($aMatch)

 

Link to post
Share on other sites
28 minutes ago, Danp2 said:

Here's one way to do it without using a browser --

#include <InetConstants.au3>
#include <StringConstants.au3>
#include <Array.au3>

Local $sHTML = BinaryToString(InetRead("https://covid19asi.saglik.gov.tr/", $INET_FORCERELOAD))
Local $aMatch = StringRegExp($sHTML, "(?:var asiyapilankisisayisi = )(.*);", $STR_REGEXPARRAYMATCH)
_ArrayDisplay($aMatch)

 

I'm asking to find out how did you get this value?image.thumb.png.c2358576433e7eb235fc37882e37ae5e.png

Link to post
Share on other sites
  • Moderators

serkan,

Quote

But my goal is to learn

What a pleasure to hear you say that!

M23

30k

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
18 minutes ago, Danp2 said:

If you want to learn how to grab this data from the browser, then suggest that you check out the Webdriver UDF (see my signature)

Congrats! 🚀🎉🥳🎆

I'm sorry but I didn't understand much. 😮

Link to post
Share on other sites

@serkan, Simple explaination of Danp2's script:

#include <InetConstants.au3>
#include <StringConstants.au3>
#include <Array.au3>

Local $sHTML = BinaryToString(InetRead("https://covid19asi.saglik.gov.tr/", $INET_FORCERELOAD)) ;Grab the websites HTML and put it all inside of a string variable
Local $aMatch = StringRegExp($sHTML, "(?:var asiyapilankisisayisi = )(.*);", $STR_REGEXPARRAYMATCH) ;Using RegEx patterns, search through the string and grab the number you need
_ArrayDisplay($aMatch)

Now if you don't want to learn RegEx (I can't even comprehend how insane some of them are), Danp2 suggest you use his Webdriver UDF (User Defined Function) in his signature. It is a super useful and simple tool to navigate and/or grab information from Chrome or Edge browser.

If you want to learn and not just get, click the links in @Danp2's signature and read up. 😃 👍

Link to post
Share on other sites

As one of the best beginner here 😛

I think I could provide some help here.

to understand what does a function, or some lines. You could always try to figure out the result in most of the cases that is called the « return ».

for exemple you could use here consolewrite to check. That will help you a lot to understand what you do. When. Where.

All that are related to debuging. Try.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...