Results 1 to 2 of 2

Thread: GameTab.scar WearingItem

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default GameTab.scar WearingItem

    Just some unnecessary code in there as GameTab() already check to make sure it's not already on the tab before it clicks.

    Old WearingItem:
    SCAR Code:
    {*******************************************************************************
    function WearingItem(i: Integer): Boolean;
    By: RsN
    Description: Results True if an item is equipped at equpiment slot defined by I.
    *******************************************************************************}


    function WearingItem(I: Integer): Boolean;
    var
      X, Y: Integer;
      TP: TPoint;
    begin
      if (not InRange(I, 1, 11)) then
      begin
        srl_Warn('WearingItem', 'Equipment slot #' + IntToStr(I) + ' is not a valid equipment slot', warn_Warning);
        Exit;
      end;
      if (GetCurrentTab <> tab_Equip) then
      begin
        GameTab(tab_Equip);
        if GetCurrentTab <> tab_Equip then exit;
        Wait(750 + Random(500));
      end;
      TP := EquipmentCoords(I);
      Result := FindColor(X, Y, srl_outline_black, TP.x - 8, TP.y - 8, TP.x + 8, TP.y + 8);
    end;

    My version:
    SCAR Code:
    {*******************************************************************************
    function WearingItem(i: Integer): Boolean;
    By: RsN
    Description: Results True if an item is equipped at equpiment slot defined by I.
    *******************************************************************************}


    function WearingItem(I: Integer): Boolean;
    var
      X, Y: Integer;
      TP: TPoint;
    begin
      if (not InRange(I, 1, 11)) then
      begin
        srl_Warn('WearingItem', 'Equipment slot #' + IntToStr(I) + ' is not a valid equipment slot', warn_Warning);
        Exit;
      end;
      if  GameTab(tab_Equip) then
      begin
        Wait(750 + Random(500));
        TP := EquipmentCoords(I);
        Result := FindColor(X, Y, srl_outline_black, TP.x - 8, TP.y - 8, TP.x + 8, TP.y + 8);
      end;
    end;

    GetCurrentTab is also broken but I'm working on that now..


    Also, same thing with Retaliate:
    Old one:
    SCAR Code:
    {*******************************************************************************
    procedure Retaliate(RetTrue: Boolean);
    By: WT-Fakawi & n3ss3s, slight mod by EvilChicken!
    Description: Set's Auto Retaliate ON of OFF.
    *******************************************************************************}


    procedure Retaliate(RetTrue: Boolean);
    Var
      X, Y: Integer;
    Begin
      if (GetCurrentTab <> tab_Combat) then
      begin
        GameTab(tab_Combat);
        Wait(500 + Random(500));
      end;
      if (RetTrue) xor FindColorTolerance(X, Y, 1777019, 624, 385, 719, 396, 2) then
        MouseBox(624, 385, 719, 396, 1);
    End;
    New one
    SCAR Code:
    {*******************************************************************************
    procedure Retaliate(RetTrue: Boolean);
    By: WT-Fakawi & n3ss3s, slight mod by EvilChicken!
    Description: Set's Auto Retaliate ON of OFF.
    *******************************************************************************}


    procedure Retaliate(RetTrue: Boolean);
    Var
      X, Y: Integer;
    Begin
      if GameTab(tab_Combat) then
      begin
        Wait(500 + Random(500));
        if (RetTrue) xor FindColorTolerance(X, Y, 1777019, 624, 385, 719, 396, 2) then
          MouseBox(624, 385, 719, 396, 1);
      end;
    End;
    Last edited by NCDS; 02-10-2010 at 08:59 AM.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    E: Stupid me, didn't read all
    Last edited by Frement; 02-10-2010 at 02:30 PM.
    There used to be something meaningful here.

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
  •