Results 1 to 11 of 11

Thread: Problems on Bitmap Finding?!

  1. #1
    Join Date
    Apr 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Problems on Bitmap Finding?!

    Alright basically I want to detect some wheat on a game so I can farm it. So I got the bitmap and all, made the codes and shit for it, and what i want it to do is find the bitmap on the screen and then go click it in the client. This is what I coded so far.

    Please view, then post feedback.

    -Raepor =D


    Code:
    program WheatPicker;
    
    var
    Wheat: Integer;
    x,y: Integer;
    
    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;
    
    procedure UseBitmap;
    begin
    if(FindBitmapIn(Wheat,x,y,0,0,100,100)) then
     begin
      MoveMouse(x,y);
      Wait(1000+random(100));
      ClickMouse(x,y,true);
     end;
    
    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;
    
    begin
     Load;
      UseBitmap;
     FreeBmps;
    end.

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Dont use ClickMouse:

    Here i fixed it up for ya:

    SCAR Code:
    program WheatPicker;
    {.include srl/srl.scar}
    var
    Wheat: Integer;
    x,y: Integer;

    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;

    procedure UseBitmap;
    begin
    if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
     begin
      MMouse(x,y,1,1);
      Wait(1000+random(100));
      Mouse(x,y,1,1,true);
     end;

    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;

    begin
     Load;
      UseBitmap;
     FreeBmps;
    end.

    You'll need SRL for this to work .

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Actually, it's a non-rs script, so it doesn't really matter, though you can just use Mouse if you do use SRL functions as the wait before was to make sure ti didn't click to early (I'm guessing). Anyway, you will probably want to put it into a loop, other wise it will just keep on going. Normally, it is a good idea to make it repeat the actions for x amount of times, so you could do something like this:
    SCAR Code:
    program WheatPicker;
    {.include SRL/SRL.scar}
    const
      ActionsToDo = 5; // Change to the amount of time you want it to do the action
    var
      loopCounter: Integer // used to keep track of how many loops have been done
      Wheat: Integer;
      x,y: Integer;
     
    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;
     
    procedure UseBitmap;
    begin
      if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
      begin
        Mouse(x,y,2,2,true);
      end;
     
    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;

    begin
      Load;
      repeat
        UseBitmap;
        loopCounter := loopCounter + 1; // Makes loopCounter bigger so it doesn't run forever
      until(loopCounter >= LoadsToDo) // it will repeat the above commands until loopCounter is bigger than (>) or equal to (=) LoadsToDo, after which it continues with the script
      FreeBmps;
    end.
    That should then repeat it, though I'm not sure of the game, so you may need to do more to make sure it continually farms for you, rather than just once then it goes onto a page where there's no wheat, so it can't farm at all. Other than that, it should work well as long as the bmp doesn't change
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Apr 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Actually neither of your scripts work :P.

    Line 432: [Hint] (10376:1): Variable 'OLDMS' never used in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 87: [Error] (12254:1): Unknown identifier 'SetMouseMode' in script C:\Program Files\SCAR 3.15\includes\SRL/SRL.scar

    For both scripts.

  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Umm need to get Srl Rev #14 .

  6. #6
    Join Date
    Apr 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NaumanAkhlaQ View Post
    Umm need to get Srl Rev #14 .
    Alright I used to use scar scripts and scar to auto on rs, i never got into coding because I never understood it. But now I am understanding it more and more. But I quit runescape about a year ago, so im coding for another game I play which doesn't have anti-randoms.

    I understand I need the latest version of SCAR, and latest version of SRL, and the includes.

    I have updated them all in my SCAR Divi CDE. But when I go to other "first" scripts people are making they all have different functions in there scripts. I haven't even heard of them functions. Like where do you learn about them and where do i find a list of functions that isn't confusing (the list that you get pressing F1 in scar is confusing) Also like I have no clue what your saying about SRL rev14 or something. I see the forum section with rev14 in it but there is no download, like what the hell do i do?

  7. #7
    Join Date
    Apr 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Sorry for double post but, I would still like to know about where to ind the functions most commonly used. Also I'd like to say that I fixed the rev and srl problems.

    For the testing of your scripts you guys made here are the results.

    SCAR Code:
    program WheatPicker;
    {.include SRL/SRL.scar}
    const
      ActionsToDo = 5; // Change to the amount of time you want it to do the action
    var
      loopCounter: Integer // used to keep track of how many loops have been done
      Wheat: Integer;
      x,y: Integer;

    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;

    procedure UseBitmap;
    begin
      if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
      begin
        Mouse(x,y,2,2,true);
      end;

    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;

    begin
      Load;
      repeat
        UseBitmap;
        loopCounter := loopCounter + 1; // Makes loopCounter bigger so it doesn't run forever
      until(loopCounter >= LoadsToDo) // it will repeat the above commands until loopCounter is bigger than (>) or equal to (=) LoadsToDo, after which it continues with the script
      FreeBmps;
    end.

    With that one I get an error saying this: Line 7: [Error] (12650:1): Semicolon (';') expected in script



    For the other script posted...

    SCAR Code:
    program WheatPicker;
    {.include srl/srl.scar}
    var
    Wheat: Integer;
    x,y: Integer;

    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;

    procedure UseBitmap;
    begin
    if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
     begin
      MMouse(x,y,1,1);
      Wait(1000+random(100));
      Mouse(x,y,1,1,true);
     end;

    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;

    begin
     Load;
      UseBitmap;
     FreeBmps;
    end.


    I get another error saying this: Line 31: [Error] (12674:1): Identifier expected in script




    Please help.

  8. #8
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    procedure UseBitmap;
    begin
    if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
     begin
      MMouse(x,y,1,1);
      Wait(1000+random(100));
      Mouse(x,y,1,1,true);
     end;

    you forgot an end; there


  9. #9
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Sorry, I don't check for errors in scripts before posting them, but just replace:
    SCAR Code:
    loopCounter: Integer
    with
    SCAR Code:
    loopCounter: Integer;

    And then add the missing 'end;' to the UseBitmap procedure as Cazax said
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  10. #10
    Join Date
    Apr 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This really is fucking pissing me off now, im doing everything EXACTLY how the fucking tutorials, people on here, and how i think this shit should be done and still does not fucking work.

    1. I understand you guys are trying to help me, but when this is my first script you think im going to copy what you put down here and try it myself? YES!, so dont put scripts down that you know won't even work, like whats the point in that?..

    2. You guys are yet again wrong, thats not the freakin problem, nor do ANY of your scripts work.

    SCAR Code:
    program WheatPicker;
    {.include SRL/SRL.scar}
    const
      ActionsToDo = 5; // Change to the amount of time you want it to do the action
    var
      loopCounter: Integer; // used to keep track of how many loops have been done
      Wheat: Integer;
      x,y: Integer;

    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;

    procedure UseBitmap;
    begin
      if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
      begin
        Mouse(x,y,2,2,true);
      end;

    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;

    begin
      Load;
      repeat
        UseBitmap;
        loopCounter := loopCounter + 1; // Makes loopCounter bigger so it doesn't run forever
      until(loopCounter >= LoadsToDo) // it will repeat the above commands until loopCounter is bigger than (>) or equal to (=) LoadsToDo, after which it continues with the script
      FreeBmps;
    end.


    I run that and receive this as my error: Line 32: [Error] (12675:1): Identifier expected in script C:\Program Files\SCAR 3.15\Scripts\DAutoLogin.scar

    Run the script, see what happens for you, i don't think that is too hard to do now is it?

    3. Also, the thing that also pisses me off is my thread has a bunch of views yet only 2 people post a response and try to help, this is a community of helping. If you take a script from the free section and use it, that person is technically helping you, if you come into this thread and fucking know what my problem is and you don't post that just shows how much of a leecher you truely are. It's sad because a community is supposed to build off itself, and when only 1 section of the community can support itself (the SCAR scripters in this situation) the community falls apart. START FREAKIN HELPING!@ If you know what the fuck im in need of then post, if you have an idea, then for God's sake post.

    4. This also pisses me off, the thing is this whole script im trying to learn is used mostly in every single runescape script on this site and only 2 people are willing to go a help me, get real.

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

    Default

    SCAR Code:
    program WheatPicker;
    {.include SRL/SRL.scar}
    const
      ActionsToDo = 5; // Change to the amount of time you want it to do the action
    var
      loopCounter,Wheat,x,y: Integer; // used to keep track of how many loops have been done

    procedure Load;
    begin
      Wheat := BitmapFromString(7, 18, 'beNoNyO1TwXAAAGDfuj7UlVxE' +
           'R1623Jr0oq5003ltZcO4huWtKCoTs41tv0Is5eLqi7+3no8PbyOqC' +
           '54MfFw4C5b3fUWEkY80Gk1cXsNZBG/ApxktySKxevQ/k1/rpOQhG4' +
           'ZQ0RiqmP1l7D/JviU3zDCClR1Rvvyh/9FV4K1Uz0gD7F5BRnMyz7l' +
           'x1s1w6BVvomQUfF8Mf2Dx8zzduaBfDXEOTYBNsX/SmyyD6VZWxqiu' +
           'iajp0pKlqfgmc3NvtnqtQISov7xboZtOUSXfB0tv08UEvxi9O6Q5P' +
           'S3stj8eZMXZVVdSAkLV7TnFdAOgZp9QVV9NhHLv3iSnTbU2Cup2Zx' +
           'yoA0yaIrffEUpAo8/a1MjKArg9wMSJqzLby/U2Erwz0Tffv2y9dPG' +
           'K7GDG3ubvUbgMJwdQQzp5ahOxynpscFAauoJ5KC45qsBblfFoyYK/' +
           'eYItXTC7GXkyUs82dswQRTQMDgItuz9r85cM1wJUFneyVSykoOE/8' +
           'p54ng==');
    end;

    procedure UseBitmap;
    begin
      if(FindBitmapIn(Wheat,x,y,MIX1,MIY1,MIX2,MIY2)) then
      begin
        Mouse(x,y,2,2,true);
      end;
    end; //forgot end; , thats what standards are for.

    procedure FreeBmps;
    begin
      FreeBitmap(Wheat);
    end;

    begin
      Load;
      repeat
        UseBitmap;
        loopCounter := loopCounter + 1; // Makes loopCounter bigger so it doesn't run forever
      until(loopCounter >= ActionsToDo) //its actionstodo
      FreeBmps;
    end.
    And, flaming the people who are trying to help you does not really help Just a friendly tip.

    You forgot an end, which is why the identifier problem keeps popping up. I am sure theres an "common errors in scar" tut in the scar beginer section.

    And, for a general rule, if your final end; isnt touching the margin, your standards are wrong, or you forgot something.

    And, finally, I prefer using DTMs over Bitmaps, but I think its a matter of personal preference. If you do not know what a dtm is, try the tutorial beginner or intermediate section. Theres one by Yakman.

    Good luck with scripting!

    Oh, and by the way, LoopsCounter adds even when it CANT find the wheat. Try using a

    if foundbitmap then
    Blah.

    Then a Timefrommark and TimeMark to set the maximum time.

    Try reading through the srl file, theres a lot of useful functions there.
    [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]

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. bitmap finding procedure help
    By Awkwardsaw in forum OSR Help
    Replies: 0
    Last Post: 09-21-2008, 01:01 AM
  2. Finding Most Abundant Color in Bitmap
    By fastler in forum OSR Help
    Replies: 6
    Last Post: 09-14-2008, 08:24 PM
  3. Bitmap Problems
    By sucidal_boredaholic in forum OSR Help
    Replies: 1
    Last Post: 12-15-2007, 05:39 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
  •