Jump to content
conroy

[Release] - Execute scripts/code via chat commands

Recommended Posts

Execute scripts/code via chat commands


Description:

A little mini-project I worked on, which allows you to intercept and use text, that was typed in the inGame chat-box.

Any text, that starts with the special intercept character (by default "!"), will be passed on to a function and checked against all available chat-commands.

If it matches one of the defined commands, the associated code for the command is executed. Any text after the initial command will be passed as an argument to the called function.

Intercepted text is not sent to other clients and wont clutter up the chat history.

The script folder comes with some examples, that show you how the commands are defined. ("module_chatIntercept\commands.sqf")

The current version of the script does not have any extra functions included, apart from the example ones.

It rather serves as a base to include your own functions and ideas, if you can come up with something interesting or practical.


Usage:

Simply execute the init.sqf inside the script folder on a clients machine.

[] execVM "module_chatIntercept\init.sqf";

Inside the script folder are two files, which allow further configuration.

The "config.sqf" (fairly empty atm) allows you to change the intercept-character.

pvpfw_chatIntercept_commandMarker = "!";

"commands.sqf" defines the array of all available commands. (Edit this one or define the array somewhere else to customize the usable commands)

The format is:

pvpfw_chatIntercept_allCommands = [
   ["command1",{/*code1*/}],
   ["command2",{/*code2*/}],
   ["command3",{/*code3*/}]
   /* etc */
];


Download:

Example mission: https://www.dropbox.com/s/ijnzhhd5gv104l3/pvpfw_chatIntercept_v02.Stratis.pbo

Script folder: https://www.dropbox.com/s/lk2mq4yjt5242z2/module_chatIntercept.zip

Edited by Conroy
typo

Share this post


Link to post
Share on other sites
Guest

Release frontpaged on the Armaholic homepage.

================================================

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

I've used this script to link Arma text chat to Google's Diagflow for a hack day once and it was awesome!

I'm going to be using it again for an arty script.

Great work!

Share this post


Link to post
Share on other sites
2 hours ago, HazJ said:

Hack day?

From what I know it's an event where programmers write stuff within a certain timeframe for a certain theme.

 

Cheers

  • Thanks 1

Share this post


Link to post
Share on other sites

Haha, never heard that expression.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×