Results 1 to 12 of 12

Thread: DRSARed(Auto Coloring Function By Me) * old

  1. #1
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Exclamation DRSARed(Auto Coloring Function By Me) * old

    Code:
    function DRSARed(RedArrowcol:integer):boolean;
    var xm,ym:integer;
    begin
      if FindMSColor(x,y,RedArrowCol)then
      begin
        GetMousePos(x,y);
        xm:=x;
        ym:=y;
        curcolor:=GetColor(xm,ym);
        Result:=True;
      end;
    Writeln('Current color is:'+ IntToStr(curcolor) + '!')
    end;
    Let Me explain, DRSARed, Is a method, to bring back autocolors into scar scripts. It was first used in my powerminer. Let me explain what it does. It is designed to run after you perform a click on an object, Such as clicking on an iron vein, In a rock. It runs after that function that clicks the iron, And it detects the Small red 'X'(THE SMALL RED 'X's COLOR IS ALWAYS 255, To CALL THIS FUNCTION, YOU WOULD TYPE DRSARed(255);) That appears for short period of time. Look At the picture below.


    It detects what the arrow is pointing at. Then once it detects that it gets the color of where the mouse is at, In this case it was on an iron vein, On a rock. Look below to see what color it clicks and reads into scar.



    As you can see here it gets the color directly below where the red 'X' Was.

    So now you are asking me, How do I get this to work for me? Here is my answer. There is a variable in my function called, Curcolor. alls you have to do is after you run DRSARed(255); You would have the variable color you want to change, In my example it will be called 'Orecolor'. Here is an example of how it is used.

    Code:
    if(FindObj(x, y, 'Mine', orecolor, oretol1))then
        begin
          Mouse(x,y,0,0,true)
          DRSARed(255);
          OreColor := CurColor;
    Let me explain this code to you, For those begginner scripters, Or those who do not understand fully. If it finds the text 'Mine' and the orecolor(A global variable) and a certain preset tolerance then it will mouse the mouse to where the color/text is found. Then DRSA run and it gets the color of where you clicked. Then after that you set your variable(Orecolor in this case) :=Curcolor;

    And that is how you use my function. I hope it will sooner or later be implemented into srl, So everyone can get back on the right track with autocolors. DO NOT USE THIS TO MAPWALK, IF YOU WANT TO MAPWALK, USE RADIALWALK. Dont know what RadialWalk is? It is a genius function made by Fakawi, You can read about it here http://82.92.130.193/forums/showthread.php?t=452

    Hope this was insightful, into re-autocoloring scar scripts

    ~db_cheater~

  2. #2
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Why is this in the tutorial section if it's just a script?

  3. #3
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This is a different, good, and interesting idea to do AutoColorFinding.

    A question though.
    1) The arrow color has to be set each time?

  4. #4
    Join Date
    Feb 2006
    Location
    Australia, NSW.
    Posts
    1,461
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by XxKanexX
    Why is this in the tutorial section if it's just a script?
    My bad. You edited it an added information. Ty

    Good tutorial.

  5. #5
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    @:Kane: Thanks for teh comment

    @:Whiteshadow: No, Alls you have to do is(For now) Copy my procedure into your script, and call it DRSA(255); and then set your variable you want to change constantly.(No you do not have to change arrow color all the time, It stays the same

  6. #6
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Than you don't even need the params, if they're never going to change. Well that's what I do. If a procedure/function I make is suppose to be made to post somewhere, I make params that are only needed.

    And again, great job!

  7. #7
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The reason it has params is because I was considering making a version where you could map walk (DRSAYellow)

  8. #8
    Join Date
    Feb 2006
    Posts
    1,022
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    An intresting idea. Still, tolerance is better in my opinion because you just need to press play .

  9. #9
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Tolerance can throw off scripts at alarming rates.

  10. #10
    Join Date
    Apr 2006
    Location
    California
    Posts
    555
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I will try this out when I attempt to make my first script.

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

    Default

    This looks interesting, and I wanted to do a similar thing to detect 'mis-clicks' (where it would be a yellow X instead of a red one).

    Do you run this procedure directly after the Mouse procedure you use? And how reliable is it? Does it detect the X every time or only once in a while?

  12. #12
    Join Date
    May 2006
    Location
    West Coast
    Posts
    820
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    in my pminer it detects the right color all the time

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to Use SRL succesfully and where to save it
    By Sdcit in forum Outdated Tutorials
    Replies: 30
    Last Post: 09-06-2007, 12:54 AM
  2. Auto coloring + DTM tut
    By ub3r |<1||3r*1337* in forum OSR Advanced Scripting Tutorials
    Replies: 18
    Last Post: 05-03-2007, 04:02 PM
  3. auto rock coloring help
    By scarscaper4life in forum OSR Help
    Replies: 1
    Last Post: 03-18-2007, 09:53 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
  •