Results 1 to 15 of 15

Thread: a massive well done to nielsie

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

    a massive well done to nielsie

    I recently came up with a script for walking it was no good but the concept was great however i was unable to get any where near what i needed

    i described it to nielsie and he has created it it is the most road walking script i have ever seen


    http://www.srl-forums.com/forum/wadd...tml#post385517
    thats my miner which uses this the walking is prety good (not perfect and thats cos of ddtms and radialwalk not this lol)

    go on nielsie you are a leg-end

    SCAR Code:
    program New;
    {.include SRL/SRL.scar}

    function FindEdges(P: TPointArray): TPointArray;
    var
      b: array of array of Boolean;
      i, x, y, l, c: Integer;
      Box: TBox;
    begin
      SetLength(Result, 0);
      l := Length(p);
      Box := GetTPABounds(p);
      x := (Box.x2 - Box.x1) + 3;
      y := (Box.y2 - Box.y1) + 3;
      SetLength(b, x);
      for i := 0 to x -1 do
        SetLength(b[i], y);
      for i := 0 to l -1 do
        b[p[i].x +1 - Box.x1][p[i].y +1 - Box.y1] := True;
      SetLength(Result, l);
      c := 0;
      for i := 0 to l -1 do
        for x := -1 to 1 do
          for y := -1 to 1 do
            try
              if not b[p[i].x + 1 + x - Box.x1][p[i].y + 1 + y - Box.y1] then
              begin
                Result[c] := p[i];
                Inc(c);
                x := 2;
                Break;
              end;
            except end;
      SetLength(Result, c);
    end;

    procedure QuickSortExtendedTPA(var A: TExtendedArray; var B: TPointArray; iLo, iHi: Integer) ;
    var
      Lo, Hi: Integer;
      P: TPoint;
      T, M: Extended;
    begin
      Lo := iLo;
      Hi := iHi;
      M := A[(Lo + Hi) shr 1];
      repeat
        while (A[Lo] < M) do Inc(Lo);
        while (A[Hi] > M) do Dec(Hi);
        if (Lo <= Hi) then
        begin
          T := A[Lo];
          P := B[Lo];
          A[Lo] := A[Hi];
          B[Lo] := B[Hi];
          A[Hi] := T;
          B[Hi] := P;
          Inc(Lo);
          Dec(Hi);
        end;
      until (Lo > Hi);
      if (Hi > iLo) then QuickSortExtendedTPA(A, B, iLo, Hi);
      if (Lo < iHi) then QuickSortExtendedTPA(A, B, Lo, iHi);
    end;

    function EdgeRoadWalkEx(var rx, ry: Integer; Color, Tolerance, Degree: Integer; SameRoad: Boolean): Boolean;
    var
      p, c: TPointArray;
      q, z: T2DPointArray;
      i, ii, l, ll, Dist, cc, ec: Integer;
      d: TExtendedArray;
    begin
      FindColorsTolerance(p, Color, MMX1, MMY1, MMX2, MMY2, Tolerance);
      Degree := Degree mod 360;
      q := SplitTPAEx(p, 2, 2);
      SetLength(p, Length(q));
      ll := 0;
      for ii := 0 to High(q) do
      begin
        if (Length(q[ii]) < 200) then Continue;
        c := FindEdges(q[ii]);
        l := Length(c);
        //DebugTPA(c);
        //Wait(3000);
        cc := 0;
        ec := 0;
        for i := 0 to l -1 do
        begin
          Dist := Distance(MMCX, MMCY, c[i].x, c[i].y);
          //WriteLn(IntTostr(Dist));
          if (Dist < 4) then
            Inc(cc);
          if (Dist < 65) then
            c[i] := Point(-1, -1)
          else
            Inc(ec);
        end;
        //WriteLn(IntToStr(ec)+', '+IntToStr(cc));
        if (ec > 5) and (((cc > 5) and SameRoad) or (not SameRoad)) then
        begin
          z := SplitTPAEx(c, 3, 3);
          for ec := 0 to High(z) do
            if (Length(z[ec]) > 6) and (z[ec][0].x > -1) then
            begin
              SetLength(p, ll + 1);
              p[ll] := MiddleTPA(z[ec]);
              Inc(ll);
            end;
        end;
      end;
      if (ll = 0) then Exit;
      if (ll > 1) then
      begin
        SetLength(p, ll);
        SetLength(d, ll);
        for i := 0 to ll -1 do
        begin
          d[i] := Degrees(ArcTan2(p[i].y - MMCY, p[i].x - MMCX) + 1.570796);
          while (d[i] < 0.0) do
            d[i] := d[i] + 360.0;
          d[i] := MinE(Abs(Degree - d[i]), MinE(Abs((Degree + 360) - d[i]), Abs(Degree - (d[i] + 360))));
        end;
        QuickSortExtendedTPA(d, p, 0, ll -1);
      end;
      rx := p[0].x;
      ry := p[0].y;
      SetLength(d, 1);
      d[0] := Degrees(ArcTan2(ry - MMCY, rx - MMCX) + 1.570796);
      while (d[0] < 0.0) do
        d[0] := d[0] + 360.0;
      Result := (MinE(Abs(Degree - d[0]), MinE(Abs((Degree + 360) - d[0]), Abs(Degree - (d[0] + 360)))) < 30.0);
    end;

    function EdgeRoadWalk(Color, Degree: Integer; SameRoad: Boolean; xMod, yMod: Integer): Boolean;
    var
      x, y: Integer;
    begin
      if EdgeRoadWalkEx(x, y, Color, 0, Degree, SameRoad) then
      begin
        MFNF(x, y, xMod, yMod);
        wait(100);
        FFlag(10);
        Result := True;
      end;
    end;

    begin
      SetupSRL;
      RoadColor := FindRoadColor;
      WriteLn(BoolToStr(EdgeRoadWalk(RoadColor, 90, True, 0, 1)));
    end.


    and nielsie you say its not that good again ill slap you =]
    Blank!

  2. #2
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    oh neat so its everywhere walker?

    like lumby to draynor /draynor to varry?

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

    Default

    yep as long as there is a road

    and it shouldnt really get lost either =]
    Blank!

  4. #4
    Join Date
    Oct 2007
    Location
    If (Online) then Loc := ('On comp') else Loc := ('Somewhere else!');
    Posts
    2,020
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    umm sound ok cant wait to see it released

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

    Default

    no you underestimate it the time ive spent trying to perfect my banking on my miner and its still no where near perfect
    took 10 mins to replace with this no failsafes and is almost perfect no just adjusting this and that but once i haveit probly will be perfect (without failsafes)


    (and nielsie doesnt think its good enough yet (only improvement i can think of is small and ive told him and he is going to do it) dont know what he thinks is wrong)
    Blank!

  6. #6
    Join Date
    Jul 2007
    Location
    Norway.
    Posts
    1,938
    Mentioned
    3 Post(s)
    Quoted
    0 Post(s)

    Default

    I seriously love Nielsie.
    He´s rly cool.

    And, I laugh inside me every time I think of 'the look he has when he´s banning noobs'.

    Anyway. Can I take a look at the script? (PM..?)

  7. #7
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    yes i like him alot, he treats everyone the same / and is really fair keep it up nielsal even tho its hard to spell your name

  8. #8
    Join Date
    Sep 2006
    Posts
    6,089
    Mentioned
    77 Post(s)
    Quoted
    43 Post(s)

    Default

    Thanks guys

    It's a function, not a script, and it's not that great Basically it finds the road you are standing on and finds the edges of the road on the edge of the MiniMap. Then it searches the part of the road that is closest to what you enter. When the road is broken up (by a symbol for example) it stops working though.

    Waddo, you can post it if you want.
    Hup Holland Hup!

  9. #9
    Join Date
    Jul 2007
    Location
    Ohio
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nielsie95 View Post
    Thanks guys

    It's a function, not a script, and it's not that great Basically it finds the road you are standing on and finds the edges of the road on the edge of the MiniMap. Then it searches the part of the road that is closest to what you enter. When the road is broken up (by a symbol for example) it stops working though.

    Waddo, you can post it if you want.
    That is so sweet!! You are the coolest Nielsie and can you get any more awards under your name lol?? Haha you need some more room!!! Waddo please post it.

  10. #10
    Join Date
    Jun 2007
    Posts
    1,312
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    [british accent]A massive well done old chum, a massive well done![/british accent]
    Active only during the Summer...

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

    Default

    lol hermpie

    and p1nky you have same views bout nielsie as i hae and his name is easy to spell remember lsei looks stupid and its ie ie so nIElsIE lol =]

    and the way tou creat functions is in script style (thats why you put program at the top =] rite ill edit my first post and include it now

    nielsies rep is disabled as if it wasnt the world would blow up as it would be infinite

    hmm nielsie is a real life example of what comes aound he nice friendly and helpfull and very one loves him and respects him

    bet he feels well happy =]
    Blank!

  12. #12
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Hermpie View Post
    |_| 4r3 7h3 |337357 n13|513 w3 |0v3 y0u p|5 |37 15 |34rn m0r3 4nd r3|3453 y0ur 5(r1p7 50 w3 (4n |33(h 17 w007, 4|50 1 |0v3 7h15 n3w f1r3f0x p|u61n 15 5p33k5 1n |337 1 n3v3r (0u|d d0 7h47 w000h00007 u kn0w 7h15 15 v3ry (0000||
    My god, I read that o.O.


    Nice Function Nielsie!

  13. #13
    Join Date
    Apr 2008
    Location
    hy71194 made my change -.-
    Posts
    356
    Mentioned
    0 Post(s)
    Quoted
    3 Post(s)

    Default

    nice work



    [/URL

  14. #14
    Join Date
    Jul 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    really, nobody thought of using the roads to walk from town to town. You're kidding right.

    Well, kudos to you i guess!

  15. #15
    Join Date
    Jan 2007
    Location
    Illinois.. >.<
    Posts
    1,158
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Everyone thought of it obviously, however a failsafe way to do it was not developed until recently.. Great work(as usual) Nielsie!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. The Massive autofighter need ALOT of help
    By RudeBoiAlex in forum OSR Help
    Replies: 7
    Last Post: 08-10-2007, 12:43 PM
  2. a massive autoresponder
    By scar_ownz in forum SRL Site Discussion
    Replies: 2
    Last Post: 09-09-2006, 06:19 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
  •