Results 1 to 4 of 4

Thread: Function AutoColor(Thing : String) : integer;

  1. #1
    Join Date
    Oct 2006
    Location
    finland, helsinki
    Posts
    2,501
    Mentioned
    3 Post(s)
    Quoted
    2 Post(s)

    Default Function AutoColor(Thing : String) : integer;

    SCAR Code:
    function AutoColor(Thing : String) : integer;
    begin
      if not loggedin then exit;
      Writeln('');
      Writeln('Hover Your Mouse Over ' + Thing);
      repeat
        if not loggedin then break;
        wait(500);
      until(IsUpText(Thing));
       if not loggedin then exit;
       Getmousepos(x,y);
       MMouse(x,y,2,2)
       Result:= GetColor(x,y);
       writeln('Color = ' + inttostr(Result));
    end;

    SCAR Code:
    {.include srl/srl.scar}

    var color : integer;

    function AutoColor(Thing : String) : integer;
    begin
      if not loggedin then exit;
      Writeln('');
      Writeln('Hover Your Mouse Over ' + Thing);
      repeat
        if not loggedin then break;
        wait(500);
      until(IsUpText(Thing));
       if not loggedin then exit;
       Getmousepos(x,y);
       MMouse(x,y,2,2)
       Result:= GetColor(x,y);
       writeln('Color = ' + inttostr(Result));
    end;

    begin
     Setupsrl;
     Color:= AutoColor('Tree')
     Writeln('Color: ' + inttostr(Color))
    end.

    basically u just run this and hover ur mouse over a tree or something that will trigger the keyword of (Autocolor('Tree')) in that case Tree.

    when u move ur mouse over a tree it will pick a color of the tree.
    dunno if this already exists in SRL, if not add it or.. this autocolor will not be there..

    Code:
    • Narcle: I recall Jukka releasing a bunch of scripts like this before... Its how he rolls I think. rofl
    • Solarwind: Dude, you are like... t3h s3x.
    • Hy71194: JuKKa you're a machine! You released 3 scripts in 10 minutes! :O
    • benjaa: woah.... Jukka is the man Guildminer pwns all
    • NaumanAkhlaQ: And JuKKa Is my Her0!

  2. #2
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Or just use SCAR's color picker...
    Or the easy way:
    SCAR Code:
    Function New:Integer;
    var Color:Integer;
    begin
    FindObj(x,y,'Tree',4255234,5)
    Result:=Getcolor(x,y)
    end;

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    2,984
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    i kinda agree with Pentti as soon as it spots Tree, or whatever you want, it will take the color, but the box in which the mouse must be for it to show Tree isnt always exactly on the tree if im not mistaking. Besides that, the edges usually are more dark than the middle.
    Administrator's Warning:


  4. #4
    Join Date
    Mar 2006
    Posts
    3,051
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Perhaps increase the delay between checks, and give some sort of feedback in the status bar so the person knows when it's checking.

    Like you could have it wait 3 seconds, and have a countdown in the status bar like...

    Code:
    function AutoColor(Thing : String) : integer;
    var i:integer;
    var e:extended;
    begin
      if not(LoggedIn) then exit;
      Writeln('');
      Writeln('Hover Your Mouse Over ' + Thing);
      repeat
        if not(LoggedIn) then exit;
        i:=0;
        repeat
          if not(LoggedIn) then exit;
          i:=i+1;
          wait(100);
          e:=3-(i*0.1);
          Status('Checking color in '+FloatToStr(e)+' seconds...');
        until(i>=30);
        Status('Checking color!');
        Wait(250);
      until(IsUpText(Thing));
      if not loggedin then exit;
      Result:= GetColor(x,y);
      writeln('Color = ' + inttostr(Result));
    end;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 03-30-2008, 01:40 PM
  2. function SendKeyboard(FKey:Integer; Text:String): Integer;
    By Daniel in forum Research & Development Lounge
    Replies: 4
    Last Post: 07-18-2007, 04:28 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
  •