Reply
Thread Tools Display Modes
Unread 10-13-11, 04:46 AM   #1
Lildry
Claw of Regulos
Join Date: Oct 2011
Posts: 13
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
Lildry is offline   Reply With Quote
Unread 10-13-11, 05:58 AM   #2
Aieny
Veiled Ripper
 
Aieny's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 40
Check out the Generic Addon for an example of creating slash commands
__________________
Lua Code:
  1. local function signature()
  2.     print("Aieny Celenovia")
  3.     print("www.riftcrafter.com")
  4. end
Aieny is offline   Reply With Quote
Unread 10-13-11, 11:11 AM   #3
seebs
Super Moderator
Premium Member
Riftui Super Mod
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 9
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.
seebs is offline   Reply With Quote
Unread 10-14-11, 12:24 AM   #4
Lildry
Claw of Regulos
Join Date: Oct 2011
Posts: 13
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.
Lildry is offline   Reply With Quote
Unread 10-14-11, 05:53 AM   #5
Aieny
Veiled Ripper
 
Aieny's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2011
Posts: 40
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 )
__________________
Lua Code:
  1. local function signature()
  2.     print("Aieny Celenovia")
  3.     print("www.riftcrafter.com")
  4. end
Aieny is offline   Reply With Quote
Unread 10-14-11, 08:03 AM   #6
Lildry
Claw of Regulos
Join Date: Oct 2011
Posts: 13
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.
Lildry is offline   Reply With Quote
Reply

Go BackRiftui » Developer Discussions » Lua Help » Slash Commands

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off