mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-07-16 04:54:29 +02:00
initial commit
This commit is contained in:
commit
c782dde326
61 changed files with 1457 additions and 0 deletions
19
scripts/ch7-05-if-else-vars2.rsc
Normal file
19
scripts/ch7-05-if-else-vars2.rsc
Normal file
|
@ -0,0 +1,19 @@
|
|||
# filename: ch7-05-if-else-vars2.rsc
|
||||
|
||||
# Get the current time
|
||||
:local CurrentTime [:system clock get time];
|
||||
:put "The current time is : $CurrentTime";
|
||||
|
||||
# declare the time of day variable
|
||||
:local TimeOfDay
|
||||
|
||||
# Check if it's after noon
|
||||
:if ($CurrentTime > 12:00) do={
|
||||
:set TimeOfDay "Afternoon/Evening"
|
||||
} else={
|
||||
# otherwise, it must be morning (00:00 to 11:59)
|
||||
:set TimeOfDay "Morning"
|
||||
}
|
||||
|
||||
# Print out the time of day
|
||||
:put "At the moment, it's : $TimeOfDay"
|
Loading…
Add table
Add a link
Reference in a new issue