Community discussions

MikroTik App
 
Wyoming
Member Candidate
Member Candidate
Topic Author
Posts: 124
Joined: Wed Jun 09, 2004 11:43 pm
Location: Wyoming

Error in script

Fri Oct 27, 2006 6:48 pm

Can anyone see why this isn't working? I have tried putting () around it and that won't work either. I am out of ideas.
set 45 name = [:pick [/queue simple get 45 name] 0 28]."-RES"
Thanks
 
Wyoming
Member Candidate
Member Candidate
Topic Author
Posts: 124
Joined: Wed Jun 09, 2004 11:43 pm
Location: Wyoming

Fri Oct 27, 2006 8:48 pm

Or if this doesn't work is there any way and can take two variables and add them together.

:local v1 "firstname"
:local v2 "lastname"

:local FN v1+v2

I tried the + and the . and I can't get either of them to work.

Thanks
 
Wyoming
Member Candidate
Member Candidate
Topic Author
Posts: 124
Joined: Wed Jun 09, 2004 11:43 pm
Location: Wyoming

Fri Oct 27, 2006 11:23 pm

For anyone else that needs this I got it figured out.

:set name ($v1 . $v2)
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Fri Oct 27, 2006 11:29 pm

Right ;)


And for your first question:
You cannot use item numbers (like the 45) in scripts. You have to use the "find" command to find the entry you want to work with using some "find-able" identifier (which could include a comment you put on this very specific entry).

Just for example:
/queue simple set [/queue simple find target-addresses=192.168.1.17/32] name = [:pick [/queue simple get [/queue simple find target-addresses=192.168.1.17/32] name] 0 28]."-RES"
Does that help?

Best regards,
Christian Meis

Who is online

Users browsing this forum: rogerioqueiroz and 2 guests