Jump to content

set a variable and check it


Recommended Posts

hi guys,

Im trying to select some text. then put it into a variable so i can check it and run the one or the other code. could you guys check it and say what i am doing wrong. I could be all wrong, im still a big n00b with this :">

This is what i got untill now:

MouseClick ("left", 33, 154, 2)
$Land = Send ("^c")
If $Land = "Verenigde " Then
    MouseClick ("left", 779, 240, 2)
    Send ("^c")
    Mouseclick ("left", 507, 429, 1)
    Send ("^v")
    Mouseclick ("left", 483, 484, 1)
    MouseClick ("left", 808, 481, 1)
ElseIf $Land = "Italie" Then
    SplashTextOn ("bla", "bla", 100, 100, 900, 100)
EndIf
Link to comment
Share on other sites

  • Developers

does anybody have a suggestion to my problem?

BJ

<{POST_SNAPBACK}>

try putting a sleep between the mouseclick and the ^c ...

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

  • Developers

no this doesn't work either. :)

<{POST_SNAPBACK}>

can you specify how you are testing so we can try it out ?

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

can you specify how you are testing so we can try it out ?

<{POST_SNAPBACK}>

yeah sure. i let the mouse click on a certain word. the word that should be shown in the msgbox later on. but it still shows something else that i copy and pasted earlier. :)

sleep (2000)
MouseClick ("left", 33, 154, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)
Link to comment
Share on other sites

  • Developers

yeah sure. i let the mouse click on a certain word. the word that should be shown in the msgbox later on. but it still shows something else that i copy and pasted earlier. :)

sleep (2000)
MouseClick ("left", 33, 154, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)

<{POST_SNAPBACK}>

Understand this part, but what (dutch/nederlandse) application are you using that you want to select something of ?

Its easiest to try it the same way as you are doing....

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

are you highlighting the word? If I click on ----> THIS once and hit CTRL-C nothing happens, but if I double-click it CTRL-C puts it in the clipboard.

*EDIT I see now that you are trying to double click, but is it working? Is the word highlighted? Can you copy words to the clipboard manually?

Edited by Ejoc
Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
Link to comment
Share on other sites

Understand this part, but what (dutch/nederlandse) application are you using that you want to select something of ?

Its easiest to try it the same way as you are doing....

<{POST_SNAPBACK}>

im trying to detect in which country i am in a small internet game. just trying out some stuff. so im just trying to copy that word onto the clipboard so i can put it in a variable to start doing the next action on that. im doing it in Mozilla Firefox.

i can also explain in dutch if you like.

Link to comment
Share on other sites

are you highlighting the word?  If I click on ----> THIS    once and hit CTRL-C nothing happens, but if I double-click it CTRL-C puts it in the clipboard.

*EDIT I see now that you are trying to double click, but is it working?  Is the word highlighted? Can you copy words to the clipboard manually?

<{POST_SNAPBACK}>

yes it's highlighted. and i can copy it manually as well.
Link to comment
Share on other sites

sleep (2000)
MouseClick ("left", 733, 656, 2)
sleep (500)
Send ("^c")
$Land = ClipGet()

MsgBox(0, "Clipboard contains:", $Land)

Worked perfectly in Firefox for me

<{POST_SNAPBACK}>

:) why not for me. hmmzz... could it be anything on the website that's blocking it?
Link to comment
Share on other sites

  • Developers

yes it's highlighted. and i can copy it manually as well.

<{POST_SNAPBACK}>

So the Double click selects the text you want but the Send("^c") doesn't put it into the clipboard. even when you put an Sleep(1000) between the 2 statements?

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

So the Double click selects the text you want but the Send("^c") doesn't put it into the clipboard. even when you put an Sleep(1000) between the 2 statements?

<{POST_SNAPBACK}>

yes that is correct. the send ("^c") doesnt put it into the clipboard.
Link to comment
Share on other sites

  • Developers

yes that is correct. the send ("^c") doesnt put it into the clipboard.

<{POST_SNAPBACK}>

It could be the game blocking it ?

what about Send("^{Insert}") ?

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

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
 Share

  • Recently Browsing   0 members

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