Lauren 5 Posted January 2, 2013 Report Share Posted January 2, 2013 Has anyone really starting playing with the new windows automation features? Is it possible yet to be able to wait for a specific window to exist before running a function. Maybe have a thread loop until a window with a specific title is found and then perform a function? Any Idea's? Quote Link to post Share on other sites
UBotBuddy 331 Posted January 2, 2013 Report Share Posted January 2, 2013 Most of my experience is with version 3.x of UBot. I need to jump in on these newer functions. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 2, 2013 Report Share Posted January 2, 2013 This is a way to do it - although not super elegant it does work. Run this and then open your calculator somtime before 30 seconds I put in a kill switch at 30 seconds so it doesn't loop forever.\ define tt1 { plugin command("WindowsCommands.dll", "set active window", "Calculator", "CalcFrame") set(#test, $plugin function("WindowsCommands.dll", "$scrape text", "Calculator", "CalcFrame", 64, 39), "Global") } thread { set(#avail, "no", "Global") set(#count, 0, "Global") loop while($comparison(#avail, "=", "no")) { tt1() if($comparison(#test, "=", "Calculator")) { then { set(#avail, "yes", "Global") } else { } } if($comparison(#count, "=", 6)) { then { stop script } else { } } wait(5) increment(#count) } alert("Success, program opened!") } 1 Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted January 2, 2013 Report Share Posted January 2, 2013 any thoughts on changing save to path, and save to file name, then clicking save on the popup save to file windows using windows commands? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 3, 2013 Report Share Posted January 3, 2013 Edit: see below for new code! 1 Quote Link to post Share on other sites
UBotBuddy 331 Posted January 3, 2013 Report Share Posted January 3, 2013 I am so glad this area of automation is starting to see some interest. I have said for quite some time I thought UBot was more of a threat for other Windows Automation tool than previously considered. NOTE TO SELF....Redo my Picasso bot showing MS Paint under UBot's control using UBot v4.x rather than v3.x. Quote Link to post Share on other sites
Twitter Dominator 125 Posted January 3, 2013 Report Share Posted January 3, 2013 ui text box("Path to save folder", #pathtofolder) plugin command("WindowsCommands.dll", "set active window", "Untitled - Notepad", "Notepad") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 42, 68, #pathtofolder) plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Down") plugin command("WindowsCommands.dll", "keyboard event", "a", "Key Press") plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Up") wait(.25) plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Down") plugin command("WindowsCommands.dll", "keyboard event", "c", "Key Press") plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Up") plugin command("WindowsCommands.dll", "keyboard event", "Backspace", "Key Press") wait(.25) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 42, 68, "some text here") wait(.5) thread { plugin command("WindowsCommands.dll", "close window", "Untitled - Notepad", "Notepad") } wait(.5) plugin command("WindowsCommands.dll", "click dialog button", "Notepad", "Save") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "F4", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Down") plugin command("WindowsCommands.dll", "keyboard event", "a", "Key Press") plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Up") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Backspace", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Down") plugin command("WindowsCommands.dll", "keyboard event", "v", "Key Press") plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Up") wait(.4) plugin command("WindowsCommands.dll", "click mouse", "Untitled - Notepad", "Notepad", 99, 270, "Left Click") Try this its a good start but not perfect nor complete just open a blank notepad for it to interact with. sweet thats a good starting base thanks Quote Link to post Share on other sites
Lauren 5 Posted January 3, 2013 Author Report Share Posted January 3, 2013 Thanks for the help, I was quite shocked too see that the new windows automation features did not spark more forum conversation.Glad we have at least one thread now On a side note anyone else notice that the type text feature is a bit finicky. On some boxes I have to run the command multiple times for it to actually type the text. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 3, 2013 Report Share Posted January 3, 2013 Okay it was bugging me that I couldn't get it to work right. I have no idea why the type keys didn't work properly yesterday (hence the funky way of copying/pasting the path to the folder) but nonetheless I got it working properly today. Here is the right code: To use it just open a blank notepad file. ui text box("Path to save folder", #pathtofolder) ui text box("File Name:", #txtfilename) plugin command("WindowsCommands.dll", "set active window", "Untitled - Notepad", "Notepad") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 42, 68, "some text here") wait(.5) thread { plugin command("WindowsCommands.dll", "close window", "Untitled - Notepad", "Notepad") } wait(.5) plugin command("WindowsCommands.dll", "click dialog button", "Notepad", "Save") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "F4", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Down") plugin command("WindowsCommands.dll", "keyboard event", "a", "Key Press") plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Up") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Backspace", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 208, 94, #pathtofolder) wait(.4) plugin command("WindowsCommands.dll", "click mouse", "Untitled - Notepad", "Notepad", 195, 482, "Left Click") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Backspace", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 232, 480, #txtfilename) plugin command("WindowsCommands.dll", "keyboard event", "Enter", "Key Press") 2 Quote Link to post Share on other sites
AutomationNinja 194 Posted January 24, 2013 Report Share Posted January 24, 2013 I am mega excited about the windows commands. I was just too busy to try them out. Just looked at them today. Now trying to figure out how they work. Quote Link to post Share on other sites
AutomationNinja 194 Posted January 24, 2013 Report Share Posted January 24, 2013 ok - wow very cool. so easy too. amazing. Quote Link to post Share on other sites
kev123 132 Posted January 24, 2013 Report Share Posted January 24, 2013 I've been playing with it for the last few days file exist command works a treat. for example with a third party software that you want it to loop through modifying files and then saving them. Quote Link to post Share on other sites
Lauren 5 Posted February 12, 2013 Author Report Share Posted February 12, 2013 Anyone have any idea's on scraping the skype chat window. Have not been able to solve this since the built in wizard kind of sucks for form detection. I have tried some of the form Spy utilities out there and no go. Quote Link to post Share on other sites
wiremarket 1 Posted May 16, 2013 Report Share Posted May 16, 2013 any thoughts on changing save to path, and save to file name, then clicking save on the popup save to file windows using windows commands? That is exactly what I am stuck on tonight. Clicking a download button on a web form is bringing up the Save As window. I'm stuck there. Okay it was bugging me that I couldn't get it to work right. I have no idea why the type keys didn't work properly yesterday (hence the funky way of copying/pasting the path to the folder) but nonetheless I got it working properly today. Here is the right code: To use it just open a blank notepad file. ui text box("Path to save folder", #pathtofolder) ui text box("File Name:", #txtfilename) plugin command("WindowsCommands.dll", "set active window", "Untitled - Notepad", "Notepad") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 42, 68, "some text here") wait(.5) thread { plugin command("WindowsCommands.dll", "close window", "Untitled - Notepad", "Notepad") } wait(.5) plugin command("WindowsCommands.dll", "click dialog button", "Notepad", "Save") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "F4", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Down") plugin command("WindowsCommands.dll", "keyboard event", "a", "Key Press") plugin command("WindowsCommands.dll", "keyboard event", "Control", "Key Up") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Backspace", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 208, 94, #pathtofolder) wait(.4) plugin command("WindowsCommands.dll", "click mouse", "Untitled - Notepad", "Notepad", 195, 482, "Left Click") wait(.5) plugin command("WindowsCommands.dll", "keyboard event", "Backspace", "Key Press") wait(.5) plugin command("WindowsCommands.dll", "type keys", "Untitled - Notepad", "Notepad", 232, 480, #txtfilename) plugin command("WindowsCommands.dll", "keyboard event", "Enter", "Key Press") That wouldn't work on computers with different screen sizes and resolutions would it? Quote Link to post Share on other sites
north_star 16 Posted May 16, 2013 Report Share Posted May 16, 2013 That wouldn't work on computers with different screen sizes and resolutions would it? Yes, I have tried it and it din't work, this the flaws of windows automation plugin, is anyone have an idea to embed any windows application so we can have a same resolution..? Quote Link to post Share on other sites
wiremarket 1 Posted May 16, 2013 Report Share Posted May 16, 2013 I played with the concept in the above code a bit and actually got it to work for my needs without relying on the x,y coordinates (i think). The "Save As" window seems to be a real pain to deal with, and of course since it's opening IN the Ubot Studio, you can't use the UBot Type Text Wizard to get coordinates and such. I actually just made sure the active window for the Type Text command was "Save As", Left the Parent Class blank, made up some X,Y coordinates out of thin air (250,250), and used the F4 keystroke to select the folder location field within the "Save As" window, just like HelloInsomnia suggested above. But then, since I don't want to rely on real X,Y coordinates that won't work on other computers, I didn't change the actual file name, because I don't know of any keystroke to select that area. Instead I'm changing the folder location as I described above and leaving the actual file name as whatever the default is that comes up with the Save As window. Seems to be working so far, but maybe I'm just getting lucky and springs, sprockets and gears are going to come flying out any second. Quote Link to post Share on other sites
Brutal 164 Posted April 21, 2014 Report Share Posted April 21, 2014 I'm still having to use (another) program to do my windows stuff and then call that program from within ubot - But I'm hoping that over time ubot dev team will spend more time on providing a more stable and robust solution. In fact, I wish those guys would buy a copy of (that other program) and play with it a bit to see its power and functionality working with windows, and then set to updating that portion of ubot. Quote Link to post Share on other sites
Steve 30 Posted April 21, 2014 Report Share Posted April 21, 2014 which software is "that other program"? Quote Link to post Share on other sites
the_way 52 Posted April 22, 2014 Report Share Posted April 22, 2014 zennopants Quote Link to post Share on other sites
Brutal 164 Posted April 22, 2014 Report Share Posted April 22, 2014 winautomation most recently ... The "problem" with all of them is that none are as intuitive as uBot, that's why i'm saying I can't wait for this particular set of controls to be tweaked. I'm constantly building little bots that I have to shell out to little helper programs created by other software. Just looking forward to ubot becoming the total one-stop solution. Quote Link to post Share on other sites
Steve 30 Posted April 22, 2014 Report Share Posted April 22, 2014 Funny - I just downloaded winautomation yesterday to try and accomplish something I was not able to easily do with ubot. I wish ubot could be my all in one also. 1 Quote Link to post Share on other sites
UBotBuddy 331 Posted April 22, 2014 Report Share Posted April 22, 2014 Definitely takes practice. Buddy Quote Link to post Share on other sites
a2mateit 395 Posted April 22, 2014 Report Share Posted April 22, 2014 I really wish some of the plugin developers would take to creating some windows automation plugins... Would be nice to have some better features. If someone could add in image recognotion to windows commands it would really open alot of possibilites... Quote Link to post Share on other sites
kev123 132 Posted April 22, 2014 Report Share Posted April 22, 2014 I really wish some of the plugin developers would take to creating some windows automation plugins... Would be nice to have some better features. If someone could add in image recognotion to windows commands it would really open alot of possibilites...its already on my list to look at in the future plenty of things you can do such as memory manipulation ,image rec etc.Probably be a while before I even look at it so if anyone's got the time to jump in feel free. Quote Link to post Share on other sites
the_way 52 Posted April 23, 2014 Report Share Posted April 23, 2014 kev, if you can plan out the overall functions you need, i would be more than happy to contribute some code to help get it finished. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.