Page 2 of 2 FirstFirst 12
Results 26 to 34 of 34

Thread: My code

  1. #26
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    @Negaal:

    a) I r <3 Result :=
    b) Thanks for the 2ms...

    Feel free to use...
    i presume you mean footballjds? and you don't mind if i use right? remember it is in a jr mem script and this is the srl member section, thats why im asking.

  2. #27
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Oh, sorry, I mean footballjds, yea, you can use. Yea if you credit...

  3. #28
    Join Date
    Feb 2007
    Location
    PA, USA
    Posts
    5,240
    Mentioned
    36 Post(s)
    Quoted
    496 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    Oh, sorry, I mean footballjds, yea, you can use. Yea if you credit...
    i said i would credit

    ofcourse il credit, //from n3ss3s awesome n3ss3s SUPER HERO n3ss3s

  4. #29
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For your WhirlPool...
    Unknown identifier 'BoxFromTPA'

  5. #30
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    BoxFromTPA is a function of mine, if you want to use it, you might want to tweak it to GetTPABounds etc.

    Also I don't know does it work, you also propably need to change a few values.

    Because it was made by pure theory, even the color I made in photoshop.

  6. #31
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    gimme 1 that compiles, and ill test it! lol
    and for the debug, ho do u making it highlich the colors to 255?

  7. #32
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    highlich
    Is that closer to Heimlich or Highlight? Jk/Jk, no, the colors in the RuneScape client aren't being highlighted, its just a CopyClientToBitmap and FastDraw functions, see scar manual...

  8. #33
    Join Date
    May 2007
    Location
    Ohio
    Posts
    2,296
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can u fix the whilpool for me?

  9. #34
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Ben is the only one here who can cause a nature catastrophe with pure power of will.


    = gimme a whirlpool, slowpoke!


    SCAR Code:
    Function GetPixelChange(Color, x1, y1, x2, y2, Tol, WaitTime: Integer): Extended;
    Var
      aPts, bPts: TPointArray;
      L, I, Count: Integer;
    Begin
      FindColorsTolerance(aPts, Color, x1, y1, x2, y2, Tol);
      Wait(WaitTime);
      FindColorsTolerance(bPts, Color, x1, y1, x2, y2, Tol);
      L := Min(High(aPts), High(bPts));
      For I := 0 To L Do
        If (aPts[i].x <> bPts[i].x) and (aPts[i].y <> bPts[i].y) Then
          Count := Count + 1;
      Result := Count / (L + 1);
    End;

    ^^ useful for gas / ent checking.



    An other kind of MiddleTPA, the one in WizzyPlugin uses the Mean Average, this uses Median.

    It isn't in plugin so with arrays that has thousands of points it takes some time, 6501 points took 541ms, but 400 points took 0-15 ms.

    How it works -

    in WizzyPlugin, it does X := X + Point[i].x and same for Y and then divides it by the length of the array.

    Mine gets the "middliest" point in an array that is sorted from small to large, the X and Y arrays, and then simply put does X := xArray[middle].x etc.

    It takes the median point, go read from wikipedia...



    SCAR Code:
    Function Median(Ints: TIntegerArray): Extended;
    Var
      I: Integer;
    Begin
      BubbleSort(Ints);
      I := GetArrayLength(Ints);
      If I Mod 2 <> 0 Then
      Begin
        Result := Ints[Round(High(Ints) / 2)];
      End Else
      Begin
        Result := (Ints[Round(High(Ints) / 2)-1] + Ints[Round(High(Ints) /2)]) / 2;
      End;
    End;

    Function n_MiddleTPAEx(TPA: TPointArray; Var mX, mY: Integer): Boolean;
    Var
      xA, yA: TIntegerArray;
      I: Integer;
    Begin
      Result := GetArrayLength(TPA) >= 3;
      If Not Result Then
        Exit;
      SetArrayLength(xA, GetArrayLength(TPA));
      SetArrayLength(yA, GetArrayLength(TPA));
      For I := 0 To High(TPA) Do
      Begin
        xA[i] := TPA[i].x;
        yA[i] := TPA[i].y;
      End;
      QuickSort(xA);
      QuickSort(yA);
      mX := Round(Median(xA));
      mY := Round(Median(yA));
    End;





    AutoColorThisEx (You need my UpdateColorFromArray for it)

    SCAR Code:
    Function AutoColorThisEx(bmp, Ref, Tol, x1, y1, x2, y2: Integer): Integer;
    Var
      X, Y, I, W, H, Gx, Gy, Z: Integer;
      c: TIntegerArray;
    Begin
      Result := - 1;
      If FindBitmapToleranceIn(bmp, x, y, x1, y1, x2, y2, Tol) Then
      Begin
        GetBitmapSize(bmp, W, H);
        Z := w * h - 1;
        SetArrayLength(C, z + 1);
        Gx := Max(X - 3, 0);
        Gy := Max(Y - 3, 0);
        For I := 0 To Z Do
          c[i] := GetColor(Gx + (I mod W), Gy + (I div H));
        Result := UpdateColorFromArray(Ref, c);
      End;
    End;

    Nielsie's fix, now it works as supposed to.






    Behold - GetNick:

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


    Function Capitalized(C: Char): Boolean;
    Begin
      Result := LowerCase(C) <> C;
    End;


    Function GetNick(Username: String; NickLength: Integer): String;
    Var
      Parts, validParts: TStringArray;
      z, q, w, i, c: Integer;
    Begin
      Parts := StrToStrArray(Username);
      SetArrayLength(validParts, GetArrayLength(Parts));
      For I := 0 To High(Parts) Do
        If Length(Parts[i]) >= NickLength Then
        Begin
          validParts[z] := Parts[i];
          z := z + 1;
        End;
      SetArrayLength(validParts, z);
      For I := 0 To Z Do
      Begin
        For C := 1 To Length(validParts[i]) Do
          If Not Capitalized(validParts[i][c]) Then
            If q <= 3 Then
              q := q + 1
            Else
              Break
          Else
            w := w + 1;
        If q >= NickLength Then
        Begin
          Result := Copy(validParts[i], w + 1, q);
          Exit;
        End;
      End;
    End;


    begin
      Writeln(GetNick('Ran2dom Name', 3));
    end.


    Capitalized by Wizzup.



    For all your alphabetic number getting needs:

    SCAR Code:
    {*******************************************************************************
    Function GetAlphabet(C: Char): Integer;
    By: n3ss3s
    Description: Returns the alphabetic number of a character.
    *******************************************************************************}


    Function GetAlphabet(C: Char): Integer;
    Begin
      Result := iAbs(65 - GetKeyCode(C)) + 1;
    End;



    SCAR Code:
    Function Revert(S: String): String;
    Var
      I: Integer;
    Begin
      SetLength(Result, Length(S));
      For I := 1 To Length(S) Do
        Result[i] := S[Length(S) - i + 1];
    End;



    For checking if we are moving:

    SCAR Code:
    Function AreWeMoving(wTime, minChance: Integer): Boolean;
    Var
      A, R, X, Y, I, C: Integer;
      Col: TIntegerArray;
      TPA: TPointArray;
    Begin

      If Not LoggedIn Then Exit;
     
      SetArrayLength(TPA, 10);
      SetArrayLength(Col, 10);
     
      For I := 0 To 9 Do
      Begin
        A := (I + 1) * 40 + Random(50);
        R := 15 + Random(60);
        X := MMCX + Round(R * Cos(A / 180 * Pi));
        Y := MMCY + Round(R * Sin(A / 180 * Pi));
        TPA[i] := Point(X, Y);
      End;
     
      Col := GetColors(TPA);
      Wait(wTime);
     
      For I := 0 To 9 Do
        If GetColor(TPA[i].x, TPA[i].y) <> Col[i] Then
          C := C + 1;
         
      Result := C > minChance;
     
    End;


    A new function, SortColors! http://www.villavu.com/forum/showthr...146#post366146

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How do you code?
    By Wrycu in forum C/C++ Help and Tutorials
    Replies: 17
    Last Post: 10-27-2008, 02:10 PM
  2. What is the code...
    By Boonce in forum OSR Help
    Replies: 13
    Last Post: 01-13-2008, 01:38 PM
  3. Sharing Code
    By mat_de_b in forum News and General
    Replies: 6
    Last Post: 10-18-2007, 08:51 PM
  4. Code Box
    By Bam Bam in forum News and General
    Replies: 2
    Last Post: 08-15-2006, 10:45 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
  •