Jump to content

Calculate from string (variable) raw mode problem


Recommended Posts

my code is:

$text4 = ClipGet
$text6 = StringReplace($text4,"?","")
;what shud be here so the $text6 s treated as 2+2 not 2@
      $text5 = Execute ($text6)

but it works for numbers like 2+66

but not for numbers like 2+2

I'm unable to set it in a raw mode how do i do that?

Edited by saio
Link to comment
Share on other sites

Raw mode of what? None of those functions have a "raw" mode. Also, why open a second thread to deal with the same issue you've already posted?

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

it's not the same issue

The clip get is equal to 2+2?

I filter the ?

then Calculate it <here is the problem Shift+2 =@ and it calculates 2@

How Do I make it calculate normaly???

Than send result to msgbox

Link to comment
Share on other sites

I'd imagine its the contents of the clipboard, you are not dealing with "2+2?". msgbox every step of the way, it works just fine as you have it.

$text4 = "2+2?"
msgbox(0, '' , $text4)
$text6 = StringReplace($text4,"?","")
msgbox(0, '' , $text6)
      $answer = Execute($text6)
msgbox(0, '' , $answer)
Edited by boththose

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

To add to what bothose said, if I copy "2+2?" to the clipboard, and then run your script, it calculated it to where $text5 = 4 so it's working fine as is. It could be that 2+2 isn't on the clipboard when you run this.

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

saio,

Your code as written works for many of us. As BrewManNH has suggested, perhaps what you have on the clipboard is not quite what you think. :)

From where are you copying this "equation"? Perhaps we can copy it as well - it might give us some more clues. ;)

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 comment
Share on other sites

UEZ 10x but your script gives me error

BrewManNH it buges for me and it is

boththose you got me wrong

Can you give us a real text example not only a fragment of it.

Because I cannot find any issue with the code I posted in the link above.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

saio,

Your code as written works for many of us. As BrewManNH has suggested, perhaps what you have on the clipboard is not quite what you think. :)

From where are you copying this "equation"? Perhaps we can copy it as well - it might give us some more clues. ;)

M23

notepad it finds text text text equation(+the? of corce) that the string replase(or stringleft) removes the ? and in the variable shud be 2+2

the script works for bigger numbers than 10 Esamlpe : Whatever+10 to 99>Works Whatever + 0 to 9 >gives nothing..... 2@ in that case

here:

$text=ClipGet ()
$lookfor = ("What It shud lookfor")
If StringInStr($text, $lookfor) Then
   ShellExecute ( "C:Windowsnotepad.exe")
   Sleep (5000)
   Send ("^v")
   Sleep (1000)
   Send ("^f")
   Sleep (1000)
   Send ($lookfor)
   Sleep (1000)
   Send ("{Tab}")
   Sleep (1000)
   Send ("{Tab}")
   Sleep (1000)
   Send ("{LEFT}")
   Sleep (1000)
   Send ("{Tab}")
   Sleep (1000)
   Send ("{ENTER}")
   Sleep (1000)
   Send ("{Tab}")
   Sleep (1000)
   Send ("{ENTER}")
   Sleep (1000)
   Send ("{Right}")
   Sleep (1000)
   Send ("{SHIFTDOWN}")
   Sleep (1000)
   Send ("{Right}")
   Sleep (1000)
   Send ("{Right}")
   Sleep (1000)
   Send ("{Right}")
   Sleep (1000)
   Send ("{Right}")
   Sleep (1000)
   Send ("{Right}")
   Sleep (1000)
   Send ("{SHIFTUP}")
   Sleep (1000)
   Send ("^c")
   Sleep (1000)
   $text4 = ClipGet ()
   Sleep(1000)
   Run ("C:\Windows\System32\cmd.exe /c taskkill -f /IM notepad.exe")
   sleep (15000)
   $text6 = StringReplace($text4,"?","")
      $text5 = Execute ($text6)
   Send("!2")
   Sleep(10000)
   Send ($text5)
else
endif
Edited by saio
Link to comment
Share on other sites

The only thing I can see that might cause a problem in your script is you forgot to put "()" after the ClipGet, which should look like ClipGet()

Other than that, and I had fixed it when I ran that code, it works fine.

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

ok whay than i get nothing in a massagebox???

i first got 2+2 than Empty massagebox

and it shyd have given me 2+2

than in the second one 4 but it gives me nothing......

can it get messed up when I compile it to exe?????

Edited by saio
Link to comment
Share on other sites

What in the world is that script you posted supposed to do? It looks like you're sending a bunch of characters to Notepad, and then killing the notepad process, and then trying to send more characters to only God knows where.

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

well that's the idea to get text to filter equasion to calculate it and to send it back

so how do I debug the string replace????

edit: the string replace is fine the Execute is doung the crazy stuff

Edited by saio
Link to comment
Share on other sites

  • Moderators

saio,

the idea to get text to filter equasion to calculate it and to send it back

Either you explain clearly why you want to do this in the next few minutes or I will assume that my earlier suspicions about it being a numeric CAPTCHA breaker are confirmed.

The clock is running. ;)

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 comment
Share on other sites

  • Moderators

saio,

I see you have logged off without providing an explanation, so I take it you cannot provide one and that my suspicions are correct. Do not start another thread on this subject. ;)

M23

Edited by Melba23
Typos

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...