Jump to content

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

Link to comment
Share on other sites

  • Moderators

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

 

Link to comment
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

Link to comment
Share on other sites

  • Moderators

@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!

Link to comment
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.

Link to comment
Share on other sites

  • Developers

@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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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.

Link to comment
Share on other sites

  • Developers

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

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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. 

Link to comment
Share on other sites

  • Developers
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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...