Results 1 to 6 of 6

Thread: A question.

  1. #1
    Join Date
    May 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default A question.

    How would I write a script that clicks something if it finds a color at a certain position? I was trying

    SCAR Code:
    procedure click;
    begin
    If(Getcolor(316, 260)=16777215) then
    clickMouse(254, 305, True);
    wait(1000)
    clickMouse(355, 274, True);
    end;
    but it just clicked at the cords, without the color even being there.

    Edit: Maybe something to do with an "else"? I'm not sure
    if thats whats wrong then please tell me.

  2. #2
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    well mabey you might want it to find an actual color and use actual variables
    SCAR Code:
    {.include srl/srl.scar}
    var
    x, y: integer;

    begin
      SetupSRL;
      if FindColor(x, y, 32992, 0, 0, 999, 999) then
        MMouse(x, y, 3, 3);
    end.
    that should work from what i can see

    ~shut

  3. #3
    Join Date
    May 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thank you, now how would I make it check for a color every 20 or so seconds and if it finds it then it starts the procedure?

    Edit:
    Here's what I have so far, this is supposed to be for a RSC private server.
    SCAR Code:
    program Autofighter;
    //Sean's Auto Fighter, for Runescape Classic private servers.
    //Log in once then start the script.
    var
    x, y: integer;
    procedure login;
    begin
    if FindColor(x, y, 3647357, 339, 321, 339, 321) then //Logs you in.
    clickMouse(252, 313, True);
    wait(1000);
    KeyDown(13);
    wait(500);
    KeyUp(13);
    wait(500) ;
    KeyDown(13);
    wait(500);
    KeyUp(13);
    wait(500);
    KeyDown(13);
    wait(500);
    KeyUp(13);
    wait(1500);
    if FindColor(x,y,65535,270,162,270,162) then
    clickMouse(279, 221, True);
    end;
    procedure sleep;  //Sleeping, works on ******* ***, not used yet.
    begin
    moveMouse(489, 39);
    wait(1000);
    moveMouse(289, 75);
    wait(1500);
    clickMouse(
    289, 75,True);
    end;
    procedure logincheck; //Checks if your logged in not needed?
    begin
    if FindColor(x,y,130219,271,88,271,88) then
    login;
    end;
    procedure main; //Calls other procedures
    begin
    wait(10000);
    logincheck;
    end;
    begin
    repeat
    main;
    until(false)
    end.
    Please tell me if this kind of script is not aloud,
    also, tell me how I can make the script simpler, as this is my first one.
    Edit: also, it's working how It's supposed to, but is there a better way to do it?

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, California
    Posts
    276
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program Autofighter;
    //Sean's Auto Fighter, for Runescape Classic private servers.
    //Log in once then start the script.
    var
    x, y: integer;
    procedure login;
    begin
      if FindColor(x, y, 3647357, 339, 321, 339, 321) then //Logs you in.
      begin
        clickMouse(252, 313, True);
        wait(1000);
        KeyDown(13);
        wait(500);
        KeyUp(13);
        wait(500) ;
        KeyDown(13);
        wait(500);
        KeyUp(13);
        wait(500);
        KeyDown(13);
        wait(500);
        KeyUp(13);
        wait(1500);
      end;
    if FindColor(x,y,65535,270,162,270,162) then
    begin
      clickMouse(279, 221, True);
    end;
    procedure sleep;  //Sleeping, works on ******* ***, not used yet.
    begin
      moveMouse(489, 39);
      wait(1000);
      moveMouse(289, 75);
      wait(1500);
      clickMouse(
      289, 75,True);
    end;

    procedure logincheck; //Checks if your logged in not needed?
    begin
      if FindColor(x,y,130219,271,88,271,88) then
      login;
    end;

    procedure main; //Calls other procedures
    begin
      wait(10000);
      logincheck;
    end;
    begin
      repeat
        main;
      until(false)
    end.
    Fixed it up a little for ya(h)
    Current Project: All In 1 Falador Script - 20% DONE

  5. #5
    Join Date
    Jun 2007
    Location
    Liverpool ,Nsw,Australia
    Posts
    740
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    But fails to add standards...

    SCAR Code:
    program Autofighter;
    //Sean's Auto Fighter, for Runescape Classic private servers.
    //Log in once then start the script.
    var
      x, y: integer;

    procedure login;
    begin
      if FindColor(x, y, 3647357, 339, 321, 339, 321) then //Logs you in.
      begin
        clickMouse(252, 313, True);
        wait(1000);
        KeyDown(13);
        wait(500);
        KeyUp(13);
        wait(500);
        KeyDown(13);
        wait(500);
        KeyUp(13);
        wait(500);
        KeyDown(13);
        wait(500);
        KeyUp(13);
        wait(1500);
      end;
      if FindColor(x, y, 65535, 270, 162, 270, 162) then
      begin
        clickMouse(279, 221, True);
      end;

    procedure sleep; //Sleeping, works on ******* ***, not used yet.
    begin
      moveMouse(489, 39);
      wait(1000);
      moveMouse(289, 75);
      wait(1500);
      clickMouse(
        289, 75, True);
    end;

    procedure logincheck; //Checks if your logged in not needed?
    begin
      if FindColor(x, y, 130219, 271, 88, 271, 88) then
        login;
    end;

    procedure main; //Calls other procedures
    begin
      wait(10000);
      logincheck;
    end;
    begin
      repeat
        main;
      until (false)
    end.
    Quote Originally Posted by Darkmage View Post
    I got 2 questions'
    #1. When i run the script will it automatically pick up the mouse and move?

  6. #6
    Join Date
    Feb 2008
    Location
    Norway
    Posts
    278
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why just not use SRL functions, will be much easyer, and will short the code down really much...
    99 woodcutting

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. i has a question
    By Solkrieg in forum OSR Help
    Replies: 5
    Last Post: 10-30-2008, 08:20 AM
  2. tab 5 question
    By dvdcrayola in forum OSR Help
    Replies: 4
    Last Post: 07-04-2008, 06:43 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
  •