Simulating a user

xuanbao · · 674 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;d like to code (or use if already available) tools to simulate a user. That include moving the mouse, and pressing keys obviously, but also taking screenshots.</p> <p>I could use it for my next project, either to simulate a player or some macro things.</p> <p>So where to find some information to get started? It would only be used on windows.</p> <p>Also I&#39;m coding on linux, I haven&#39;t coded anything for windows in go yet, I guess taking the mouse control is quite OS dependant. How to get a good workflow? Code in linux and transfer it to the windows machine and compile it there?</p> <p>And last queston, any ressource concerning GUI in Go? Or should I use a browser for the gui? Now that I&#39;m thinking about it, it may be a good idea. (to host a web server and get input from there)</p> <hr/>**评论:**<br/><br/>nathj07: <pre><p>I&#39;d build it for the Web and then use Selenium, web driver, or similar for your faked UI interactions. </p></pre>Simpfally: <pre><p>Oh it wouldn&#39;t necessary be for remote control of a computer, could just be some stats to see if everything&#39;s going alright etc.</p> <p>But yeah I think the UI will be on the web, it&#39;s quite convenient.</p> <p>edit: I just looked up selenium, and I&#39;m not looking to automate a browser, but anything on the computer so I&#39;ll still need to simulate mouse clicks and keystrokes</p></pre>JavaNut13: <pre><p>The Robot class in Java is a really powerful low-level tool to automate input.</p></pre>Simpfally: <pre><p>I heard of it but I&#39;m not familiar with java at all unfortunately</p></pre>ecmdome: <pre><p>What kind of front end are you looking to test? Angular? jQuery? Just HTML? </p> <p>Not really sure if you can accomplish what you want in go, or maybe you can but it is probably a backwards way of doing so.</p> <p>If I&#39;m understanding you, maybe you want to build something JavaScript based to do what you&#39;d like.</p> <p>(edit for typo)</p></pre>Simpfally: <pre><p>Oh sorry what I wanted is to code a library that allows controlling the mouse, keyboard and take screenshots.<br/> I&#39;d then use this library to take information from a non-web game with the screenshots and then take action with the mouse.</p> <p>I wouldn&#39;t use screenshots to automate a website hehe.</p></pre>SlinSo: <pre><p>I used <a href="http://www.autohotkey.com" rel="nofollow">www.autohotkey.com</a> in different projects to automate user input. I even built a EVE online bot based on autohotkey. For example the script took screenshots with the builtin api and used external ocr software to analyze screen contents.</p> <p>so if your scope is beyond web applications it could probably fit your needs. otherwise i would stick with tools like Selenium.</p></pre>Simpfally: <pre><p>Haha, I planned to try something on EVE too. I know ahk but I&#39;m currently trying to do everything I need in Go for learning purpose.</p> <p>But after some research it looks like there&#39;s no easy way, only C bindings</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

674 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传