Results 1 to 5 of 5

Thread: What's the formula for searching X,Y zone's Around your player?

  1. #1
    Join Date
    Jul 2008
    Location
    NSW, Australia
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default What's the formula for searching X,Y zone's Around your player?

    That is searching 100 zones of the main Screen, problem is its from top left to bottom right, I need it to go around my player but not being so good at math I'm not sure how to go about it unless, I could be bothered making the zone's by hand which would be a complete ad utter mess in my script.

    I'm going to use this to find Chicken's accurately so it moves from Chicken to Chicken instead of just at the same one, this is how I plan on getting around most color detection mess ups also moving to the next npc if their is a hp bar etc

    Code:
    Case times of
    2..10: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    11..11: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2}  end;
    12..20: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    21..21: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
    22..30: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    31..31: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
    32..40: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    41..41: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
    42..50: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    51..51: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2}end;
    52..60: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    61..61: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2}  end;
    62..70: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    71..71: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
    72..80: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    81..81: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
    82..90: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    91..91: begin u:=2; i:=i+31;{x2} o:=3; p:=p+31;{x2} end;
    92..100: begin u:=u+51;{x1} o:=o+51;{x2} {y2} end;
    End;

  2. #2
    Join Date
    Dec 2006
    Location
    Sydney, New South Wales, Australia
    Posts
    4,603
    Mentioned
    15 Post(s)
    Quoted
    42 Post(s)

    Default

    MakeSpiralPath for a circle around your character. But, you could just use a repeat and a for loop incrementing by a factor 1 to do what you want
    You may contact me with any concerns you have.
    Are you a victim of harassment? Please notify me or any other staff member.

    | SRL Community Rules | SRL Live Help & Chat | Setting up Simba | F.A.Q's |

  3. #3
    Join Date
    Jul 2008
    Location
    NSW, Australia
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Hmmm kool, but I don't think the area's would be small enough for chicken's if two chicken's are in the same area circle it wont check the first one and then check the second one if the first ones in combat, I need multiple zones seperated from eachother
    Last edited by Sir Ducksworthy; 03-15-2012 at 08:25 AM.

  4. #4
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Learn TPAs/ATPAs. With those you can get each chicken in to their own 'Box' that can be 'Seen' by the script. Along with min and max pixel checking to completely ignore anything that isn't a chicken. The same goes with a distance checker to see if the distance between the chicken and the player is over or under X amount of pixels, do so and so.

    That would be your best bet, anyway.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  5. #5
    Join Date
    Jul 2008
    Location
    NSW, Australia
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    Cheers man

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
  •