-
June 7th, 2020, 20:28 #1
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Updating Old Extension - Issue with Slash Commands
Hello, All
I was digging back through some old code and trying to get it to work. Sadly, it's from back in 2011 and I think there were some changes along the line. I was wondering if someone could help me get my slash commands working again.
extension.xml
Code:<?xml version="1.0" encoding="iso-8859-1"?> <root version="3.3" logo="images/pack_logo_mini.png"> <announcement text="Generic Extention, use '/pack' to start." font="emotefont" icon="logo"/> <properties> <name>Pack</name> <version>0.1.20110108</version> <author>tdewitt274</author> <description></description> <ruleset>Any</ruleset> </properties> <base> <icon name="logo" file="images/pack_logo_mini.png" /> <script name="packSlashCommands" file="scripts/packchatmanager.lua" /> <includefile source="graphics.xml" /> <includefile source="pack.xml" /> <script> </script> </base> </root>
Code:function printMessage(text, sender, icon, diemodifier) local msg = {font = "systemfont"}; msg.text = text; msg.sender = sender; msg.icon = icon; msg.diemodifier = diemodifier; Comm.addChatMessage(msg); end function packHelp() printMessage("Commands:"); end function onInit() Comm.registerSlashHandler("/pack",packHelp); registerSpecialMsgHandler("pack",packHelp); end
Any help is appreciated!
Thanks!
Todd
-
June 7th, 2020, 20:49 #2
Do a find in files for "registerSlashHandler" in any of the recent rulesets to get examples. The scripts\manager_chat.lua script file in CoreRPG will give you a few. I think the key thing is not to have the / - so use "pack" not "/pack".
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
June 7th, 2020, 21:41 #3
- Join Date
- Oct 2009
- Location
- GMT -6 hrs
- Posts
- 503
Thanks, Trenloe!
It was the slashes all along.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks