Author Topic: Packaging the echo function?  (Read 803 times)

Essentially I want the server to relay whatever it gets into my console. I'm good everywhere except to find which function everything uses to print to the dedicated's console. I've tried packaging the echo function, but I don't think it'll let me.

Anyone know which thing to package/what to do?

Essentially I want the server to relay whatever it gets into my console. I'm good everywhere except to find which function everything uses to print to the dedicated's console. I've tried packaging the echo function, but I don't think it'll let me.

Anyone know which thing to package/what to do?
I could've swore you could package the echo function? I remember when I took Mr Wallet's scripting class he did something like this.
No idea if this works but I wrote this down in my notes (I was a scripting noob those many years but hopefully this sets you on the right track?)

Quote from: Mr Wallet's scripting class notes
--------
Packages:
--------
    A package is a way to temporarily over-ride a function without re-writing it.

        Package MyPackage { }; //note that it needs a semicolon

    Once a package has been defined, it can be activated and deactivated at will without causing problems to the original functions or other packages.
    Also note that a function over-written by a package can still be called in the package by using Parent:: like so:

       Package MyPackage {
            function echo(%text)
            {
                //other stuff can be added here at will
                Parent::echo(%text);
            }
        };

    This is especially useful when you don't have access to the source code of the parent function, for example badspot's default scripts.

    Packages are activated with ActivatePackage(packageName); and deactivated with DeactivatePackage(packageName);
    If multiple packages are active, the more recently-activated ones take precedence over the older ones.
    Parent:: calls will call the next-newest package that contains a version of the function, only reaching the original function if it's the oldest-activated package with a version of that function.

EDIT: I guess it was supposed to work but I just tried it and it did not work.
« Last Edit: February 06, 2013, 09:12:21 PM by DYLANzzz »

Dang, I got my hopes up D:

Well, thanks for replying. It gets lonely here in coding help sometimes.

Hold on, Im still looking... :P
Edit: I got nothing :(
And it seems like any public member functions for the GuiConsole thing that may allow you to grab the data from the GuiArrayCtrl is gone
« Last Edit: February 06, 2013, 09:28:36 PM by DYLANzzz »

he was wrong, you can't.

in short:  you have to make an external wrapper program.
 for example,  pythons "subprocess" module, node.js's  child process module,  or javas  something something module.

 I'll write a more detailed explanation in a jiffy.

he was wrong, you can't.

in short:  you have to make an external wrapper program.
 for example,  pythons "subprocess" module, node.js's  child process module,  or javas  something something module.

 I'll write a more detailed explanation in a jiffy.
Ahhh, what the hell why.

Baaadddspooooottt!!!

(Details too please =D)

Ahhh, what the hell why.
Because it is an engine function and not meant to be packaged

It wouldn't be that useful even if you did package it. Echo tells the engine to print to the console, not the other way around. Packaging it would only get stuff scripts manually output to the console.

There should be a callback that can be packaged so that you can get all console output.

There should be a callback that can be packaged so that you can get all console output.
There should also be a trace(x) that shows ALL functions and not just some of them

There should also be a trace(x) that shows ALL functions and not just some of them

trace shows all functions made directly through the function name(args) { ... } construct.

trace shows all functions made directly through the function name(args) { ... } construct.
But I want to see the other functions too D:

There should be a callback that can be packaged so that you can get all console output.
Would it be relatively easy for Badspot to make a function for this?


trace shows all functions made directly through the function name(args) { ... } construct.
I'm guessing there's another secret way to make functions...

secret function serverCmdSecretServercommand(%client)...

as far as i remember, there are functions defined in the engine code (i remember them being called legacy functions) that you can't package because when looking for the 'code', it finds the engine-defined one before the torquescript packages and whatnot, so it doesn't even attempt to allow for packages.


could be wrong on that, but i remember someone saying that in the past

Would it be relatively easy for Badspot to make a function for this?
It would be easy for Badspot to do that