Results 1 to 5 of 5

Thread: new autocolor function quite fast

  1. #1
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default new autocolor function quite fast

    will update tongiht so that the main colour can be selected in the function declaration


    this is used to locate dynamic colours and find what the current colour is =]

    SCAR Code:
    program autocolorit;
    {.include srl\srl.scar}


    function autocolorit(color,tolmod,tol:integer):integer;
    var
    x,y,ncolor,pcolor,tcolor,rcolor:integer;
    begin
      ncolor:=color;
      pcolor:=color;
      begin
        if findcolorspiraltolerance(x,y,color,mmx1,mmy1,mmx2,mmy2,0) then
        writeln('color is '+inttostr(color));
      end;
      if (not(findcolorspiraltolerance(x,y,color,mmx1,mmy1,mmx2,mmy2,0))) then
      repeat
        ncolor:=ncolor-tolmod;
        pcolor:=pcolor+tolmod;
        //wait(100);
      until((findcolorspiraltolerance(x,y,ncolor,mmx1,mmy1,mmx2,mmy2,tol)or(findcolorspiraltolerance(x,y,pcolor,mmx1,mmy1,mmx2,mmy2,tol))));
      rcolor:=pcolor;
      if findcolorspiraltolerance(x,y,ncolor,mmx1,mmy1,mmx2,mmy2,10) then rcolor:=ncolor;
      writeln('color is '+inttostr(rcolor));
     
     
     

    end;

    begin
    cleardebug;
        setupsrl;
        makecompass('N');
        autocolorit(1);    
    end.
    Blank!

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

    Default

    This can get a wrong color. If you pick a color, then you logout, change the world and you try it, you may get another color since there are a lot of differents colors in the minimap.


  3. #3
    Join Date
    Apr 2008
    Location
    Northwest england
    Posts
    1,179
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yer i know i can make it almost perfect easy but it is slower
    im gunna edit it a little biit and make it a hell of alot better

    it works good for finding roads that cant be found by the other autocolor functions

    its mainly for scripters so they can use it and then the user doesnt have to pick the colors eithen if they are dynamic


    it shud get the closet colour perfect if tol mod and tol are set to 1(might be 0 which ever is lowest)
    Blank!

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

    Default

    Quote Originally Posted by waddo View Post
    yer i know i can make it almost perfect easy but it is slower
    im gunna edit it a little biit and make it a hell of alot better

    it works good for finding roads that cant be found by the other autocolor functions

    its mainly for scripters so they can use it and then the user doesnt have to pick the colors eithen if they are dynamic
    For Road they can use SRL's autocolorers. So make an AutoColor functions for something more dynamic, like mine's.


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

    Default

    With Scar's colours, - or +'ing a number onto it will change one of the RGB values and not all 3 (will have a different affect on HSL or XYZ numbers) due to the way Scar sets them up. Have an RGB converter to make sure that it evenly applies the minimum and maximum colour searches and they will take way under 1ms so not slow the script down.
    Edit: Change the Blue value by the way as I believe Scar makes colours by (R * 255 * 255) + (G * 255) + B.
    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. A Little New Autocolor Function By Me...
    By Pure1993 in forum Research & Development Lounge
    Replies: 21
    Last Post: 05-12-2008, 08:19 PM
  2. Universal AutoColor function
    By Cazax in forum Research & Development Lounge
    Replies: 3
    Last Post: 02-28-2008, 01:50 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
  •