Foaman Posted March 16, 2006 Share Posted March 16, 2006 (edited) Hello. It would really help with my scripting if I could use text locations in my scripting. Basically I want to use like $text = WinGetText("untitled - notepad", "blah") If $text<>1 then $pos = WinGetPos("untiled - notepad", "blah")" MouseClick("left", $pos[0], $pos[1]) EndIf Something like that? I have no idea if that is even close to right, but I think that the general idea can be gathered. WinGetPos gives the location of a window, but it's in the form, and I quote " WinGetPos ( "title" [, "text" ] ). What is "text" useful for, if it can't be used to get the position of the text itself? I guess, more specifically, I want to get the X: and Y: under Mouse Details>Screen: in the AutoIt v3 Active Window Info tool.... I guess it's possible that I could just have the script find the text, bring the cursor to the text, somehow, and then read the x and y from that program? But I can't have the cursor go to the text without knowing its location. ANY advice or input is greatly appreciated. This would be SO SO helpful. Thanks. Also, if this process could be recreated, but then a specific letter or word could be found within the findings. This is probably easier, and I may be able to figure it out myself if I get the answer to the original question, but this would help, also. So a for instance would be to have the script do this: "Find the sentence, "I like peanutbutter." If the phrase exists, find "t" one time in the phrase, hit backspace 6 times, send return." So then the sentence would say, "I like butter." If you just have the script locate the sentence, "I like peanutbutter." And click randomly, then hit backspace, the first character deleted may be the 'B' or the 'R' or the 'I'; this would be undesired, and screw the whole sentence up. This is only important to me because there is a button that I want to click on, and it is the words "Click Here". The button itself is only accessable for clicking at the space between the two words, then you will want to find the location of the space, not just the words, and click there! Dead center! I know... Any work around ideas? Anything? Thanks Edited March 17, 2006 by Foaman Link to comment Share on other sites More sharing options...
Valuater Posted March 16, 2006 Share Posted March 16, 2006 is this online? 8) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2006 Moderators Share Posted March 17, 2006 Is this a Control that is holding the text? (Does it have a control id?) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nfwu Posted March 17, 2006 Share Posted March 17, 2006 (edited) The program is online, but I don't know if the button? has a control ID. I should hope that it does, if that would help. Do you know how I might find out?http://www.autoitscript.com/forum/index.php?showtopic=21048If i remember correctly, the tutorial application above has a tutorial on using "AutoIt Window Info".P.S. - How do you make a box that says "CODE"? Do you just use HTML?Look here: http://www.autoitscript.com/forum/index.ph...nds&CODE=bbcode#) Edited March 17, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 17, 2006 Moderators Share Posted March 17, 2006 What's the applications name? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Foaman Posted March 19, 2006 Author Share Posted March 19, 2006 It is online. There is no control ID. The applications are Guild Wars and Mozilla. Link to comment Share on other sites More sharing options...
Andrew Sparkes Posted March 19, 2006 Share Posted March 19, 2006 IE.au3 can get the source and you can parse accordingly to get the text, but the actual position of the text is hard to get... Why do you need the position? ---Sparkes. Link to comment Share on other sites More sharing options...
theguy0000 Posted March 19, 2006 Share Posted March 19, 2006 I don't see any way to do this... why do you need to do this? maybe there is some other way to solve the problem..? The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
Foaman Posted March 21, 2006 Author Share Posted March 21, 2006 There are a number of things I would like to do. I am trying to make a good script for Guild Wars, having it automatically loot items with specific names, like "Gold" and "Enchanted Stones", and anything stackable. Right now, there is a script made to automatically loot Gold, Purple, Green, and Blue items, but there is nothing that will automatically loot gold without filling your inventory with useless Black items. (The colors represent how rare the item is, black being least rare and including gold.) Also, if the text appears, 'You have been resurected by ___ Soulstone.' Meaning that your entire party died and is suffering from a death penalty (death penalties reduce hitpoints and mana points until you return to town), I would like to send 'm' to the game, then locate the closest town on the map, by name, and have a left click sent to that location, followed by a simple auto-walk out of town. Because you always end up being resurected in a differnet area, there is no telling whether or not you will click in the right spot to go to a town. Also, this would allow me to configure which monsters the character attacks. If the monster is below 600 pixels, it should not be attacked. It might be too low to be reached by arrows or pets. An obstructed target will make your character shoot the wall all night. In Mozilla, I want to do something easier. I want to have whatever I write in Microsoft Word automatically spell checked and posted on my live journal. I already have the spell check part down pat, but I cannot get the script to send to my journal properly, because after browsing to the webpage, there is always a different number of objects before the login, and the login button often moves, depending on the ads. If I could just get the text "Login" and have a left click sent ot its location, then the same for "Post Entry", there would be no problem with the script, but right now I am relying off of {TAB} sends. Each time I send tab, the link selected changes one time. Because the number of links to select keeps changing, it's not an alternative, and Mozilla does not have control IDs. This would also save me a lot of time, because I have worked it out so that it will send multiple entries to my journal. This way, when I write several reports over the period of a day or two, I can just place them in my que for uploads, turn on my script, and drive to school, saving myself five or ten minutes worth of load and wait time on my cruddy modem and for uploads and whatnot. I don't have POP mail, either, so it would save me time and money when sending things to friends, and teachers, and so on, if I could do the same for my e-mail. Appreciate all input. ' I know that the gaming thing is stupid, but really the only reason that I do it is because I like playing with this program. I could care less about the game. It runs really laggy on my machine, anyway, because of the slow internet connection. Link to comment Share on other sites More sharing options...
fong1sky Posted May 8, 2006 Share Posted May 8, 2006 It seem I have a similar but more simple question. I want to know is it possible or how can I get the text which mouse is over in dialog,msg box or some where else? Link to comment Share on other sites More sharing options...
TheYodaOfPerl Posted May 8, 2006 Share Posted May 8, 2006 For the web page, I'd really recommend learning how to make a User Agent or spider. User Agents, literally pull web requests from servers, and then you can manually post the form back into whatever CGI they have on the site. For example, I have made a simple spider that goes out and resets email passwords for an external email server that only has a web administration page (Since it isn't under our company's direct control). User Agents are great, because you can make logic based on the HTML returned from a site. If the login uses Javascript to create cookies, you'll probably have to go with IE::Mechanize, rather than the LWP::UserAgent. Then again, these are perl libraries, and I'm not sure if you want to learn a whole language just to make a proper solution to your problem. If you want some advice on it.. feel free to PM me. I can get you started, in the right direction. Had nobody to help me when I've made all this crap that I've made. Just me and the documentation. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now