Results 1 to 11 of 11

Thread: colour switching finding function :p help appreciated

  1. #1
    Join Date
    Feb 2012
    Posts
    212
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default colour switching finding function :p help appreciated

    Hello

    I'm trying to do a little bit of coding that will search for a colour, if unable to detect the colour will try searching for a new colour and use that as the colour to be searched from then on.

    Basically I need this because the colours will change slightly between users / logouts and what not. My problem is objectTPAs don't seem to stop searching until it finds the colour, I tried objcustom function and it still took to long to find the colour. What i need is if it can't find the colour straight away, as in not move the cursor all around the screen, then begin looking for a new colour. If anyone has any ideas they think may help post please! Thanks guys for reading. code is below

    Simba Code:
    Procedure NewColourPatch;

    var
      i: Integer;

    begin

      case i of
        0:
          begin
            PatchColour:= 5664128
            i:= i + 1
            writeln('1')
          end;
        1:
          begin
            PatchColour:= 4700000
            i:= i + 1
            writeln('2');
          end;
        2:
          begin
            PatchColour:= 4939375
            i:= 0
            writeln('3');
          end;
      end;
    end;

    Procedure WalkPatch;

    var
      x, y: Integer;
      walked: boolean;


    begin
      repeat
        Path:= Patch
        Walk;
        repeat
          Wait(100);
        until(IsMoving = false);
        x:=MSCx
        y:=MSCy
        if FindObjTPA(x, y, PatchColour, 5,  1, 10, 10, 5, ['arming patch']) then
          begin
            mouse(x, y, 5, 5, 0);
            if WaitOption('alk here', 300) then
              walked:= true
          end else
          begin
            walked:= false
            NewColourPatch;
          end;
      until(walked = true)
    end;

  2. #2
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    I think you're over complicating it, nice idea though you're brain is cooking!
    Just do

    Simba Code:
    If Not FindObjTPA(x, y, PatchColour1, 5,  1, 10, 10, 5, ['arming patch']) then
      If Not FindObjTPA(x, y, PatchColour2, 5,  1, 10, 10, 5, ['arming patch']) then
        If Not FindObjTPA(x, y, PatchColour3, 5,  1, 10, 10, 5, ['arming patch']) then
        Begin
          Writeln('All of our path colors suck!');
          Logout;
        End;

    Something similar to that will take care of it!

  3. #3
    Join Date
    Feb 2012
    Posts
    212
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    I think you're over complicating it, nice idea though you're brain is cooking!
    Just do

    Simba Code:
    If Not FindObjTPA(x, y, PatchColour1, 5,  1, 10, 10, 5, ['arming patch']) then
      If Not FindObjTPA(x, y, PatchColour2, 5,  1, 10, 10, 5, ['arming patch']) then
        If Not FindObjTPA(x, y, PatchColour3, 5,  1, 10, 10, 5, ['arming patch']) then
        Begin
          Writeln('All of our path colors suck!');
          Logout;
        End;

    Something similar to that will take care of it!
    thats only a LITTLE bit simpler than mine :P

    haha kidding but its gonna have to end up like searching through 10 different colours or something and with tpas to get to, if its the last colour, will spam the mouse all around the screen. So I think i need something that will search like really quickly, if unable to find try a new colour until it finds one and sets it as default. Because it will be doing the search all over again in like 30 secs it needs to be pretty accurate, so any ideas on this? thanks for reply

  4. #4
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Check out Smartcolor, it's in the srl include and could be just what you're looking for?

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Learn to use ACA and you will only need one color .
    http://youtu.be/98wVrr6GwyU
    ^ Video tutorial I made about it.

    Good luck.

  6. #6
    Join Date
    Feb 2006
    Location
    Aussie
    Posts
    937
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    http://villavu.com/forum/showthread.php?t=52915

    ^^smartcolors

    I'm going to have to look at ACA, but smartcolors seems like an interesting idea.

  7. #7
    Join Date
    Feb 2012
    Posts
    212
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thankyou for that link, I was looking at the include and didn't have any idea how it worked.

    I'll try work this out, thanks guys for the help, much appreciated!

    and I don't think I can use ACA because the colour of the actual object changes
    btw thanks for the utube tuts, they helped me out so much

  8. #8
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    How much does the color change?
    Like A LOT like from red to green to blue?!

  9. #9
    Join Date
    Feb 2012
    Posts
    212
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    just different shades of brown

  10. #10
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Well then... that's EXACTLY what ACA is for!
    Try it! Pick all the shades of brown, and test how accurate it finds them (and hopefully not other unrelated things).

  11. #11
    Join Date
    Feb 2012
    Posts
    212
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    okay, i wil ltry out both suggestions :P

Thread Information

Users Browsing this Thread

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •