Community discussions

MikroTik App
 
andy1989
just joined
Topic Author
Posts: 5
Joined: Sat Jun 05, 2021 9:20 am

Is it possible to implment different script with different mode button holding time ?

Wed Nov 09, 2022 5:34 pm

Hi community,
Is it possible to implment different script with different mode button holding time ?
If yes,will you please show me an example ?
If no, is it possible that Mikrotik Team make it as a TODO feature ?

P.S.
what I want to implment is something like this.
/system routerboard mode-button
set enabled=yes if(hold-time=1s..5s) do={on-event=script1};if(hold-time=6s..10s) do={on-event=script2};
I know the syntax isn't correct , but I am just trying to explain what features I want to implment.
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Is it possible to implment different script with different mode button holding time ?

Wed Nov 09, 2022 6:32 pm

I have a script that can act on several mode button presses:
Mode button with multiple presses
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Is it possible to implment different script with different mode button holding time ?

Wed Nov 09, 2022 7:00 pm

That is an good idea, but maybe I am blind (or not used to git), I do not see the script, only the test for button script.
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Is it possible to implment different script with different mode button holding time ?

Wed Nov 09, 2022 7:31 pm

Read the page from top to bottom please...

You need to do the base installation, then install the script with the commands given. The script does not work on its own as it has dependencies on functions.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3279
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: Is it possible to implment different script with different mode button holding time ?

Wed Nov 09, 2022 10:49 pm

I may be to old to read all ;)

See this now
ℹ️ Info: This script can not be used on its own but requires the base installation. See main README for details.

But I was looking for a small script, not a complete solution for many thing.
 
andy1989
just joined
Topic Author
Posts: 5
Joined: Sat Jun 05, 2021 9:20 am

Re: Is it possible to implment different script with different mode button holding time ?

Sun Nov 13, 2022 12:18 am

Well, Thanks to both of you , for the reply.
I may be to old to read all ;)

See this now
ℹ️ Info: This script can not be used on its own but requires the base installation. See main README for details.

But I was looking for a small script, not a complete solution for many thing.

As @Jotne mentioned , I want something simple instead of bring a whole new scripting environment .
 
User avatar
eworm
Forum Guru
Forum Guru
Posts: 1070
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Is it possible to implment different script with different mode button holding time ?

Sun Nov 13, 2022 4:59 pm

Feel free to take the script ans strip it down to not use any of my global functions... Should be more or less easy with this one.

Who is online

Users browsing this forum: DeltaCreek, Fasder, stevencameron16, TeWe and 88 guests