Jump to content
junichironakashima

RegExp Catch and Operator Question - (Moved)

Recommended Posts

Im creating a code that will work in this sequence:

1. Copy the text (question) in one atea of the screen

2. Catch the 2 strings (number)

3. Multiply the 2 strings ( $1*$2)

4. Click the next area to put the answer

5. Paste the answer

 

This is my code

 

MouseClick($MOUSE_CLICK_LEFT, 479, 802, 3, 1) ;Clicking all of the text

Send("^c") 

$x = StringRegExpReplace(ClipGet(), 'What is (\d*) x (\d*) \?$', "$1*$2")

MouseClick($MOUSE_CLICK_LEFT, 480, 844, 1, 1)

ClipPut($x)

Send("^v")

 

However the output is this

$1*$2

 

How can I make it solve itself? Because I tried this code:

MouseClick($MOUSE_CLICK_LEFT, 479, 802, 3, 1) ;Clicking all of the text

Send("^c")

MouseClick($MOUSE_CLICK_LEFT, 480, 844, 1, 1) $x = Execute(StringRegExpReplace(ClipGet(), 'What is (\d*) x (\d*) \?$', "$1*$2"))

ClipPut($x)

Send("^v")

Output is just blank text

Share this post


Link to post
Share on other sites

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team


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

 

Share this post


Link to post
Share on other sites

Is this for a captcha bypass?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

@junichironakashima Care to explain in detail what you are trying to accomplish? The more information you provide the better we can assist.

 

***In case you missed it, this is a Mod stepping into a thread (and for some around here lately who seem not to get the hint, that means stay out)***

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
On 8/2/2019 at 7:37 AM, junichironakashima said:

Im creating a code that will work in this sequence:

1. Copy the text (question) in one atea of the screen

2. Catch the 2 strings (number)

3. Multiply the 2 strings ( $1*$2)

4. Click the next area to put the answer

5. Paste the answer

How can I make it solve itself? 

 

I believe I made myself clear here.

Share this post


Link to post
Share on other sites

@junichironakashima,

You seriously reported that reply as being rude?  :idiot: 
Well let me tell you you ain't seen nothing yet, so you better explain without any further moaning what you are exactly doing and answer the questions raised this time!
so: What are you trying to automate with this script?

Jos

Share this post


Link to post
Share on other sites

Okay, let me try to explain it again. I want autoit to solve (multiply) the two string that I catched based on the code that I iniatilly posted, the problem is, the stdout not show the answer, it just show an "" empty string. I believe myncode is correct but If anyone can help me improve this to get what I really want to do.

Share this post


Link to post
Share on other sites

We understood as much, but "what is it for?" is what the question was which you still haven't answered.

Jos

Share this post


Link to post
Share on other sites

Its for my personal use and not on anything like jobs or getting paid in doing something. The situation is like this, i have a text file in the right hand of the screen that is consist of questions in a specific format l like this "What is 123 x 456 ?" Onlty the intergers are changing. So the stdin is the whole question and stdout when I paste it in the left side of the screen will be the product already. I have my code on the top. 

Share this post


Link to post
Share on other sites
On 8/3/2019 at 1:26 AM, JLogan3o13 said:

@junichironakashima Care to explain in detail what you are trying to accomplish? The more information you provide the better we can assist.

 

***In case you missed it, this is a Mod stepping into a thread (and for some around here lately who seem not to get the hint, that means stay out)***

@All, we requested to stay out so please refrain from posting in this thread....   Posts removed.

8 hours ago, junichironakashima said:

Its for my personal use and not on anything like jobs or getting paid in doing something.

I am sorry to see that you seem to be unwilling to come up with a plausible explanation, so this topic is closed.

Jos 

Edited by Jos

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Similar Content

    • By bylly
      Hello this is the code maybe you can figure it out I placed some comments to try and explain what I want
      #include <Array.au3> AnyDeskOpen() Func AnyDeskOpen() Global $aWinList = WinList("[REGEXPTITLE:(?i)(.*Anydesks*)]") ;get window name and handle from windows and store into an array $asd = $aWinList $aExtract = _ArrayExtract($asd) ; beginner babble clean this Sh** up Global $default = _ArrayToString($aExtract, "", 0, 0) EndFunc StartWait() ; check in the array to see how many windows are opened Func StartWait() While 1 AnyDeskOpen() If $Default = 1 Then Sleep (3500) Else Exitloop EndIf WEnd EndFunc If $default = "2" Then ; If two windows are opened than someone is trying to connect to that computer and needs a click to accept connection try and click accept Button in the first window and the second one by activating diffrent window handle $extra = _ArrayToString($aWinList, "", 1, 1) $sString = StringReplace($extra, "AnyDesk", "") $hGUI = $sString WinActivate(HWnd($hGUI)) winmove (HWnd($hGUI), "", 50, 50) Mouseclick ("left", 100, 500) Sleep (1500) $extra = _ArrayToString($aWinList, "", 2, 2) $sString = StringReplace($extra, "AnyDesk", "") $hGUI = $sString WinActivate(HWnd($hGUI)) winmove (HWnd($hGUI), "", 50, 50) Mouseclick ("left", 100, 500) EndIf While 1 ;up to here everything seems to work AnyDeskOpen() ; while there is a connection there are two AnyDesk windows, if we close the connection than only one window remains opened and we check the array to see how many values it has If $Default = 2 Then Sleep (3500) Else ; At this point the program exits code 0 instead of resseting to function above StartWait() Exitloop EndIf WEnd ; thank you  the intent is to keep the program going so it clicks accept again when reconnecting
    • By PeterVerbeek
      This topic give you access to an AutoIt functions library I maintain which is called PAL, Peter's AutoIt Library. The latest version 1.20 contains 197 functions divided into these topics:
      window, desktop and monitor mouse and GUI GUI controls including graphical buttons (jpg, png) logics and mathematics include constants string, xml string and file string dialogues and progress bars data lists: lists, stacks, shift registers and key maps (a.ka. dictionaries) miscellaneous: logging/debugging, process and system info Change log and files section  on the PAL website (SourceForge).
      A lot of these functions were created in the development of Peace, Peter's Equalizer APO Configuration Extension, which is a user interface for the system-wide audio driver called Equalizer APO.
    • By topgundcp
      Hi, 
      This is my very first post in this forum and am also new with Autoit programming so be easy on me.
      Below is the code that I am trying to get the index of the item selected. No problem getting the text.
      Case $listEdition   ; handle of the list             local $index=0             $item=GUICTRLRead($listEdition)    ; This will return the text in the list             ; ==============   The loop below always fails  ==================             ; Meaning _GUICtrlListView_GetItemSelected($listEdition, $i) always return FALSE. WHY ???????              For $i = 0 To $editionArray[0] - 1   ; The content of the list in an array where editionArray[0] contains total count of items                 If _GUICtrlListView_GetItemSelected($listEdition, $i) Then                     $index = $i                     exitloop                 EndIf              Next              ;===================================================             ConsoleWrite( "Select Edition:     " & $item & "  index: " & $index & @CR) ....... Please look at the comments in the code & the pix attached.
      _GUICtrlListView_GetItemSelected($listEdition, $i) always returns FALSE.
      Another problem is on the list. It also populate  the total count of items from the Array. How can I skip this item from populating to the list ?.
      Please advise and thanks

    • By n0ktar
      is it possible to make a wall chams in rainbow six siege using autoit scripts? tell me please and how . 
    • By Rskm
      Hi, I am using excel as input media for my program. The excel file (i tried with .xls, .xlsx and .xlsm format) has inputs which the autoit script reads during the run and performs few calculations. Some times (not always), after the run, when i try to open the excel file manually, the file doesnt open at all in excel. see the screenshot attached. However, if the execute the autoit script, the scripts still reads the existing data from that excel and performs the calcs. I copied the excel file to another computer and there too, it doesnt open.  So, after this, i cannot edit the excel forever (if i need to change any inputs). It is only this particular file that got affected. other excel files works normal.  What could be the problem here.  please help as this is a new challenge for me during my program development. 

×
×
  • Create New...