Results 1 to 16 of 16

Thread: ExamineInv ~ Antiban.scar ~ R1ch

  1. #1
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default ExamineInv ~ Antiban.scar ~ R1ch

    This is a nice little function which examines a random item in the inventory if it finds one. If it finds an item and examines it, then the function will return true. Please let me know what you think.

    SCAR Code:
    *******************************************************************************
    function ExamineInv(FromI, ToI : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}
    function ExamineInv(FromI, ToI : Integer) Boolean;
    var
      I, T : Integer;
      Poz : TIntegerArray;
     
    begin
      if (InvEmpty or (not(LoggedIn))) then
        Exit;
      for I:= FromI to ToI do
        if ItemExists(I) then
          Poz[I]:= I;
      MouseItem(Random(Poz), False);
      Wait(500 + Random(1000);
      Result:=WaitOption('xamine', 50);
    end;

    Richard.
    Last edited by Rich; 07-03-2009 at 11:36 PM.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  2. #2
    Join Date
    Jul 2008
    Location
    England
    Posts
    763
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmmm, good idea actually.

    GJ!
    lol

  3. #3
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Woo! The first reply is a good one. That's always nice to see. Thanks Quickmarch.

    Richard.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  4. #4
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Good, Good:

    SCAR Code:
    *******************************************************************************
    function ExamineInv(FromI, ToI : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}
    function ExamineInv(FromI, ToI : Integer) Boolean;
    var
      I : Integer;
      Poz : TIntegerArray;
     
    begin
      if (InvEmpty or (not(LoggedIn))) then
        Exit;
      for I:= FromI to ToI do
        if ItemExists(I) then
          Poz[i]:= I;
      MouseItem(Random(Poz), False);
      Wait(500 + Random(1000);
      Result := WaitOption('xamine', 50);
    end;

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Thanks Naum, it's the little changes that make it better. I'll change it int he first ost in a sec.

    Richard.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    Hey guys, shortened even more:
    SCAR Code:
    {*******************************************************************************
    function ExamineInv(FromI, ToI : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}

    function ExamineInv(FromI, ToI : Integer): Boolean; var I : Integer; Poz : TIntegerArray; begin if (InvEmpty or (not(LoggedIn))) then Exit; for I:= FromI to ToI do if ExistsItem(I) then Poz[i]:= I; MouseItem(Poz[Random(Length(Poz))], False); Wait(500 + Random(1000)); Result := WaitOption('xamine', 50); end;

    Ok, so sarcasm owns ^^.
    Better?
    Code:
    {*******************************************************************************
    function ExamineInv(FromI, ToI : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}
    function ExamineInv(FromI, ToI : Integer) Boolean;
    var
      I : Integer;
      Poz : TIntegerArray;
    begin
      if (InvEmpty or (not(LoggedIn))) then
        Exit;
      for I:= FromI to ToI do
      begin
        if ExistsItem(I) then
          Poz[i]:= I;
      end;
      MouseItem(Poz[Random(Length(Poz))], False);
      Wait(500 + Random(1000);
      Result := WaitOption('xamine', 50);
    end;
    Ce ne sont que des gueux


  7. #7
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Floor66 View Post
    Hey guys, shortened even more:
    SCAR Code:
    {*******************************************************************************
    function ExamineInv(FromI, ToI : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}

    function ExamineInv(FromI, ToI : Integer): Boolean; var I : Integer; Poz : TIntegerArray; begin if (InvEmpty or (not(LoggedIn))) then Exit; for I:= FromI to ToI do if ExistsItem(I) then Poz[i]:= I; MouseItem(Poz[Random(Length(Poz))], False); Wait(500 + Random(1000)); Result := WaitOption('xamine', 50); end;
    Ok, so sarcasm owns ^^.
    Better?
    Code:
    {*******************************************************************************
    function ExamineInv(FromI, ToI : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}
    function ExamineInv(FromI, ToI : Integer) Boolean;
    var
      I : Integer;
      Poz : TIntegerArray;
    begin
      if (InvEmpty or (not(LoggedIn))) then
        Exit;
      for I:= FromI to ToI do
      begin
        if ExistsItem(I) then
          Poz[i]:= I;
      end;
      MouseItem(Poz[Random(Length(Poz))], False);
      Wait(500 + Random(1000);
      Result := WaitOption('xamine', 50);
    end;
    ??, Also you needed to call the length, I forgot, thought it was not an array .

  8. #8
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Ah, yes. I did the same Naum. I'll change that in a minute, after I've fixed a few bugs I found a minute ago.

    EDIT: Okay guys. I would really appreciate some help with this. Whatever I do, I can't get it to to work.

    Richard
    Last edited by Rich; 07-04-2009 at 12:51 AM.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  9. #9
    Join Date
    Dec 2008
    Location
    Québec
    Posts
    419
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i already have it in my script and it randomly cancel or examine

    SCAR Code:
    function WearingItemAntiBan(option:string):boolean; // xamine, ancel or random
    var
    v, i :integer;
    z: tpoint;
    begin
      if (InvEmpty or (not(LoggedIn))) then Exit;
      repeat
        v:= random(10)+1;
        if WearingItem(v) then
        begin
          z := EquipmentCoords(v);
          if option = 'random' then
          begin
            case Random(2) of
              0: option := 'xamin';
              1: option := 'ancel';
            end;
          end;
          mouse(z.x, z.y, 6, 6, false);
          wait(50+random(50));
          result := WaitOption('xamine', 200);
        end;
        Inc(i);
      until(i > 11)or result;
    end;
    Last edited by Phran6; 07-04-2009 at 01:21 AM.
    Formerly known as FrancisHelie

  10. #10
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Well

    MouseItem(random(poz), false);

    Is going to pick a random index of poz.

    So lets say ItemsExists at index 2, 8, 17, 27. 4 spots. So poz length = 4.
    Random(poz) will pick a 0,1,2,3 and only those possiblities. So when it picks 3, there is no item that exists there so what your trying to do will fail.

    think about it a little bit. if you can't get it I will help more.

    Do a

    Writeln(IntToStr(Random(poz))); and see what your outcome is .

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  11. #11
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    @My post:
    SCAR Code:
    MouseItem(Poz[Random(Length(Poz))], False);
    Ce ne sont que des gueux


  12. #12
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    well, i must say that you are using WaitOption wrong.

    SCAR Code:
    Wait(500 + Random(1000);
      Result:=WaitOption('xamine', 50);

    WaitOption was made precisely to avoid the Wait(500+random(100));

    SCAR Code:
    if WaitOption('xamine', 800) then
    begin
      wait(random(100));
      Result := true;
    end;

    also, by calling ExistsItem in a loop, you are doing continuous FindColorsTolerance, which is not quite so effective.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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

  14. #14
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function ExamineInv(F, T : Integer) Boolean;
    By: R1ch
    Description: Chooses a random item in the inventory to examine
    *******************************************************************************}

    function ExamineInv(F, T: Integer) Boolean;
    var
      i, c : Integer;
      p: TIntegerArray;
    begin
      if (InvEmpty) or (not(LoggedIn)) or (not InRange(T - F, 0, 27)) then Exit;
     
      SetLength(p, T - F);
      c := 0;
      for i := F to T do
        if ItemExists(I) then
        begin
          p[c]:= I;
          Inc(c);
        end;
      MouseItem(p[Random(c)], False);
      Wait(100 + Random(200));;
      Result:=WaitOptionEx('xamine', 'action', ClickLeft, 300);
    end;

    Made it work
    Last edited by Nava2; 07-04-2009 at 01:08 PM.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  15. #15
    Join Date
    May 2007
    Location
    England
    Posts
    4,141
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Thanks Nava! Would anyone be interested in using this?
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  16. #16
    Join Date
    Feb 2007
    Location
    Access Violation at 0x00000000
    Posts
    2,865
    Mentioned
    3 Post(s)
    Quoted
    18 Post(s)

    Default

    I guess I would. It's added to the open dev anyways already.
    Ce ne sont que des gueux


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
  •