Script ini dibuat untuk melengkapi tutorial video di Chanel Labkom TV

Script yang di simpan di Profile ON LOGIN

:local date [/system clock get date];
:local comment [/ppp secret get [/ppp secret find where name="$user"] comment];
:local nol [:pick $comment 0 1];
:if ($nol = 0) do={ 
/ppp secret set comment="$date/$comment" [find name="$user"];
} 
:if ($comment = "")  do={
:log warning "User $user WA belum di isi";
}

Script yang dijalankan dengan Schedule

:local date [ /system clock get date ];
:local varDay [:pick $date 4 6];
:local user value=[/ppp secret find];
:local pesan "Pelanggan Labkom yang terhormat";
:foreach users in=$user do={
:local comment [/ppp secret get $users value-name=comment];
:local u [/ppp secret get $users value-name=name];
:local tgl [:pick $comment 4 6];
:local wa [:pick $comment 12 25];
:if ($varDay = $tgl) do={ 
/ppp secret disable [find name=$u];
/ppp active remove [find name=$u];
/tool fetch http-header-field="content-type: application/x-www-form-urlencoded" http-method=post http-data="number=$wa&message=$pesan" url="http://XXXXX/send-message" keep-result=no;
:log warning "Pesan terkirim ke $wa";
}
};
:log warning "Pesan berhasil terkirim semua";

Leave a Reply