Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there anyway to read chat mensages
#1
Hey, I would like to know if there is any way to read mensages from chat.
The objetive would be like custom commands.
Ty by your answer.
Reply

#2
(03-28-2015, 18:41)bougar Wrote: Hey, I would like to know if there is any way to read mensages from chat.
The objetive would be like custom commands.
Ty by your answer.

In the steam version I dont see it as a possibility, by gsc coding is not possible. And the only way I can think to do this is to make an external tool to read game memory and which applies certain things to the game.
Reply

#3
Yep it's not possible via scripting. I remember I was trying to do something like this:
Code:
if(self sayAll() == "!wtf" ) {
// to do all the magic
}

Of course, I got bad syntax or unknown function because obviously, this even looks stoooopid.
It's possible via things like B3 or another server stuff for steam which can read game log in real time and parse client stuff, i.e, log looks like this
Code:
J;playername;time; // J - joined
K;attacker,victim,wep,etc... // K - kill etc
S or SAY;player;what_did_he_say;
So you parse the string and see what he wants. ( As I know, you can launch B3 even on local server ). But if you want to know how to manipulate with player responses after he used to "say" something you can do lots of different stuff, like DVAR change with infos, again, like

1) server sets a dvar when player said something
Code:
whatever it looks like...
if( logParsedSayLine == "!explode" )
setServerVar("playersaid", "<playername> EXPLODE" );

Meanwhile in GSC..
Code:
if( GetDvar("playersaid") != "" ) { // player said something
whatchawant = GetDvar("playersaid")
// parse whatchawant by space or whatever and it will be like this: ( I DON'T REMEMBER HOW TO PARSE STRINGS IN GSCs! )
// so let's think that you parsed string already
name = parsed[0];
func = parsed[1];

// so now find player by name and do a func, like
if( func == "EXPLODE" ) {
player explode();
}


TL;DR

Long post because I am bored.
Yes it's possible.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
thanks both by your quick answer.
Fourtunately i am using repziw4 so i can do something like this:
self notifyOnPlayerCommand( "dosomething", "+doit" );
and type this on game console:
/bind p +doit (I discovered it yesterday).
So I "solve" my problem by this way.
Reply

#5
You just wanted this -.- I though some more chat stuff.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.