{"id":141,"date":"2009-06-04T08:00:35","date_gmt":"2009-06-04T06:00:35","guid":{"rendered":"http:\/\/enricoros.wordpress.com\/?p=141"},"modified":"2009-06-04T08:00:35","modified_gmt":"2009-06-04T06:00:35","slug":"autogram","status":"publish","type":"post","link":"https:\/\/www.enricoros.com\/oldblog\/2009\/06\/autogram\/","title":{"rendered":"AutoGram &#8211; The machine Vs The machine"},"content":{"rendered":"<p>Hello, it&#8217;s me again, back on the <a href=\"http:\/\/enricoros.wordpress.com\/2009\/05\/26\/biocheat\/\" target=\"_blank\">cheating<\/a> <a href=\"http:\/\/labs.trolltech.com\/blogs\/?s=cheat\" target=\"_blank\">bandwagon<\/a> \ud83d\ude09 Last time we talked about <a href=\"http:\/\/enricoros.wordpress.com\/2009\/05\/26\/biocheat\/\" target=\"_blank\">BioCheat<\/a>, and now we add another piece of the <a href=\"http:\/\/www.gitorious.org\/web-automation\" target=\"_blank\">web-automation<\/a> jigsaw puzzle: <a href=\"http:\/\/www.gitorious.org\/web-automation\/autogram\" target=\"_blank\">AutoGram<\/a>.<\/p>\n<p>Please enjoy this HQ stream of deceptive video pixels while I explain this fine new piece of trickery \ud83d\ude09<\/p>\n<p>[youtube=http:\/\/www.youtube.com\/watch?v=Vc0v9UFLGpM&amp;w=480&amp;h=304&amp;rel=0]<\/p>\n<p>As you can see, this other <a href=\"http:\/\/enricoros.wordpress.com\/2009\/05\/26\/biocheat\/#frustration\" target=\"_blank\">frustration-driven<\/a> program lets you climb the ladder of a typical facebook game while drinking coffee or feeding your pet!<\/p>\n<p>So, before starting you need:<!--more--><\/p>\n<ol>\n<li>a dictionary file for your language of choice (1 word per line)<\/li>\n<li>a dictionary file with the names of your facebook friends (for the &#8216;bonus&#8217; levels)<\/li>\n<li>a compiler, because I&#8217;m not making binary packages this time \ud83d\ude09<\/li>\n<li>the source code of AutoGram, <a href=\"http:\/\/www.gitorious.org\/web-automation\/autogram\/trees\/master\" target=\"_blank\">published here<\/a> and available as a <a href=\"http:\/\/www.gitorious.org\/web-automation\/autogram\/archive-tarball\/master\" target=\"_blank\">tar.gz here<\/a>.<\/li>\n<\/ol>\n<p><strong>Build it<\/strong> with your favourite compiler (tested on Linux with gcc and on Windows with msvc) or your favourite IDE (you can download <a href=\"http:\/\/www.qtsoftware.com\/products\/developer-tools\" target=\"_blank\">QtCreator<\/a> if you don&#8217;t know what an IDE is and click on the <em>autogram.pro<\/em> project file). Then <strong>Run it<\/strong> and embarass your friends \ud83d\ude09<\/p>\n<p>Here is how the program works:<\/p>\n<ol>\n<li><strong>grabs the screen<\/strong> image and cuts off the 6 images representing the letters.\u00a0 [<em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/ScreenCapture.cpp\" target=\"_blank\">ScreenCapture<\/a>.h<\/em>]<\/li>\n<li><strong>recognizes each character<\/strong> by comparing the image to the alphabet and picks the match that has less differential energy. (is like xor-ing 2 pictures and computing the energy of that)\u00a0 [<em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/ocr\/Ocr.cpp\" target=\"_blank\">Ocr<\/a>.h<\/em>]<\/li>\n<li>performs all the <strong>permutations<\/strong> of the characters, to find out all the words that can be made out of the given alphabet. [<em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/Scrambler.cpp\" target=\"_blank\">Scrambler<\/a>.h<\/em>]<\/li>\n<li><strong>validates with a dictionary<\/strong> to filter out unknown words. the dictionary is the &#8220;<em>main language dictionary<\/em>&#8221; if the screen is yellow-ish (indicating normal game) or the &#8220;<em>bonus game dictionary<\/em>&#8221; if the screen is red-ish (indicating a bonus game, where all the words are picked from the names of your friends).\u00a0 [<em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/Scrambler.cpp\" target=\"_blank\">Scrambler<\/a>.h<\/em>]<\/li>\n<li><strong>injects the words<\/strong> (as keystrokes + return) to the browser window.\u00a0 [<em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/InputUtils.h\" target=\"_blank\">InputUtils<\/a>.h<\/em>]<\/li>\n<li>there is a timer-based <strong>loop<\/strong> that performs the operations 1-5 while updating the GUI.\u00a0 [<em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/WCGame.cpp\" target=\"_blank\">WCGame<\/a>.h<\/em> contains the logic, <em><a href=\"http:\/\/gitorious.org\/web-automation\/autogram\/blobs\/master\/AppWidget.cpp\" target=\"_blank\">AppWidget<\/a>.h<\/em> handles the GUI]<\/li>\n<\/ol>\n<p>If you run AutoGram on a virtual machine, <em>please remember to switch it off after a while<\/em>! I take no responsability of any score overflow \ud83d\ude09<\/p>\n<p>Again <a rel=\"#someid7\" href=\"http:\/\/gitorious.org\/web-automation\/autogram\" target=\"_blank\">here is the source code<\/a>, stay tuned for more <em>web automation<\/em> articles, and <strong>enjoy<\/strong> <img decoding=\"async\" src=\"http:\/\/s.wordpress.com\/wp-includes\/images\/smilies\/icon_wink.gif\" alt=\"AutoGram - The machine Vs The machine;-)\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, it&#8217;s me again, back on the cheating bandwagon \ud83d\ude09 Last time we talked about BioCheat, and now we add another piece of the web-automation jigsaw puzzle: AutoGram. Please enjoy this HQ stream of deceptive video pixels while I explain this fine new piece of trickery \ud83d\ude09 [youtube=http:\/\/www.youtube.com\/watch?v=Vc0v9UFLGpM&amp;w=480&amp;h=304&amp;rel=0] As you can see, this other frustration-driven [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[10,11,24,26],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry","category-software","tag-avanguardia","tag-cheating","tag-planetqt","tag-qt"],"_links":{"self":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":1,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":277,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/posts\/141\/revisions\/277"}],"wp:attachment":[{"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.enricoros.com\/oldblog\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}