Results 1 to 5 of 5

Thread: InvMouse(x, 2); not working

  1. #1
    Join Date
    Dec 2011
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default InvMouse(x, 2); not working

    I've been trying to figure this out...
    Even made simple scripts to check if it's something in my code, but nothing makes it work, even long Wait();s etc..
    I'd paste my code but I'm not on my PC right now but I'm trying to move my mouse to the 2nd inv slot and choose all.
    So something like this:

    Code:
    InvMouse(2, 2);
    Wait(randomRange(1000, 500)); // just to be sure long wait
    ChooseOption('All');
    It just won't right click, invmouse with 2, 1 works fine (it left clicks the item).

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Numbers change? I'd advise using constants, like mouse_right, instead of a number like 2. Thus, you'll know even is the numbers associated to the constants are edited, that the constant input will still result in the desired action.

    ex.
    Simba Code:
    {$include_once srl/srl.simba}
    begin
      SetupSRL;
      if InvMouse(2, mouse_right) then
        ChooseOption('All');
    end.

    Also make sure you text is correct, as upper/lower case does matter, well should matter.
    -Lj

  3. #3
    Join Date
    Dec 2011
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Thanks,
    I'll try that once I'm at my computer, however I don't understand what you mean by numbers change in this case, care to elaborate?
    Checked the InvMouse procedure but I didn't really understand how it makes a difference.

    Also checked simba documentation and found this:
    Code:
    const
        mouse_Right = 0
        mouse_Left = 1
        mouse_Middle = 2
    Seems I should use InvMouse(2, 0); not InvMouse(2, 2) correct?

  4. #4
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by shebee View Post
    Thanks,
    I'll try that once I'm at my computer, however I don't understand what you mean by numbers change in this case, care to elaborate?
    Checked the InvMouse procedure but I didn't really understand how it makes a difference.
    in the includes, or in the simba build, let's say you have 0, 1, or 2 for mouse actions, each representing a way a mouse might click (choices could be left/right/none aka move). We'll, let's say somewhere in the implementation of a mouse method, the old mouse_right was equivalent to 2, but now, it's been changed so mouse_move is currently equivalent to 2. However, if we use the constants, or the Mouse_Left, Mouse_Right, Mouse_Move, we should never encounter a problem with changed implementation, because as we interact with the interface of the InvMouse function, and we say Mouse_Right instead of 2, we should have no doubt that the Mouse_Right will always generate a mouse click for the right button, versus having some doubt that 2, may have changed to a different mouse button. Thus, I'd recommend calling constants instead of hard code, as there should be less errors to deal with.

    Cheers,
    Lj

  5. #5
    Join Date
    Dec 2011
    Posts
    170
    Mentioned
    0 Post(s)
    Quoted
    37 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    in the includes, or in the simba build, let's say you have 0, 1, or 2 for mouse actions, each representing a way a mouse might click (choices could be left/right/none aka move). We'll, let's say somewhere in the implementation of a mouse method, the old mouse_right was equivalent to 2, but now, it's been changed so mouse_move is currently equivalent to 2. However, if we use the constants, or the Mouse_Left, Mouse_Right, Mouse_Move, we should never encounter a problem with changed implementation, because as we interact with the interface of the InvMouse function, and we say Mouse_Right instead of 2, we should have no doubt that the Mouse_Right will always generate a mouse click for the right button, versus having some doubt that 2, may have changed to a different mouse button. Thus, I'd recommend calling constants instead of hard code, as there should be less errors to deal with.

    Cheers,
    Lj
    Thanks, I suspected something like that.
    Very good explanation, really appreciate it!

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
  •