Results 1 to 15 of 15

Thread: DropExceptColor

  1. #1
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default DropExceptColor

    I don't know does it exists or not but I made one
    Useful for power-scripts if you want to clear inventory...

    SCAR Code:
    procedure DropItemsExceptColors(colorz : TIntegerArray);
    var IC : TPoint;
    var I, J, x, y : integer;
    begin
      Gametab(4);
      Wait(1000 + random(1000));
      for i := 1 to 28 do
      begin
        Wait(50);
        if ExistsItem(i) then
        begin
          IC := ItemCoords(i)
          For j := 0 to (GetArrayLength(Colorz)-1) do
          begin
            if FindColorSpiralTolerance(x, y, colorz[j],ic.x - 20, ic.y - 20, ic.x + 20, ic.y + 20, 5) then break;
            if j = (GetArrayLength(Colorz)-1) then dropitem(i);
          end;
        end;
      end;
    end;

    Usage example:

    SCAR Code:
    DropItemsExceptColors([12345, 4325346, 3453465]);

    Add many colors you want, but seperate them with comma
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  2. #2
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Nice, very compact. Please separate the single line If statements into two line ones though.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  3. #3
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    Nice, very compact. Please separate the single line If statements into two line ones though.
    http://www.kaitnieks.com/scar/scriptingsta/

    Not needed. If it extends past 80 characters then it should be done. It is personal preference whether or not someone does so.

    Looks very nice though. There are some small things you could do such as High(Colorz) instead of GetArrayLength(Colorz)-1. I'm also not sure why you put the Wait(50) in there but its not enough to really matter.
    -You can call me Mick-



  4. #4
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    If it don't has waits in it mouse click may not work...
    About High(X) i'm not sure, I'm pretty sure I tested it once and it didn't work with arrays...


    Edit: It works, but it did gave me out of range error once when i tested it...
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    SCAR Code:
    Function DropExceptColors(From, tTo: Integer; Colors: TIntegerArray): Integer;
    Var
      I, II, L, X, Y: Integer;
      E: Boolean;
      B: TBox;
    Begin
      If Not LoggedIn Then Exit;
      L := High(Colors);
      For I := From To tTo Do
        If ExistsItem(i) Then
        Begin
          B := InvBox(i);
          For II := 0 To L Do
            If FindColor(X, Y, Colors[ii], B.x1, B.y1, B.x2, B.y2) Then
            Begin
              E := True;
              Break;
            End;
          If E Then
          Begin
            E := False;
            Continue;
          End;
          DropItem(i);
        End;
    End;

    Kay?

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

    Default

    n3ss3s, this is the quote i was looking for, about the above script you pasted, this comes straight from kaitnieks:
    Object Pascal language reserved words and key words shall always be completely lowercase. Never capitalize words that SCAR displays in bold. It's completely unnecessary and looks ugly!
    refering to your
    SCAR Code:
    If
    Then
    Var
    Exit
    Do
    To
    Begin
    End
    i don't know whether or not this is your funct.. just saying.

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

    Default

    Nobody has complained to Wizzup

    Why wouldn't it be his function lol?

    Its not like he copied it or anything...

  8. #8
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Haha, n3ss3s missed standards!
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

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

    Default

    Nope, I didn't, Wizzup posted somewhere that those are okay, the low caps etc are some other > SCAR standards + they look way more delphi

    (EDIT: Just wanted to say that x))

    EDIT EDIT: What would your reaction be if I said "..so?"

  10. #10
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    I should post some Yo-Mama joke and get n3ss3s all mad because he doesn't understand English jokes.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

  11. #11
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R0b0t1 View Post
    I should post some Yo-Mama joke and get n3ss3s all mad because he doesn't understand English jokes.
    Yo mamma so fat:
    SCAR Code:
    const
      Mom_Waist = ;
      Mom_Height = ;

    function IsFat(Waist_Size, Height:integer): boolean;
    begin
      Result := ((Waist_Size/Height) >= 1);
      WriteLn('She'#39's a fatty = ' + BoolToStr(Result));
    end;

    begin
      while IsFat(Mom_Waist, Mom_Height) do
        WriteLn('Fatty');
    end.

    Line 12: [Error] (6:11): Type mismatch in script
    -You can call me Mick-



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

    Default

    SCAR Code:
    program new;
    begin
      Writeln('Don´t hesitate to sleep one eye open');
    End.


  13. #13
    Join Date
    Jul 2007
    Location
    St. Louis, Missouri, USA.
    Posts
    575
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by n3ss3s View Post
    SCAR Code:
    program new;
    begin
      Writeln('Don´t hesitate to sleep one eye open');
    End.

    Don't deny it. You laughed.
    -You can call me Mick-



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

    Default

    I didn't - I know scar enough to picture the debug box in my mind and run the script there

  15. #15
    Join Date
    Dec 2006
    Location
    Banville
    Posts
    3,914
    Mentioned
    12 Post(s)
    Quoted
    98 Post(s)

    Default

    Damn. Addicted.



    N3ss3s? Are you Chuck Norris? Because Chuck Norris doesn't sleep... He waits.
    The jealous temper of mankind, ever more disposed to censure than
    to praise the work of others, has constantly made the pursuit of new
    methods and systems no less perilous than the search after unknown
    lands and seas.

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
  •