Community discussions

MikroTik App
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

can I make interactive script?

Thu Dec 15, 2016 5:02 pm

hello ,
can I make an interactive script where I waiting for replay and then save it?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7042
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: can I make interactive script?

Thu Dec 15, 2016 5:11 pm

You mean interaction with the user? That is not possible directly with ROS script.
 
David1234
Forum Guru
Forum Guru
Topic Author
Posts: 1424
Joined: Sun Sep 18, 2011 7:00 pm

Re: can I make interactive script?

Thu Dec 15, 2016 5:29 pm

so only with API?
not in ssh script?
 
PackElend
Member Candidate
Member Candidate
Posts: 269
Joined: Tue Sep 29, 2020 6:05 pm

Re: can I make interactive script?

Wed May 18, 2022 10:01 pm

YES YOU CAN
{
      :local input1 do={:return};
      :put "Input Name: "
      :local name [$input1];
      :local input2 do={:return};
      :put "Input Surname: ";
      :local surname [$input2];
      :put "The full name is : $name $surname."
   
}
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: can I make interactive script?

Thu May 19, 2022 2:14 am

Only unique function can be sufficent:
{
      :local requestvalue do={:put $1 ; :return}
      :local name    [$requestvalue "Insert the name"]
      :local surname [$requestvalue "Insert the surname"]
      :put "The full name is: $name $surname"
}
 
kevinds
Long time Member
Long time Member
Posts: 638
Joined: Wed Jan 14, 2015 8:41 am

Re: can I make interactive script?

Mon May 23, 2022 10:18 pm

hello ,
can I make an interactive script where I waiting for replay and then save it?
*if* you could, what would you want it to do?

Basically, why do you want to?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: can I make interactive script?

Mon May 23, 2022 10:29 pm

Probably, my supposition, for autoconfig script, that once executed (on interactive terminal, obviously)
ask for SSID, passwords, RouterOS users names and passwords, IP???, etc.

I already use that when the CPE is installed to end user: the technician launch the script and do not forget nothing, all is requested.
On error something like this appear on terminal, etc.
(for see the example, paste it on terminal)
/terminal style error;:put "Caratteri non validi nell'SSID"
(IT: Caratteri non validi nell'SSID = EN: Invalid characters on SSID)


Just for test a joke:
{
      :local requestvalue do={:put $1 ; :return}
      :local name    [$requestvalue "Insert test as value"]
      :if ($name != "test") do={
          /terminal style error
          :put "you have not written test"
      } else={
          /terminal style syntax-old
          :put "welldone"
      }
}
 
kevinds
Long time Member
Long time Member
Posts: 638
Joined: Wed Jan 14, 2015 8:41 am

Re: can I make interactive script?

Mon May 23, 2022 10:52 pm

Probably, my supposition, for autoconfig script, that once executed (on interactive terminal, obviously)
ask for SSID, passwords, RouterOS users names and passwords, IP???, etc.
So a replacement for Quick-Set?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: can I make interactive script?

Mon May 23, 2022 10:56 pm

Quick-Set?
What is? :evil:

At least as a working replacement...

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], mvz71, NetHorror, ppawe, TheCat12 and 92 guests