+ Reply to Thread
Results 1 to 2 of 2

Thread: Consuming hardware events and macros

  1. #1
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default Consuming hardware events and macros

    So, with the new mount functionality, I created this simple function:

    function AM.Command_Slash_Register_Mount(args)
    local mounts = {
    "i055080003687BD5F", -- Flametail
    "i05508000437D7CD5", -- Cloudtail
    }
    math.randomseed(os.time())
    Command.Item.Mount.Use(mounts[math.random(#mounts)])
    end

    Command.Event.Attach(Command.Slash.Register("rndmn t"), AM.Command_Slash_Register_Mount, "Command.Slash.Register")

    Now, typing /rndmnt works fine. But put it into a macro, and:

    Error: Missing hardware event.
    Function documentation:
    Uses a collected mount.
    This function consumes a hardware event to function. Hardware events include Event.UI.Input.Mouse.*.Down, Event.UI.Input.Mouse.*.Up, and Event.UI.Input.Mouse.Wheel.*.
    Command.Item.Mount.Use(mount) -- item
    Parameters:
    mount: The item ID of the collected mount to use.
    In AdeleaMisc / Command.Slash.Register, event Event.Slash.rndmnt
    stack traceback:
    [C]: ?
    [C]: in function 'Use'
    AdeleaMisc/AdeleaMisc.lua:583: in function <AdeleaMisc/AdeleaMisc.lua:576>

    I understand consuming events - but why dont macros with hotkeys work the same way? I have pressed the hotkey - which is a hardware event. If I had two things in my macro which used hardware events, then sure, the 2nd one should fail of course.

    The error only mentions mouse events, but the fact it works from typing the command by hand rules that out. And in fact, clicking on the macro generates the same error.
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  2. #2
    Shadowlander GreenZomie's Avatar
    Join Date
    Sep 2018
    Posts
    34

    Default

    Oh wow.
    Here I was trying the exact same thing. Same error. Same fantastic response.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts