mirror of
https://github.com/wifinigel/MikrotikScripting.git
synced 2025-07-09 17:44:30 +02:00
initial commit
This commit is contained in:
commit
c782dde326
61 changed files with 1457 additions and 0 deletions
28
scripts/ch7-06-if-multiple-conditions.rsc
Normal file
28
scripts/ch7-06-if-multiple-conditions.rsc
Normal file
|
@ -0,0 +1,28 @@
|
|||
# filename: ch7-06-multiple-conditions.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 very early
|
||||
:if (($CurrentTime >= 00:00) and ($CurrentTime < 06:00)) do={
|
||||
:put "It's very early in the morning...shouldn't you be in bed?";
|
||||
}
|
||||
|
||||
# Check if its morning
|
||||
:if (($CurrentTime >= 06:00) and ($CurrentTime < 12:00)) do={
|
||||
:put "Good morning!";
|
||||
}
|
||||
|
||||
# Check if its afternoon
|
||||
:if (($CurrentTime >= 12:00) and ($CurrentTime < 17:00)) do={
|
||||
:put "Good afternoon!";
|
||||
}
|
||||
|
||||
# check if its evening
|
||||
:if (($CurrentTime >= 17:00) and ($CurrentTime < 00:00)) do={
|
||||
:put "Good evening!";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue