help me with this simple script

hello all..
iam writing a simple script to test the idle time of a pppoe-client then disable it and enable it again but it is not working!! :frowning: can anyone help

/interface pppoe-client monitor pppoe-out1 once
 do={
       :if ($"idle-time" >= 10s) do={
                      /interface disable pppoe-out1;
                      :delay 3s;
                      /interface enable pppoe-out1;
       }
}

i know the problem is how to get the time value of idle-time from the monitor..

thx in advance

Take a look at the scipts in the wiki. The examples should help you out.

http://wiki.mikrotik.com/wiki/Scripts

thx Aug for replying but i have read many script examples from this forum and at wiki..
i just know where is my error
it is in getting the value of idle-time of the interface

$"idle-time" >= 10s

iam sure that is not the way to get the idle-time..
ANY IDEAS??!

thx again

BUSTED !!! :smiley:

i know this is not much but i would like to share it..

:local t 0
/ interface pppoe-client monitor pppoe-out1 once do={     :set t $idle-time      }

:if ($t > 10s) do={

/interface disable pppoe-out1;
 :delay 3s;
 /interface enable pppoe-out1;
}

thx all