Results 1 to 5 of 5

Thread: Compiles fine, findcolor doesnt seem to do its job?

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Compiles fine, findcolor doesnt seem to do its job?

    Hi folks,

    I havent used SCAR before; But im using it for a non-rs game.
    Ive done programming in Java when i was into RS priv servers.

    This is what ive got so far..

    Code:
    program findMonster;
    var
    x, y, loopcount : integer;
    
    procedure findMonster;
              begin
                   If (FindColorTolerance(x, y, 329034, 33, 127, 950, 720, 250))then
                   MoveMouseSmooth(x, y);
                   writeln('Mouse moving to ('+ IntToStr(x)+', '+IntToStr(y)+')');
                   wait(3000+random(2000));
                   ClickMouse(x, y, True);
                   GetMousePos(x, y);
                   writeln('Mouse @ ('+ IntToStr(x)+', '+IntToStr(y)+')');
                   wait(3000+random(2000));
              end;
              
    begin
    repeat
          findMonster;
    until(loopcount>3)
    end.
    All i seem to get in my debug window is

    Code:
    Successfully compiled (37 ms)
    Mouse moving to (0, 0)
    Mouse now at (-1, 0)
    Am i missing something? It must be finding the colour if its moving onto the next part of the program

  2. #2
    Join Date
    Dec 2006
    Location
    Sweden
    Posts
    10,812
    Mentioned
    3 Post(s)
    Quoted
    16 Post(s)

    Default

    Use a begin and end after the If.

    And try FindColorTol.


    Send SMS messages using Simba
    Please do not send me a PM asking for help; I will not be able to help you! Post in a relevant thread or make your own! And always remember to search first!

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

    Default

    and include SRL by putting {.include SRL/SRL} below program in it and instead of movemousesmooth use mouse (for clicking) and mmouse (to not clicking)

  4. #4
    Join Date
    Aug 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hy71194 View Post
    Use a begin and end after the If.

    And try FindColorTol.
    Thanks, is FindColorTol a SRL? As im having trouble with it, Im getting

    Code:
    Failed when compiling
    Line 205: [Error] (364:1): Semicolon (';') expected in script C:\Program Files (x86)\SCAR 3.15\includes\SRL/SRL/Core/Math.scar
    Should i setup the respo to make sure its upto date?

    EDIT: Updated my SRL manually with the respo and it works fine, But the FindColorTol no go ><





    Quote Originally Posted by sirlaughsalot View Post
    and include SRL by putting {.include SRL/SRL} below program in it and instead of movemousesmooth use mouse (for clicking) and mmouse (to not clicking)

    You mean

    Code:
    {.include SRL/SRL.scar}
    ?

    Ive upped the tollerance quite high, But it just clicks in the top left corner of the area i have set to search within


    It'll be something simple..


    I added you on MSN Not sure if your on :P

  5. #5
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    your using 250 tolerance... Try 10?

    SCAR Code:
    program FindMonster;

    var
      x, y, LoopCount: Integer;

    procedure FindMonster;
    begin
      if(FindColorTolerance(x, y, 329034, 33, 127, 950, 720, 10))then
      begin
        MoveMouseSmooth(x, y);
        WriteLn('Mouse moving to (' + IntToStr(x) + ', '+IntToStr(y) + ')');
        Wait(3000 + Random(2000));
        ClickMouse(x, y, True);
        GetMousePos(x, y);
        WriteLn('Mouse @ (' + IntToStr(x) + ', ' + IntToStr(y) + ')');
        Wait(3000 + Random(2000));
      end;
    end;

    begin
      repeat
        FindMonster;
        LoopCount:= LoopCount + 1;
      until(LoopCount > 3)
    end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Procedure compiles but doesnt do anything
    By impiwimpi in forum OSR Help
    Replies: 3
    Last Post: 02-02-2009, 07:52 AM
  2. Fine tuning of the universe
    By bobng in forum Discussions & Debates
    Replies: 49
    Last Post: 01-25-2008, 11:29 PM
  3. Replies: 3
    Last Post: 10-02-2007, 11:39 AM
  4. Fine Tuning with proggy etc.
    By rkroxpunk in forum OSR Help
    Replies: 1
    Last Post: 03-25-2007, 03:35 PM

Posting Permissions

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