Results 1 to 9 of 9

Thread: Question on getting pictures and comparing them.

  1. #1
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Question on getting pictures and comparing them.

    I'm looking to create a (hopefully) simple script for a different game. What I need to know is if I can take two precise pictures, compare them, and then click the differences. Let me know if there is such thing or not!

    ~Sandstorm

  2. #2
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    SandStorm, it should be pretty easy, and sorry for the late reply.

    SCAR only accepts bitmaps though.

    SCAR Code:
    function BitmapFromString(Width, Height: Integer; data: string): Integer;
    procedure GetBitmapSize(Bitmap: Integer; var Width, Height: Integer);
    function FastGetPixel(bitmap: Integer; x, y: Integer): TColor;

    SCAR Code:
    for i:= Width to Height do
      begin
        t:= FastGetPixel(Bitmapone);
        p:= FastGetPixel(Bitmap2);
        if t <> p then Mouse (Width,Height,0,0,true);
      end;
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  3. #3
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright. Is there a way to get the bitmap directly in the script? There are something like 10-15 pictures, and I don't want to load them all. Thanks for the reply, it does look rather easy.

  4. #4
    Join Date
    Apr 2007
    Posts
    994
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Again, sorry for the late reply.

    I think you can
    SCAR Code:
    s:= GetPage('www.xxyy.com/Waffle1.bmp');
    i:= BitmapFromString2(true, s);

    Etc. I'm not too sure if this works. Take a look at MK's iron miner and how he download's bitmaps from the net.

    EDIt: According to wizzup:
    <Wizzup> LeeLokHin:
    <Wizzup> About your post at sandstorms thread
    <Wizzup> do GetPage, write it to a file
    <Wizzup> then do LoadBitmap(filepath: string);
    [QUOTE]<GoF`> oh no its Raymooond
    <Raymooond> Heya
    <GoF`> is it ray or some other ray?
    <LeeLokHin> No idea
    <LeeLokHin> Raymond, what's the game you like the most?
    <Raymooond> Runescape
    <-- LeeLokHin has kicked Raymooond from #srl (Faker.)[/QUOTE]

  5. #5
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm looking to take a picture and make it a bitmap during runtime :/.

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by Sandstorm View Post
    I'm looking to create a (hopefully) simple script for a different game. What I need to know is if I can take two precise pictures, compare them, and then click the differences. Let me know if there is such thing or not!

    ~Sandstorm
    Where are the pictures stored exactly?
    You can also use CopyClientToBitmap. (Runtime)
    And the way LeeLokHin gave for comparing is correct.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #7
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Where are the pictures stored exactly?
    You can also use CopyClientToBitmap. (Runtime)
    And the way LeeLokHin gave for comparing is correct.
    I'm willing to bet the pictures are from a Flash game.

  8. #8
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Would that stop it from working senrath? If so, I'm out of luck :/.

    Give me a second and I'll link the game.

    Here it is:

    http://www.addictinggames.com/madworld.html

  9. #9
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    It shouldn't. It just means you can't do it the easy way with GetPage and LoadBitmap.

    If there is some way to split a bitmap, you could use the suggested CopyClientToBitmap and split it down the middle before comparing.

    If you ever get a method to work, just remember that with Mad World, you'd also end up having to mirror one of the images. You'd also have to do something different with the levels that aren't truly mirrors of each other.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Turn pictures into text pictures? what? Here's how...
    By BKNYKavkaz in forum Computer Help and Tutorials
    Replies: 8
    Last Post: 03-11-2009, 03:41 AM
  2. Srl bot Pictures =)
    By ckeboss in forum Bot Information and Spottings
    Replies: 21
    Last Post: 09-15-2007, 05:16 PM
  3. Comparing Arrays
    By Boreas in forum OSR Help
    Replies: 3
    Last Post: 02-22-2007, 04:40 PM
  4. My pictures :)
    By dunno in forum Who Are You ? Who ? Who ?
    Replies: 23
    Last Post: 06-27-2006, 12:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •