Feature
Linux readline support.
In past version of this plugin, if you press arrow keys you will get characters like "^[[A^[[B^[[C^[[D".
Now with readline you can move the cursor or use command history.
Usage
function onConsoleInput(cmd, arg)
{
print(cmd + " " + arg);
}
Source & Download
https://bitbucket.org/ysc3839/0.4-cmdinput/downloads/
Version 1.3.1+ works on both v23(04rel004) and v30(04rel006) servers.
Any usage example ?
if you are asking about how to use it then you can use it like this.
one example
function onConsoleInput(cmd,text)
{
if (cmd = "test") print(text);
}
will output this http://s20.postimg.org/sv2xkxij1/2015_03_14_165423.png
when you type "test this is some test to check this plugin" in console.
btw thankx for the plugin ysc :).
So, this happens once when you start the server? The server start-up is paused until the user inserts some text with something like std::cin and then it can proceed? Well, if your server has an auto-restart-on-crash protection then you might need to re-think your script.
Quote from: S.L.C on Mar 14, 2015, 12:15 PMSo, this happens once when you start the server? The server start-up is paused until the user inserts some text with something like std::cin and then it can proceed? Well, if your server has an auto-restart-on-crash protection then you might need to re-think your script.
I don't know what you say. I use a thread to get user's input, and then use OnFrame to execute the script.
Quote from: ysc3839 on Mar 14, 2015, 03:34 PMI don't know what you say. I use a thread to get user's input, and then use OnFrame to execute the script.
Why not just say that in the first place :-\ Every plugin deserves an introduction and not just:
Download my plugin here...
FINALLY DAMN IT!
Atleast won't need to go ingame to test or execute a simple thing now... very helpful.
Quote from: S.L.C on Mar 14, 2015, 03:40 PMQuote from: ysc3839 on Mar 14, 2015, 03:34 PMI don't know what you say. I use a thread to get user's input, and then use OnFrame to execute the script.
Why not just say that in the first place :-\ Every plugin deserves an introduction and not just: Download my plugin here...
There is the plugin source code. I don't want to say anything.
Quote from: ysc3839 on Mar 15, 2015, 02:29 AMThere is the plugin source code. I don't want to say anything.
Not anyone can read through C++ source code :-\
Quote from: S.L.C on Mar 15, 2015, 10:14 AMQuote from: ysc3839 on Mar 15, 2015, 02:29 AMThere is the plugin source code. I don't want to say anything.
Not anyone can read through C++ source code :-\
I agree with S.L.C. Provide a simple documentation about your plugin so that users can know what your plugin can do. How hard can that be?
I see a lot of new people here, who haven't ever used 0.3zR2 squirrel server and onConsoleInput in their scripts, seriously. :)
Feel free to PM me for Linux .so :P
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fimg.vc-mp.pl%2Fimages%2Fy1F9xfLPJ.png&hash=752bbeed04192e80055efffa983f6a9bc58dfb1f)
Quote from: Gudio on Mar 15, 2015, 11:26 AMFeel free to PM me for Linux .so :P
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fimg.vc-mp.pl%2Fimages%2Fy1F9xfLPJ.png&hash=752bbeed04192e80055efffa983f6a9bc58dfb1f)
I hope you can put the source code on internet! :)
BTW, Can you give me your plugin in the image? I think is useful!
@ysc3839 - cmdinputrel32 isnt there in bitbucket.Please reupload. Thanks.
Quote from: jayant on Mar 28, 2015, 06:41 AM@ysc3839 - cmdinputrel32 isnt there in bitbucket.Please reupload. Thanks.
It is.
Quote from: jayant on Mar 28, 2015, 06:41 AM@ysc3839 - cmdinputrel32 isnt there in bitbucket.Please reupload. Thanks.
https://bitbucket.org/ysc3839/0.4-cmdinput/downloads/cmdinputrel32.dll
?
"404,Oops you've found a dead link" I should have posted this before..
Quote from: jayant on Mar 28, 2015, 06:41 AM@ysc3839 - cmdinputrel32 isnt there in bitbucket.Please reupload. Thanks.
reuploaded! :)
Can you update for the new 0.4 candidate, thanks.
Quote from: Doom_Killer on Apr 18, 2015, 02:28 PMCan you update for the new 0.4 candidate, thanks.
Just updated! https://bitbucket.org/ysc3839/0.4-cmdinput/downloads
Updated plugin header. https://bitbucket.org/ysc3839/0.4-cmdinput/downloads
Added Linux support! :D
dll download https://bitbucket.org/ysc3839/0.4-cmdinput/downloads
zip download (https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2Fc4abad6243de49743cebbdb17b444af2%2F0.4-cmdinput.zip&hash=9926f49628a01b60dd4b260c34b6fa53ebd0a73d) (http://files.thijn.ovh/download/c4abad6243de49743cebbdb17b444af2/0.4-cmdinput.zip)
I have removed the critical section. If you found any bug please PM me!
Quote from: ysc3839 on Feb 20, 2016, 01:22 PMAdded Linux support! :D
dll download https://bitbucket.org/ysc3839/0.4-cmdinput/downloads
zip download (https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2Fc4abad6243de49743cebbdb17b444af2%2F0.4-cmdinput.zip&hash=9926f49628a01b60dd4b260c34b6fa53ebd0a73d) (http://files.thijn.ovh/download/c4abad6243de49743cebbdb17b444af2/0.4-cmdinput.zip)
I have removed the critical section. If you found any bug please PM me!
Virus
Quote from: [DS]Anik on Feb 20, 2016, 01:25 PMQuote from: ysc3839 on Feb 20, 2016, 01:22 PMAdded Linux support! :D
dll download https://bitbucket.org/ysc3839/0.4-cmdinput/downloads
zip download (https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2Fc4abad6243de49743cebbdb17b444af2%2F0.4-cmdinput.zip&hash=9926f49628a01b60dd4b260c34b6fa53ebd0a73d) (http://files.thijn.ovh/download/c4abad6243de49743cebbdb17b444af2/0.4-cmdinput.zip)
I have removed the critical section. If you found any bug please PM me!
Virus
If you think it's virus, you can compile by yourself. :)
https://www.virustotal.com/nl/file/f3e7d4432b71f1a59d3140faef0b24b335474089893c70b6933fe2f83ce67522/analysis/
It's pretty much clean, in case you don't want to/can't compile yourself.
Update to the new plugin API.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2Fe8e6bfbe98441934a62c2a2cd440a724%2F0.4-cmdinput-fixed.zip&hash=32920ff834cfef02e82f0addd40073c9a6473183) (http://files.thijn.ovh/download/e8e6bfbe98441934a62c2a2cd440a724/0.4-cmdinput-fixed.zip)
I have a Error while loading your Plugin.
Error Message: Plugin error >> GetProcAddress() 'plugins/cmdinputrel64.dll' failed: Code 127 Failed to loag plugin: cmdinputrel64
Quote from: Pun1sh3r on May 09, 2016, 07:58 PMI have a Error while loading your Plugin.
Error Message: Plugin error >> GetProcAddress() 'plugins/cmdinputrel64.dll' failed: Code 127 Failed to loag plugin: cmdinputrel64
I'll fix it on the weekends.
Fixed.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2Fe8e6bfbe98441934a62c2a2cd440a724%2F0.4-cmdinput-fixed.zip&hash=32920ff834cfef02e82f0addd40073c9a6473183) (http://files.thijn.ovh/download/e8e6bfbe98441934a62c2a2cd440a724/0.4-cmdinput-fixed.zip)
Quote from: ysc3839 on May 21, 2016, 10:00 AMFixed.
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Ffiles.thijn.ovh%2Fimg%2Fe8e6bfbe98441934a62c2a2cd440a724%2F0.4-cmdinput-fixed.zip&hash=32920ff834cfef02e82f0addd40073c9a6473183) (http://files.thijn.ovh/download/e8e6bfbe98441934a62c2a2cd440a724/0.4-cmdinput-fixed.zip)
Thanks, works fine!
Sorry for the Bump Guys But I have loaded cmdinput32 It Loads Plugin But I can't Write Text on console
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.
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)
There is a reason the like button exists.
Am I doing something wrong?
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FTzklTW9.png&hash=72d0c0a0ba57acaa3fbe46565b8541442a3c79eb)
Quote from: Xmair on Jul 08, 2016, 03:22 PMThere is a reason the like button exists.
Help me if you smart)
Quote from: [Serious]Sam on Jul 08, 2016, 04:07 PMAm I doing something wrong?
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FTzklTW9.png&hash=72d0c0a0ba57acaa3fbe46565b8541442a3c79eb)
Yes
Change if (!text) to if (text == "")
Quote from: EK.CrystalBlue on Jul 09, 2016, 08:36 AMQuote from: [Serious]Sam on Jul 08, 2016, 04:07 PMAm I doing something wrong?
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FTzklTW9.png&hash=72d0c0a0ba57acaa3fbe46565b8541442a3c79eb)
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.
(https://i.imgur.com/M8ii2Px.png)
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.
Change
if ( cmd = "print" ) print(text);
To
if ( cmd == "print" ) print(text);
Version 1.3.1 is released. See the first post (https://forum.vc-mp.org/?topic=387.0) for more information.
https://bitbucket.org/ysc3839/0.4-cmdinput/downloads/cmdinput1.3.1-apiv2.zip
Quote from: ysc3839 on Jun 25, 2018, 06:54 AMVersion 1.3.1 is released. See the first post (https://forum.vc-mp.org/?topic=387.0) 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>");
Quote from: kennedyarz on Jun 25, 2018, 12:38 PMQuote from: ysc3839 on Jun 25, 2018, 06:54 AMVersion 1.3.1 is released. See the first post (https://forum.vc-mp.org/?topic=387.0) 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.
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?
@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.
Version 1.3.2 is released.
Now "arguments" (the second parameter of onConsoleInput) will be null if it's no space in input string.
For example, when you type "abc", you will get cmd="abc" and arg=null.
when you type "abc def", you will get cmd="abc" and arg="def".
https://bitbucket.org/ysc3839/0.4-cmdinput/downloads/cmdinput1.3.2-apiv2.zip