Automating Alfa Telecommunication credit transfer

Transfering big amount of alfa credits from one number to another can be tiresome because you can only transfer a maximum of $3 per transfer.

Here is a tampermonkey script to make life easier.

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://www.alfa.com.lb/en/account/pay-and-recharge/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=alfa.com.lb
// @grant        GM_log
// ==/UserScript==

(function() {
    'use strict';

    if (window.location.href.endsWith('credit-transfer-success')) {
        window.location.href = '/en/account/pay-and-recharge/credit-transfer'
        return
    }

    let submitbtn = document.querySelector('button[type=submit].alfabtn')
    if (submitbtn.innerText.toLowerCase().includes('submit')) {
        document.querySelector('#MobileNumber').value = "12345678";
        document.querySelector('#ConfirmMobileNumber').value = "12345678";
        document.querySelector('#Amount').value = "3";
        submitbtn.click()
    } else if (submitbtn.innerText.toLowerCase().includes('confirm')) {
        let pincode = document.querySelector('input#pincode')
        pincode.addEventListener('keyup', () => {
            if (pincode.value.length == 6) {
                submitbtn.click()
                setTimeout(() => {
                    window.location.href = '/en/account/pay-and-recharge/credit-transfer'
                }, 1000)
            }
        })
    }
})();