setup.hasInternet = function(){
    const location = State.variables.location;
    if(location.tags.includes('internet'))
        return true;
    
    const time = State.variables.time;
    let internetData = location.getTagsValuesHere('internet');
    internetData.push(location.getHere('internet'));

    for(const data of internetData){
        if(!data)
            continue;
        if(data === true)
            return true;
        if(typeof data != 'object'){
            console.error('Unsupported type in setup.hasInternet:',data);
            continue;
        }
        if('start' in data && time.isFuture(data.start))
            continue;
        if('end' in data && time.isFuture(data.end))
            return true;
    }

    return false;
}