BryceTheCoder Posted July 7, 2012 Share Posted July 7, 2012 Here is my code and i have many MP3 files that look 100% like that on my desktop and i have my desktop selected at the "drag to client" thing. MY CODE: [scar] var x,y,MyBitMap: Integer; begin MyBitMap := BitmapFromString(20, 28, 'ceNqllN1PW2Ucx+cN' + '7kKGkqAkmnjnf+CF9/NCkymJ3oEx0QARSkh2ARhjFJNtycwgqDiZ' + 'Q1coL6kMiZtMug1hgXIotDvtRinYlreW0vb07fS8vz1+zzk4QXbn' + 'c345OX2e3+d5vr+Xp7qm6YemaqqCR1P/a6qiCIIgK7Lf749EIu3t' + '7dXV1TU1NTZo+TwVVKx5RZFlQojP59vY2GCy2e7u7srKSos1V0+A' + 'oGQsEV3V/mEpimIYBh+iKP5w9aot6aROE1SVfFmcXc9yvAjcZoPB' + 'YDKZ3LbG00Bbp0w0Jc6Ib/T613cZYqiGruPQVZ8vEAis+P3Qf1In' + 'KCjEi2hqPFWsm86cn1zk2TK2MjSNHBknQIRmh2+yW6lC3Y2dxhD5' + 'ci7NM3kDHpIoSwJMkoTjx/0LWprlnQxb59ppmEi8TcufLid4JgNP' + 'RZYkUcLLTssJECYRVd5ihJcvU3eplf751JmxvTHfJlFxrsnC7LQc' + 'p+wZyQCb5V7pC02sRonEnrsZes+9KBVzyAZwiD8O2gIkGB6cG8/w' + 'td+FRpYeEyKNxsnpT35iMmnUyw75OHhIWXk22ViWq/n+kYtaJ4bs' + 'DMsVH17LmqxsZUw8Sh0i6CWUQxGJLqUKQtU3Iac3TDTh4gJ/9tIM' + 'V2DgLAoi7OhxKkBdCUTTN1aSP9PMj3TOuRB/sYceoyIsL7/j3B/y' + '0LoMtQAFmAXKtk6IdC3GP3jAvP+Ae/1WqdaVrh1MPHuJnqIi/lj+' + 'q8FbfKkIN1CSyMNAHYKaQm0cfLSQedNTen5g78y30erecNXF4DNd' + 'lHPGRwj6Wbeqw1sGXLBiNDVj5Y+19NmpTGX/dm1/9KWexy9cCJzu' + 'nD913ueee0RUyfI/pMyABcECzaTpiryTyr3128Gpy39VXXhY8dlS' + 'RdfCc19EHNfm0wlcGekJCErgeRjAJz0G2QvB6MfuyGufe17tunfu' + '63vXp/3p3Siu8NHjBB7GiQJnZdjsTGIYdg9rIlcsFHJMrpg9wF3B' + 'fdGtqpjarD8ZawewvNWWanRzc35+rpDPE2KEgjTl9ZZLRYEvezwz' + 'd+5MB2na0LVsJnPX4/lz9j5bKlo4b0olZMTlereuDp74bmpubmpq' + 'ikWjqf1EfX395M2JVocjtb8PC/hXOzo6pn6dxFYWK8J/dGS054o5' + 'vF7vwMCAw+HY3tpKp/abm5t9y8ttDsfe7m6ZLS1TSy0tLTT9EDcI' + 'uUJLgx0aGvrF7e7r62ttbQ2FgkDAHhykGhoaBq8Pzs7ehzPYSDjc' + '29vrHh8nhs5zHJSDdTqdv9++jdja2trg09jYGI/Hk4kENsnnGChE' + 'GhH12PhYZ2fn8PAwZniubGc4mUzkmCxXZhN7u7quhcNrqAK2XQ+v' + 'oYggQSNFUBuLxXCW3U5sqcSWWAiAceUyoiizLIrIsaz1Yf60fEpY' + 'tbsCwuwZ8j/G3zYVt5E='); if FindBitmapTolerance(MyBitMap, x, y, 10) then begin writeln('i found it! '); end; end. [/scar] i have changed the tolerance around to even 1 to even 80 and still never finds it... Quote Link to comment Share on other sites More sharing options...
FHannes Posted July 7, 2012 Share Posted July 7, 2012 Probably because the icon seems to include part of the background? That bitmap is also way too big, you can seriously cut down on the size and still get good results... Quote Link to comment Share on other sites More sharing options...
LordJashin Posted July 7, 2012 Share Posted July 7, 2012 Also, there is other view modes such as Tile, Icons, Thumbnails, etc. Those might make the icon bigger or smaller. Make sure when you are testing this you put a wait in the beginning of your script so you can minimize SCAR and be on the desktop. Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted July 8, 2012 Author Share Posted July 8, 2012 ok i now changed to smaller and stuff but still nothing is working:( [scar] program New; {$DEFINE RS2} {.include OSI\OSI.scar} procedure Ignore_This; begin SetUpOSI; MouseSpeed := 12; ClearDebug; end; var x:integer; y:integer; here:integer; procedure place; begin here := BitmapFromString(20, 12, 'ceNr78OHjt99//4PBz2+f' + 'PxANgOq//X63p7/M3sRQT899/tmXf4nWDtT76/+rPnvntkNvf1+a' + 'pagTd/fv/1+/f/3+8+fX9y+fvnz/B3YP2LzPP/6AJIDc718+wvVO' + 'dPHsO/7x//9XNWJmKz793N89vammoG3F5e+v98Y6Ojq5ehx4DVR4' + 'Z3FF/+xJtd6eQVvu/P797TtY7+spnm5Fi46cWVSt4lr59f+HVi2R' + 'wOmX//6/mCynOPH4p5enJlkbpD/+f8eRgTN1/smbu9ocHCvufTwC' + '1vtmZoC9iXtYbHTt0Rdf/v9/3KhjP//x///vN9mJ5d8Hu7k7ReHw' + 'h/upcqHnQR64XxTjcPLYcrDelz22zr2nP////+/b569//j+oUTaZ' + 'chMY8leSZBQmHv/4/OQ0T5vmd/9v+3NI9x1+cXNrg7fXlOe/DgH1' + 'fv35Zmdv/9arr759BoYAML6eb6jv2Pv46/dvf74+3hHjYOfomnEV' + 'FIfn4vltYouSvfzDT7z9/+PzV6AQUP3Xnz/BGiEAqP3X109gFjSc' + '/375CFR5MoTf/TjIkH8QWbBeYsDnn3+v9yW1XPjwC24J0Xoh2hEa' + 'IXopAQD6O04A'); end; begin place; Ignore_This; Mouse(111,442,0,0,False); wait(900); if FindBitMapTolerance(here,x,y,10) then begin Mouse(x,y,0,0,True); end else begin writeln('Sorry, didnt find it '); end; end. [/scar] Quote Link to comment Share on other sites More sharing options...
LordJashin Posted July 8, 2012 Share Posted July 8, 2012 Have you tried using SetDesktopAsClient;? I think it should work regardless though. Make sure the bitmap you are using looks the same on the screen. Also remember to FREE your bitmaps. As to why its not working, maybe it's just your computer. Or maybe something in your script is goofy. Or maybe the bitmap isn't the same as the one on the screen. If you have Windows XP though you shouldn't have a computer problem afaik Quote Link to comment Share on other sites More sharing options...
BryceTheCoder Posted July 8, 2012 Author Share Posted July 8, 2012 i have windows 7 and it does look 100% exactly the same as what im trying to find, and shud i free the bitmap before or after the search?? Cuz iv never used freebitmap Quote Link to comment Share on other sites More sharing options...