SMS script run and variable passing. Any help?

Wiki is not clear about this usefull function

I send an sms like this:

:cmd mypass script myscript myvar=hello

this is “myscript” code:

:global myvar
:log info "--- myscript run"
:log info $myvar
:log info "--- myscript end"

It doesn’t work. I also tryed to declare myvar “local” without success.

The sms “var=value” feature it is declared on wiki but is it officially supported by Mikrotik?
I would like to use it, to make RB answer to the right sms number.

UP

any answer?

if you have one script that sets some value, first you have to set up the variable in your first script, like:

{:global myvar lala}

then you can access this global variable from other script

{
:global myvar
log info $myvar
}

btw, are you sure :cmd command exist?

maybe the subject could be confusing.

I’m referring to GSM Short Message System sript run feature.

:cmd is explained in this page and works

http://wiki.mikrotik.com/wiki/Sms

problem is remote variable settings by script.

Hi,

Updates?

I’m also trying to make it work, but it seems that this feature is not working properly.

I also have a similar issue to settle. Am trying to do a sms to my tik to create a hotspot user. The user name password and comments are to be specified on the sms.

Here is the sms:

cmd mypass script Hotuser username1=“john” pass1=“john12” comment1=“252 789”


mypass is my secret, Hotuser is the name of my script, username1,pass1,comment1 are my variables to capture username password and comment respectively.


Here is the script(script name:Hotuser)

:global username1
:global pass1
:global comment1

/ip hotspot user add name=$username1 password=$pass1 limit-uptime=24h profile=450k server=All comment=$comment1


The output should add a user by name: john password: john12 ans comment:252 789 to the hotspot.

I also have a similar issue to settle. Am trying to do a sms to my tik to create a hotspot user. The user name password and comments are to be specified on the sms.

Here is the sms:

cmd mypass script Hotuser username1=“john” pass1=“john12” comment1=“252 789”


mypass is my secret, Hotuser is the name of my script, username1,pass1,comment1 are my variables to capture username password and comment respectively.


Here is the script(script name:Hotuser)

:global username1
:global pass1
:global comment1

/ip hotspot user add name=$username1 password=$pass1 limit-uptime=24h profile=450k server=All comment=$comment1


The output should add a user by name: john password: john12 ans comment:252 789 to the hotspot.

My method not working. can someone please help?

pls share code please this good for pakistan