---
# System prepended metadata

title: Untitled

---

// t0.txt="N VEGJWS/" // Canada
// t0.txt="N HL5BBD /" // shouldn't be US flag
if(t0.txt=="Listening")
{
    vis p1,0
    t1000.txt=""
    t7.txt=""
    onair.val=0
    covx minutes.val,minutesStr.txt,2,0
}else if(t0old.txt!=t0.txt) // skip if call hasn't been read or it's the same
{
    onair.val=1
    vis p1,1
    t0old.txt=t0.txt
    substr t0.txt,char.txt,2,1 // read first char of call
    substr t0.txt,string.txt,2,2 // first 2 letters of prefix
    substr t0.txt,prefix.txt,2,3 //get callsign prefix (3 chars)
    substr t0.txt,extendedPrefix.txt,2,4 // 4 chars of prefix
    if(char.txt=="A"||char.txt=="K"||char.txt=="N"||char.txt=="W") // USA prefixes with exceptions
    {
        if(string.txt=="AX") // Australia
        {
            p1.pic=7 // au.png
            t1000.txt="Australia"
        }
        if(prefix.txt=="KP3"||prefix.txt=="KP4"||prefix.txt=="NP3"||prefix.txt=="NP4"||prefix.txt=="WP3"||prefix.txt=="WP4") // Puerto Rico
        {
            p1.pic=16 // pr.png Puerto Rico
            t1000.txt="Puerto Rico"
        }else // United States - Some prefixes under each are further specialized, default to USA for now
        {
            // TODO: there are other countries that use the letter A prefix besides the United States
            p1.pic=24 // us.png United States
            t1000.txt="United States"
        }
    }else if(char.txt=="I")
    {
        p1.pic=12 // it.png Italy
        t1000.txt="Italy"
    }else if(string.txt=="ZK"||string.txt=="ZL"||string.txt=="ZM")
    {
        p1.pic=14 // nz.png New Zealand
        t1000.txt="New Zealand"
    }else if(char.txt=="V"||char.txt=="2"||char.txt=="G"||char.txt=="M"||string.txt=="ZN"||string.txt=="ZO"||string.txt=="ZQ")
    {
        // default to GB first
        p1.pic=11 // gb.png Great Britain / United Kingdom
        t1000.txt="United Kingdom"
        if(string.txt=="2E")
        {
            // TODO: England
        }else if(string.txt=="V2")
        {
            p1.pic=22 // ag.png
            t1000.txt="Antigua"
        }else if(string.txt=="V3")
        {
            p1.pic=54 // bz.png
            t1000.txt="Belize"
        }else if(string.txt=="V4")
        {
            p1.pic=137 // kn.png
            t1000.txt="Saint Kitts and Nevis" // St Kitts? 
        }else if(string.txt=="V5")
        {
            p1.pic=177 // na.png
            t1000.txt="Namibia"
        }else if(string.txt=="V6")
        {
            p1.pic=88 // fm.png
            t1000.txt="Micronesia"
        }else if(string.txt=="V7")
        {
            p1.pic=160 // mh.png
            t1000.txt="Marshall Islands"
        }else if(string.txt=="V8")
        {
            p1.pic=45 // bn.png
            t1000.txt="Brunei" // Brunei Darussalam? 
        }else if(extendedPrefix.txt=="VP2E")
        {
            p1.pic=23 // ai.png
            t1000.txt="Anguilla"
        }else if(extendedPrefix.txt=="VP2M")
        {
            p1.pic=169 // ms.png
            t1000.txt="Monsterrat"
        }else if(extendedPrefix.txt=="VP2V")
        {
            p1.pic=251 // vg.png
            t1000.txt="British Virgin Islands"
        }else if(prefix.txt=="VP5")
        {
            p1.pic=227 // tc.png
            t1000.txt="Turks and Caicos Islands"
        }else if(prefix.txt=="VP6")
        {
            p1.pic=195 // pn.png
            t1000.txt="Pitcairn Islands"
        }
        // TODO: rest of V callsigns
    }else if(string.txt=="3Z"||string.txt=="HF"||string.txt=="SN"||string.txt=="SO"||string.txt=="SP"||string.txt=="SQ"||string.txt=="SR")
    {
        p1.pic=15 // pl.png Poland
        t1000.txt="Poland"
    }else if(string.txt=="VH"||string.txt=="VI"||string.txt=="VJ"||string.txt=="VK"||string.txt=="VL"||string.txt=="VM"||string.txt=="VN"||string.txt=="VZ")
    {
        p1.pic=7 // au.png Australia
        t1000.txt="Australia"
    }else if(char.txt=="F"||string.txt=="HW"||string.txt=="HX"||string.txt=="HY"||string.txt=="TH"||string.txt=="TK"||string.txt=="TM"||string.txt=="TO"||string.txt=="TP"||string.txt=="TQ"||string.txt=="TV"||string.txt=="TW"||string.txt=="TX")
    {
        p1.pic=10 // fr.png France
        t1000.txt="France"
    }else if(string.txt=="PA"||string.txt=="PB"||string.txt=="PC"||string.txt=="PD"||string.txt=="PE"||string.txt=="PF"||string.txt=="PG"||string.txt=="PH"||string.txt=="PI"||prefix.txt=="PJ2"||prefix.txt=="PJ4"||prefix.txt=="PJ5"||prefix.txt=="PJ7")
    {
        p1.pic=18 // nl.png Netherlands
        t1000.txt="Netherlands"
    }else if(string.txt=="DA"||string.txt=="DB"||string.txt=="DC"||string.txt=="DD"||string.txt=="DE"||string.txt=="DF"||string.txt=="DG"||string.txt=="DH"||string.txt=="DI"||string.txt=="DJ"||string.txt=="DK"||string.txt=="DL"||string.txt=="DM"||string.txt=="DN"||string.txt=="DO"||string.txt=="DP"||string.txt=="DQ"||string.txt=="DR")
    {
        p1.pic=9 // de.png Germany
        t1000.txt="Germany"
    }else if(string.txt=="CF"||string.txt=="CG"||string.txt=="CH"||string.txt=="CI"||string.txt=="CJ"||string.txt=="CK"||string.txt=="CY"||string.txt=="CZ"||string.txt=="VA"||string.txt=="VB"||string.txt=="VC"||string.txt=="VD"||string.txt=="VE"||string.txt=="VF"||string.txt=="VG"||string.txt=="VO"||string.txt=="VX"||string.txt=="VY"||string.txt=="XJ"||string.txt=="XK"||string.txt=="XL"||string.txt=="XM"||string.txt=="XN"||string.txt=="XO")
    {
        p1.pic=8 // ca.png Canada
        t1000.txt="Canada"
    }else if(string.txt=="7J"||string.txt=="7K"||string.txt=="7L"||string.txt=="7M"||string.txt=="7N"||string.txt=="8J"||string.txt=="8K"||string.txt=="8L"||string.txt=="8M"||string.txt=="8N"||string.txt=="JA"||string.txt=="JB"||string.txt=="JC"||string.txt=="JD"||string.txt=="JE"||string.txt=="JF"||string.txt=="JG"||string.txt=="JH"||string.txt=="JI"||string.txt=="JJ"||string.txt=="JK"||string.txt=="JL"||string.txt=="JM"||string.txt=="JN"||string.txt=="JO"||string.txt=="JP"||string.txt=="JQ"||string.txt=="JR"||string.txt=="JS")
    {
        p1.pic=13 // jp.png Japan
        t1000.txt="Japan"
    }else if(char.txt=="T")
    {
        if(string.txt=="T2") // Tuvalu
        {
            p1.pic=240//tv.png
            t1000.txt="Tuvalu"
        }else if(string.txt=="T3")
        {
            p1.pic=135 // ki.png
            t1000.txt="Kiribati"
        }else if(string.txt=="T4")
        {
            p1.pic=67// cu.png
            t1000.txt="Cuba"
        }else if(string.txt=="T5")
        {
            p1.pic=219 // so.png 
            t1000.txt="Somalia" // Somali Democratic Republic?
        }else if(string.txt=="T6")
        {
            p1.pic=21// af.png
            t1000.txt="Afghanistan"
        }else if(string.txt=="T7")
        {
            if(prefix.txt=="T70")
            {
                t1000.txt="SPecial Event and Club Stations "
            }else if(prefix.txt=="T72")
            {
                t1000.txt="VHF"
            }else if(prefix.txt=="T77")
            {
                t1000.txt="HF"
            }else
            {
                p1.pic=217 // sm.png
                t1000.txt="San Marino"
            }
        }else if(string.txt=="T8")
        {
            p1.pic=198// pw.png
            t1000.txt="Palau" // T88==Belau (historic name of Palau?)
        }
        else if(string.txt=="TA")
        {
            p1.pic=238// tr.png
            t1000.txt="Turkey" 
        }else if(string.txt=="TD"||string.txt=="TG")
        {
            p1.pic=109 // gt.png
            t1000.txt="Guatemala"
        }else if(string.txt=="TE"||string.txt=="TI")
        {
            p1.pic=66 //cr.png
            t1000.txt="Costa Rica"
        }else if(string.txt=="TF")
        {
            p1.pic=127 // is.png
            t1000.txt="Iceland"
        }else if(string.txt=="TJ")
        {
            p1.pic=63//cm.png
            t1000.txt="Cameroon"
        }else if(string.txt=="TL")
        {
            p1.pic=57 //cf.png
            t1000.txt="Central African Republic"
        }else if(string.txt=="TN")
        {
            p1.pic=58 //cg.png
            t1000.txt="Congo"
        }else if(string.txt=="TR")
        {
            p1.pic=90 //ga.png
            t1000.txt="Gabon" // Gabonese Republic? 
        }else if(string.txt=="TS")
        {
            p1.pic=236 // tn.png
            t1000.txt="Tunisia"
        }else if(string.txt=="TT")
        {
            p1.pic=228 // td.png
            t1000.txt="Chad"
        }else if(string.txt=="TU")
        {
            p1.pic=60 // ci.png
            t1000.txt="Ivory Coast"
        }else if(string.txt=="TY")
        {
            p1.pic=42 // bj.png
            t1000.txt="Benin"   
        }
        // TODO: rest of T9
    }else if(char.txt=="U")
    {
        if(string.txt=="UJ"||string.txt=="UK"||string.txt=="UL"||string.txt=="UM")
        {
            p1.pic=247 // uz.png
            t1000.txt="Uzbekistan"
        }else if(string.txt=="UN"||string.txt=="UO"||string.txt=="UP"||string.txt=="UQ")
        {
            p1.pic=142 // kz.png
            t1000.txt="Kazakhstan"
        }else if(string.txt=="UR"||string.txt=="US"||string.txt=="UT"||string.txt=="UU"||string.txt=="UV"||string.txt=="UW"||string.txt=="UX"||string.txt=="UY"||string.txt=="UZ")
        {
            p1.pic=243 // ua.png
            t1000.txt="Ukraine"
        }else
        {
            p1.pic=204 // ru.png 
            t1000.txt="Russia"
        }
    }
    else
    {
        vis p1,0
        t1000.txt=""
    }
}

