nerevar / jmc

JMC - Jaba Mud Client
25 stars 15 forks source link

#system command only gives "Error" #71

Closed inspire22 closed 3 years ago

inspire22 commented 7 years ago

I'm trying to grep a file to show lines matching a particular phrase (a player name). Eventually I'd like to use windows FINDSTR, but can't even get basic things to work.

system time gives "Error". I've also tried #system "Time".

system print 'hi' gives Unable to initialize device PRN, which is the same as I get from a console. but echo, or any other commands just give an error.

is there any example of how to use the #system command, or is it broken? Or do I need to use something more complicated like activescript via Jscript or perl.

I've tried with both 3.5 and 3.6

konelav commented 7 years ago

#system command just runs some executable file, JMC is not a "shell" itself, so you should specify full filename (and path in case executable is not in JMC's environmental PATH). Example:

#systemexec findstr.exe /?
#systemexec C:/Windows/system32/find.exe
#systemexec jmc.exe
#ps
#terminate last

Also you can have access to "shell" with batch files. For example, create file "time.bat" in JMC directory with contents

time

and run #system time.bat.

Wo-rM commented 7 years ago

#sys cmd.exe /c echo %date% %time%