Results 1 to 8 of 8

Thread: Click Invetory

  1. #1
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Click Invetory

    Im getting an error:
    This is the code:
    InvMouse(1, Rightclick);
    This is the error:
    Unknown identifier 'Rightclick'
    Last edited by Neehosoft; 09-20-2009 at 04:28 AM.
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  2. #2
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    procedure InvMouse(InvSlot, Action: Byte);
    By: EvilChicken!
    Description: A combined MouseItem & MMouseItem, will hopefully replace both
    procedures one day. Usage is like SRL's MouseBox, Action determines what to do:
      1: Leftclick
      2: Rightclick
      3: Move mouse to item
    *******************************************************************************}
    You mean something like this? It's from Inventory.scar.

  3. #3
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Sabzi View Post
    SCAR Code:
    {*******************************************************************************
    procedure InvMouse(InvSlot, Action: Byte);
    By: EvilChicken!
    Description: A combined MouseItem & MMouseItem, will hopefully replace both
    procedures one day. Usage is like SRL's MouseBox, Action determines what to do:
      1: Leftclick
      2: Rightclick
      3: Move mouse to item
    *******************************************************************************}
    You mean something like this? It's from Inventory.scar.
    Yes i do thanks, thats what i needed. I would rep but i have repped you recently and it says i need to spread some around
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

  4. #4
    Join Date
    Jul 2009
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Neehosoft View Post
    Im getting an error:
    This is the code:

    This is the error:
    *FacePalm*
    Nevermind, i found it, its a integer not string...2
    Quote Originally Posted by Cstrike View Post
    Why do I even try these things? I just shit my pants over this god damn tutorial. Fuck, that's uncleanable. I can't even wash that out because there's so much of my shit it will just stain everything else. If I put it in the washing machine, I'm sure to stain the sides.

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

    Default

    Hmm...Perhaps Action would be easier as a Variant instead of a Byte?
    <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 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by R1ch View Post
    Hmm...Perhaps Action would be easier as a Variant instead of a Byte?
    +1
    So if you were thinking to make it or not I can just encourage you .

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

    Default

    Quote Originally Posted by R1ch earlier View Post
    I suppose I could make it now. *Me opens up SRL*
    Here it is:

    SCAR Code:
    {*******************************************************************************
    procedure InvMouse(InvSlot, Action: Byte);
    By: EvilChicken! - modified by R1ch
    Description: A combined MouseItem & MMouseItem, will hopefully replace both
    procedures one day. Usage is like SRL's MouseBox, Action determines what to do:
      1, 'left', 'lc' - Leftclick
      2, 'right', 'rc' - Rightclick
      3, 'move', 'nothing' - Move mouse to item
    *******************************************************************************}


    procedure InvMouse(InvSlot, Action : Variant);
    var
      TB : TBox;
      A : Integer;
     
    begin
      if (not InRange(InvSlot, 1, 28)) then
      begin
        srl_Warn('InvMouse', 'Inventory slot #' + IntToStr(InvSlot) + ' is not a valid slot', warn_AllVersions);
        Exit;
      end;
      if not Action = 1 or Action = 2 or Action = 3 then
      begin
        case LowerCase(Action) of
          'left', 'lc' : A:= 1;
          'right', 'rc' : A:= 2;
          'move', 'nothing' : A:=3;
        end else
        begin
          srl_Warn('InvMouse', 'Action #' + Action + ' is not a valid action', warn_AllVersions);
          Exit;
        end;
      end else
        A:= Action;
      if (not InRange(Action, 1, 3)) then
      begin
        srl_Warn('InvMouse', 'Action #' + IntToStr(Action) + ' is not a valid action', warn_AllVersions);
        Exit;
      end;
      GameTab(tab_inv);
      TB := InvBox(InvSlot);
      MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, Action);
    end;

    Some of the ways I do things may seem unorthodox, but it's for a reason.
    <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.

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

    Default

    Quote Originally Posted by R1ch View Post
    Here it is:

    SCAR Code:
    {*******************************************************************************
    procedure InvMouse(InvSlot, Action: Byte);
    By: EvilChicken! - modified by R1ch
    Description: A combined MouseItem & MMouseItem, will hopefully replace both
    procedures one day. Usage is like SRL's MouseBox, Action determines what to do:
      1, 'left', 'lc' - Leftclick
      2, 'right', 'rc' - Rightclick
      3, 'move', 'nothing' - Move mouse to item
    *******************************************************************************}


    procedure InvMouse(InvSlot, Action : Variant);
    var
      TB : TBox;
      A : Integer;
     
    begin
      if (not InRange(InvSlot, 1, 28)) then
      begin
        srl_Warn('InvMouse', 'Inventory slot #' + IntToStr(InvSlot) + ' is not a valid slot', warn_AllVersions);
        Exit;
      end;
      if not Action = 1 or Action = 2 or Action = 3 then
      begin
        case LowerCase(Action) of
          'left', 'lc' : A:= 1;
          'right', 'rc' : A:= 2;
          'move', 'nothing' : A:=3;
        end else
        begin
          srl_Warn('InvMouse', 'Action #' + Action + ' is not a valid action', warn_AllVersions);
          Exit;
        end;
      end else
        A:= Action;
      if (not InRange(Action, 1, 3)) then
      begin
        srl_Warn('InvMouse', 'Action #' + IntToStr(Action) + ' is not a valid action', warn_AllVersions);
        Exit;
      end;
      GameTab(tab_inv);
      TB := InvBox(InvSlot);
      MouseBox(TB.X1, TB.Y1, TB.X2, TB.Y2, Action);
    end;

    Some of the ways I do things may seem unorthodox, but it's for a reason.
    Tbh, I would make it, 'Action', a data type of funct_Options:

    { type fnct_ActionOptions;
    Description: Action options. }
    type
    fnct_ActionOptions = (ClickLeft,ClickRight,Move,Nothing);

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
  •