Riftui

Riftui (https://www.riftui.com/forums/index.php)
-   Lua Help (https://www.riftui.com/forums/forumdisplay.php?f=16)
-   -   Slash Commands (https://www.riftui.com/forums/showthread.php?t=149)

Lildry 10-13-11 04:46 AM

Slash Commands
 
I am tring to learn how to create add-ons in the Rift API. I wanted to start with something simple, and started with slash commands. I thought it would be simple. I got my .toc file completed and I created the .lua file. In the .lua file I created two slash commands:

table.insert = Command.Slash.Register("hey")
table.insert = Command.Slash.Register("heythere")

Took me awhile to get this far, I was using eventTable instead of table.insert.
Now I would like to add some function to the slash command. I was thinking of an emote that that says hello to the target. When I type /hey it will say "hello (target) how are you doing".

Regards,
Lildry

Aieny 10-13-11 05:58 AM

Check out the Generic Addon for an example of creating slash commands :)

seebs 10-13-11 11:11 AM

Command.Slash.Register yields a table into which you can insert things.

Do not assign to table.insert, that way lies madness.

x = Command.Slash.Register("foo")
table.insert(x, { function, addon_name, name })

BTW, my LibGetOpt offers a way to get some of this done automatically for you, and get your function called with the command line arguments, parsed out for your convenience.

Lildry 10-14-11 12:24 AM

Thanks for the information Aieny, I got the slash commands to function. I think I need to change the function to work a diffrent way. I am tring to create slash commands to make new emotes that are not in the game. For example I want to type /growl and have the emote say growls loudly at "target".

Seebs thanks for your imput going to check out your addon right now. I started using luapad and I like that one makes a lot easier to alt tabing out every few mins.

Aieny 10-14-11 05:53 AM

Right now, we don't have any way to have an Addon communicate with other players, or execute any real commands. I'm sure that is coming, and you can at least get the groundwork setup for your Addon, but until we have access to use the /emote command, or something similar, you won't quite be able to finish. (just a heads up ;))

Lildry 10-14-11 08:03 AM

I see, guessing thats why I can only get the system to talk and can't say anything in chat. Ok I will move onto something else until we can use chat features.


All times are GMT -6. The time now is 09:26 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2022 MMOUI