Results 1 to 5 of 5

Thread: wieldTheItem

  1. #1
    Join Date
    Mar 2011
    Location
    Broomfield
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default wieldTheItem

    Simba Code:
    procedure dropJunk;
      var inv : TInvItemArray;
        invIndex : Integer;
        dropTheItem : Boolean;
    begin
      inv := getInventoryItems;
      for invIndex := 0 to high(inv) do
      begin
        dropTheItem := true;
        case (inv[invIndex].Name) of
          'Lobster': dropTheItem := false;
          'Steel arrow': dropTheItem := false;
          'Uncut diamond': dropTheItem := false;
          'Uncut emerald': dropTheItem := false;
          'Uncut ruby': dropTheItem := false;
          'Uncut sapphire': dropTheItem := false;
          'Trout': dropTheItem := false;
          'Salmon': dropTheItem := false;
          'Tuna': dropTheItem := false;
          'Pizza': dropTheItem := false;
          'Cake': dropTheItem := false;
          'Swordfish': dropTheItem := false;
          'Shark': dropTheItem := false;
          'Diamond': dropTheItem := false;
        end;
        if(dropTheItem) then
          R_dropItem(inv[invIndex].slot);
      end;
    end;

    The Above Proc comes from iamadam's stronghold killer. I have one question. in regards to the boolean dropTheItem, is this a command referenced in reflection, and if so is the a command that would wield items instead of doping them or leaving them alone.

    Basicaly what i want to do is make it so that the script wields arrows. I don't want it done for me i just want to know the command, or better yet a place where all the commands are referenced.
    I cant have a fancy sig, so click for a laugh that I made. http://i55.photobucket.com/albums/g1...er/Punched.gif

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    In that procedure no it is a local variable that he uses (see if dropitem then XXX). Weilding arrows is simple. Look in Inventory.scar, you can find procedure like...

    ItemExists();
    MouseInv();
    InvBox();

    etc.

    if you need more assistance with this I can definitely help push you in the right direction, just let me know.
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Mar 2011
    Location
    Broomfield
    Posts
    57
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    OK I found the function
    Simba Code:

    all i have to do is add
    R_ClickItem(1601, true, '');
    to wield it. and i can throw that into the proc after the first BEGIN?

    1601 is the item number for steel arrows


    function R_ClickItem(Slot: Integer; Left: Boolean; Action: String): boolean;
    Last edited by activecamo; 04-10-2011 at 12:07 AM.
    I cant have a fancy sig, so click for a laugh that I made. http://i55.photobucket.com/albums/g1...er/Punched.gif

  4. #4
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    If you see it says that the first parameter is slot... Im pretty sure the inventory does not have 1601 slots...

    Try This:

    Simba Code:
    Procedure ClickIt;

    var
      Item: TInvItem;

    begin
      if R_ItemExists(1601, Item) then
        R_ClickItem(Item.Slot, true, '');
    end;
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

  5. #5
    Join Date
    Feb 2006
    Posts
    3,044
    Mentioned
    4 Post(s)
    Quoted
    21 Post(s)

    Smile Alternative.

    Simba Code:
    function R_ClickWield(TheVar: Integer): boolean;
    var
      item: TInvItem;
    begin
      if not R_LoggedIn then Exit;
      if R_ItemExists(TheVar, Item) then begin
        if (Item = NULL_INVITEM) then Exit;
        case Random(2) of
          0:
            begin
              MouseItem(Item.Slot, True);
              Result := True;
            end;
          1:
            begin
              MouseItem(Item.Slot, False);
              Result := R_WaitOption('Wield', RandomRange(150, 300));
            end;
        end;
      end;
    end;

    Should work.

    ~Home

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
  •