Console Input Plugin for Squirrel

Started by ysc3839, Mar 14, 2015, 05:25 AM

Previous topic - Next topic

Finch Real

Sorry for the Bump Guys But I have loaded cmdinput32 It Loads Plugin But I can't Write Text on console
My Snipet Showroom

http://pastebin.com/5KKuU5cg

ysc3839

Quote from: Finch Real on Jun 19, 2016, 08:26 AMSorry for the Bump Guys But I have loaded cmdinput32 It Loads Plugin But I can't Write Text on console
I'll see it on next weekend.

[Serious]Sam

BIG THANK YOU, this plugin very helpful))) And previously I think what I can control server from app without running a game, BUT you added this plugin I WAS DREAMING about this))) BIG THNX)

Xmair

There is a reason the like button exists.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

[Serious]Sam

#34
Am I doing something wrong?

[Serious]Sam

Quote from: Xmair on Jul 08, 2016, 03:22 PMThere is a reason the like button exists.
Help me if you smart)

EK.IceFlake

Quote from: [Serious]Sam on Jul 08, 2016, 04:07 PMAm I doing something wrong?

Yes
Change if (!text) to if (text == "")

[Serious]Sam

#37
Quote from: EK.CrystalBlue on Jul 09, 2016, 08:36 AM
Quote from: [Serious]Sam on Jul 08, 2016, 04:07 PMAm I doing something wrong?

Yes
Change if (!text) to if (text == "")
I mean, I can't script for this plugin, also I have now Linux, and it's not working here too((
It's just printing text after first word like cmd... This is the problem, I can't do anything else.

Thijn

It's doing exactly what it's suppose to. The cmd variable contains the first word (i.e. the command) and the text variable contains everything after that.

Also, the "commands" don't start with /, they're just the first words.

Xmair

Change
if ( cmd = "print" ) print(text);
To
if ( cmd == "print" ) print(text);

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

ysc3839


kennedyarz

#41
Quote from: ysc3839 on Jun 25, 2018, 06:54 AMVersion 1.3.1 is released. See the first post for more information.
https://bitbucket.org/ysc3839/0.4-cmdinput/downloads/cmdinput1.3.1-apiv2.zip

Excellent! I only have one question


function onConsoleInput(cmd, text)
{
    if( cmd == "exec" )
{
    if(!text) print("[CMD] Use /"+cmd+" <code>");
else
{
                try
                {
                    local script = compilestring( text );
                    if( script )
                    {
                        script();
                        print( "[CMD] Executed.");
                    }
                    else print( "[CMD]Invalid code.");
                }
                catch(e) print(e+"");
            }
}

else if( cmd == "test" ) print("working");
else if( cmd == "cmds" ) print("exec, test");

else return print("[CMD] invalid cmd use cmds");
    }

because when I do not put the (arg <-> text) does not mark prints if I have this function.

if(!text) print("[CMD] Use /"+cmd+" <code>");

ysc3839

Quote from: kennedyarz on Jun 25, 2018, 12:38 PM
Quote from: ysc3839 on Jun 25, 2018, 06:54 AMVersion 1.3.1 is released. See the first post for more information.
https://bitbucket.org/ysc3839/0.4-cmdinput/downloads/cmdinput1.3.1-apiv2.zip

Excellent! I only have one question


function onConsoleInput(cmd, text)
{
    if( cmd == "exec" )
{
    if(!text) print("[CMD] Use /"+cmd+" <code>");
else
{
                try
                {
                    local script = compilestring( text );
                    if( script )
                    {
                        script();
                        print( "[CMD] Executed.");
                    }
                    else print( "[CMD]Invalid code.");
                }
                catch(e) print(e+"");
            }
}

else if( cmd == "test" ) print("working");
else if( cmd == "cmds" ) print("exec, test");

else return print("[CMD] invalid cmd use cmds");
    }

because when I do not put the (arg <-> text) does not mark prints if I have this function.

if(!text) print("[CMD] Use /"+cmd+" <code>");
You lost a "}" after line 5.

kennedyarz

Another error appears.
If at this moment you are writing a command or something else in the console and a new record or print appears, the command is sent automatically. without me having executed it "fix"

Would not it be better to make a separate writing box?

ysc3839

#44
@kennedyarz #43 It didn't sent. It just scrolled up by other message. I'll try to fix it.

Edit: Fixing this issue requires modifying print function, which means I have to modify the code of squirrel plugin. So I won't fix it.