Results 1 to 9 of 9

Thread: Difference between two functions?

  1. #1
    Join Date
    Jun 2007
    Location
    Portugal, somewhere.
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Difference between two functions?

    I'm currently reading through WhoCares357's tutorial and I'm kinda in a holdup trying to understand the difference between two functions: FindColor and FindColorSpiral... Here's a quote from his tutorial:

    This is an example:
    ScarScript: By Drunkenoldma

    program FindColorExample2;

    var
    x,y: Integer;

    begin
    FindColorSpiral(x,y,293419,577,7,727,163);
    end.


    This function is the same as FindColor, except that it is used to find colors that take up a lot of space.
    "That take up a lot of space"... can anyone exemplify this please? I'm really not understanding any difference... FindColor searched from top left corner of coords to inferior right corner right? In what way? Each pixel going

    ----------------> (as if the o's were pixels)
    --->ooooooooooo
    ooooooooooooooo
    ooooooooooooooo
    ooooooooooooooo

    ?

    Or

    | |oooooo
    | |oooooo
    | |oooooo
    | \/oooooo
    \/oooooooo



    Or some other way? Dang I'm really confuse would highly appreciate some help! Thanks in advance !

    (Btw I know my ascii sucks )

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Findcolorspiral will look like this:
    0000000000000000000000000
    0000000000000000000000000
    00000%00000000#000000000
    00000000000000!!0000000000
    0000000000000000000000000
    0000000000000000000000000
    !! is the center point (the current position of the x and y vars).
    # and % are both the colour that you're looking for.
    It will look for the closest color to it, in this case #. If you used FIndColor it would find %
    I made a new script, check it out!.

  3. #3
    Join Date
    Jun 2007
    Location
    Portugal, somewhere.
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hm thanks for the reply mate cheers

    Though I had understood it looks for the closest color, I'd like to know how the findcolor function actually works, pixel sweep horizontally till color is found, vertically...something like it?? Let's suppose the colors were like this:

    *************************
    *************4***********
    *************************
    *************************
    *************************
    *************************
    ********3****!!***********

    !!=Current position of x and y
    3 and 4=Wanted colors

    The 4 looks farther than 3 to !! because of line gap, but imagine it as just the pixel units (*) and without inbetween line gap. 3 and 4 would be same distance away to !!, right? Then, how would it choose between both and how would findcolor work? Example: If it searched horizontally for pixel color:

    ------------------------------->
    --------------->4***********
    *************************
    *************************
    *************************
    *************************
    ********3****!!***********

    ----> = Search line direction

    With this way, searching pixels horizontally, ka-ching, 4 is found first, and supposedly it stops searching, right? BUT, if searching vertically... Searching first row from left to right, then second... etc.

    ||||||||*************
    ||||||||**4**********
    ||||||||*************
    ||||||||*************
    ||||||||*************
    ||||||||*************
    \/\/\/\/3****!!********

    3 would be found first!

    (Actually, at this point looking bacwards, it seems that I'm making a hella confusion about stuff... I'll leave my orientation here though, maybe it has a bit of rightness...)

    OR does it search from !! outwards? (Like a explosion, in a sort? A Square?)

    ********1111111******
    ********1000001******
    ********10ooo01******
    ********10o!!o01******
    ********10ooo01******
    ********1000001******
    ********1111111******

    First, proceeds to searching in first "explosion" wave, which are the o's. If no colour found, proceeds to second explosion wave, the 0's. If not, proceeds to searching for the color in third wave, the 1's, and so on...?




    EDIT: Hmm.... the point is, what's difference between FindColor and FindColorSpiral exactly? (lol, took me 20 mins to think about this and write it <.<)

  4. #4
    Join Date
    Mar 2007
    Location
    Maryland, USA
    Posts
    184
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ok FindColor would be this


    +------------------------------>
    |************4***********
    |************************
    |************************
    |************************
    |************************
    v*******3****!!***********


    FindColorSpiral would be like this


    *************************
    *************************
    *************************
    ***************4*********
    *************************
    *************************
    *********3***!!***********


    Looks for colors which take up space, and looks for the color closest to the !!
    which would be the 3 because the 3 is only 4 pixels away and the 4 is 5 pixels away
    Hope that helps ya

  5. #5
    Join Date
    Jun 2007
    Location
    Portugal, somewhere.
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for reply

    So, for FindColor, starting from top left specified corner, it sweeps a horizontal line to the right and a vertical one downwards? And FindColorSpiral just looks for closest identical color starting from !! ??? Hmmm I think I understand now thans a lot guys

  6. #6
    Join Date
    Mar 2007
    Location
    Maryland, USA
    Posts
    184
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yay i helped someone lol

  7. #7
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol, i dont get it, but do u think it wud relly matter that much if u used findcolor in a place where u shudve used findcolorspiral?
    Originally Posted by YoHoJo
    I like hentai.

  8. #8
    Join Date
    May 2007
    Posts
    76
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    well yes and no because, if you are mining a rock and want to mine the closest one you would use findcolorspiral but that sometimes leads to you clicking on the ores you have just dropped so i normally do this in a mining procedure:
    SCAR Code:
    if FindColorSpiralTolerance(Rx,Ry,RClr,MSx1,MSy1,MSx2,MSy2,ClrTol) then
     begin
     MMouse(Rx,Ry,0,0);
     wait(100);
     if IsUpText('ine') then
      begin
      Mouse(Rx,Ry,0,0,True);
      end
     else
      begin
      if FindColorTolerance(Rx,Ry,RClr,MSx1,MSy1,MSx2,MSy2,ClrTol) then
       begin
       MMouse(Rx,Ry,0,0);
       wait(100);
       if IsUpText('ine') then
        begin
        Mouse(Rx,Ry,0,0,true);
        end;
       end;
      end;
     end;

  9. #9
    Join Date
    May 2007
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Findcolorspiral will look like this:
    0000000000000000000000000
    0000000000000000000000000
    00000%00000000#000000000
    00000000000000!!0000000000
    0000000000000000000000000
    0000000000000000000000000
    !! is the center point (the current position of the x and y vars).
    # and % are both the colour that you're looking for.
    It will look for the closest color to it, in this case #. If you used FIndColor it would find %
    it wud just find both colors n click one of them.
    Originally Posted by YoHoJo
    I like hentai.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. What is the difference between := and =
    By Macrosoft in forum OSR Help
    Replies: 3
    Last Post: 09-19-2007, 05:13 AM
  2. The difference between a pass (F) and a distinction (A)
    By Distort in forum The Bashing Club / BBQ Pit
    Replies: 7
    Last Post: 06-23-2007, 09:51 PM
  3. Replies: 10
    Last Post: 10-27-2006, 05:01 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
  •