@name Computer
@inputs S:wirelink X Y Use Button KeyBoard SongName
@outputs Reset SongPlay SongID Text:string
@persist StartMenu PROGRM TextScreen AdminMenu PlayerMenu MediaMenu DocumentsMenu
@persist PlayerSel SelectedPlayer:entity ID:string
@persist Letter Enter EnterCLK
@persist Line1:string Line2:string Line3:string Line4:string Line5:string Line6:string Line7:string Line8:string Line9:string Line10:string
@persist SongList SongPlay SongPitch SongPath:string SongName HL1S HL2S CSSS TF2S SongID
@persist Text:string
@persist
@persist
 
interval(100)
 
# Default
if(first()|(Button&~Button)|Reset) {
    S:writeCell(2041,1)
    S:writeCell(2042,158)
    S:writeString(("Start"),0,17,9,90 - (StartMenu * 50))
    S:writeString(("                         "),5,17,0,9)
    Reset = 0
}# End Default
 
# Startmenu
if(Use&~Use) {
if(Use & (X < 0.18) & (Y > 0.9)) {StartMenu += 1}
if(StartMenu > 1) {StartMenu = 0}
if(!StartMenu) {PROGRM = 0}
 
if(StartMenu) {
S:writeString(("      "),0,16,900,9)
S:writeString(("Server"),0,15,900,9)
S:writeString(("Media "),0,14,900,9)
S:writeString(("My Doc"),0,13,900,9)
S:writeString(("Progrm"),0,12,900,9)
S:writeString(("By Cat"),0,11,111,90)
 
    if(Use & (X < 0.2) & (Y < 0.7) & (Y > 0.65)) {PROGRM += 1}
    if(Use & (X < 0.2) & (Y < 0.8) & (Y > 0.75)) {MediaMenu = 1, StartMenu = 0, TextScreen = 0}
 
    if(PROGRM > 1) {PROGRM = 0}
    if(PROGRM) {
    S:writeString(("Text "),7,11,900,9)
    S:writeString(("Admin"),7,12,900,9)
    S:writeString(("     "),7,13,900,9)
 
    if(Use & (X < 0.375) & (X > 0.215) & (Y < 0.65) & (Y > 0.6)) {TextScreen = 1, StartMenu = 0, PlayerMenu = 0}
    if(Use & (X < 0.375) & (X > 0.215) & (Y < 0.7) & (Y > 0.65)) {PlayerMenu = 1, StartMenu = 0, TextScreen = 0}
 
 
    } else { 
    S:writeString(("      "),6,11)
    S:writeString(("      "),6,12)
    S:writeString(("      "),6,13)}
 
} else {
S:writeString(("      "),0,16)
S:writeString(("      "),0,15)
S:writeString(("      "),0,14)
S:writeString(("      "),0,13)
S:writeString(("      "),0,12)
S:writeString(("      "),0,11)
S:writeString(("      "),6,11)
S:writeString(("      "),6,12)
S:writeString(("      "),6,13)
}
} # End Use
 
#TextScreen
if(Use&~Use) {
if(TextScreen) {
 
    StartMenu = 0
    S:writeCell(2041,1)
    StartMenu = 0
    S:writeCell(2042,888)
    S:writeString(("TextScreen Test              "),0,0,111,999)
    S:writeString(("X"),29,0,111,666)
    if(Use & (X > 0.95) & (Y < 0.1)) {TextScreen = 0, Text = "", Reset = 1}
 
} # End Text Screen
} # End Use
 
if(TextScreen) {
 
if(KeyBoard == 13) {EnterCLK = 1} else {EnterCLK = 0}
if(EnterCLK & $EnterCLK & Enter <= 10) {Enter += 1}
 
if(KeyBoard & ~KeyBoard & Enter == 0) {Line1 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 1) {Line2 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 2) {Line3 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 3) {Line4 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 4) {Line5 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 5) {Line6 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 6) {Line7 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 7) {Line8 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 8) {Line9 += toChar(KeyBoard)}
if(KeyBoard & ~KeyBoard & Enter == 9) {Line10 += toChar(KeyBoard)}
 
S:writeString(Line1,1,3,900)
S:writeString(Line2,1,4,900)
S:writeString(Line3,1,5,900)
S:writeString(Line4,1,6,900)
S:writeString(Line5,1,7,900)
S:writeString(Line6,1,8,900)
S:writeString(Line7,1,9,900)
S:writeString(Line8,1,7,900)
S:writeString(Line9,1,8,900)
S:writeString(Line10,1,9,900)
} # End Text Screen 2
 
 
# Admin Panel
findByClass("Player")
Player1 = findResult(1)
Player2 = findResult(2)
Player3 = findResult(3)
Player4 = findResult(4)
Player5 = findResult(5)
Player6 = findResult(6)
Player7 = findResult(7)
Player8 = findResult(8)
 
if(Use&~Use) {
if(PlayerMenu) {
    
    interval(1500)
    StartMenu = 0
    S:writeCell(2041,1)
    StartMenu = 0
    S:writeCell(2042,888)
    S:writeString(("Player Menu                  "),0,0,111,999)
    S:writeString(("X"),29,0,111,666)
 
    S:writeString(("Name"),2,2,111)
    S:writeString(("Health/Armor"),16,2,111)
    S:writeString(("______________________________"),0,3,111)
 
        S:writeString(Player1:name():left(10),2,5,111)
        S:writeString(Player2:name():left(10),2,6,111)
        S:writeString(Player3:name():left(10),2,7,111)
        S:writeString(Player4:name():left(10),2,8,111)
        S:writeString(Player5:name():left(10),2,9,111)
        S:writeString(Player6:name():left(10),2,10,111)
        S:writeString(Player7:name():left(10),2,11,111)
        S:writeString(Player8:name():left(10),2,12,111)
        
        S:writeString(("HP:"+Player1:health()+ " AR:"+Player1:armor()),15,5,111)
        S:writeString(("HP:"+Player2:health()+ " AR:"+Player2:armor()),15,6,111)
        S:writeString(("HP:"+Player3:health()+ " AR:"+Player3:armor()),15,7,111)
        S:writeString(("HP:"+Player4:health()+ " AR:"+Player4:armor()),15,8,111)
        S:writeString(("HP:"+Player5:health()+ " AR:"+Player5:armor()),15,9,111)
        S:writeString(("HP:"+Player6:health()+ " AR:"+Player6:armor()),15,10,111)
        S:writeString(("HP:"+Player7:health()+ " AR:"+Player7:armor()),15,11,111)
        S:writeString(("HP:"+Player8:health()+ " AR:"+Player8:armor()),15,12,111)
 
    
    if(Use & (X > 0.95) & (Y < 0.1)) {PlayerMenu = 0, Reset = 1}
    if(Use & (Player1:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.3) & (Y < 0.35)) {PlayerSel = 1, AdminMenu = 1}
    if(Use & (Player2:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.35) & (Y < 0.4)) {PlayerSel = 2, AdminMenu = 1}
    if(Use & (Player3:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.4) & (Y < 0.45)) {PlayerSel = 3, AdminMenu = 1}
    if(Use & (Player4:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.45) & (Y < 0.5)) {PlayerSel = 4, AdminMenu = 1}
    if(Use & (Player5:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.5) & (Y < 0.55)) {PlayerSel = 5, AdminMenu = 1}
    if(Use & (Player6:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.55) & (Y < 0.6)) {PlayerSel = 6, AdminMenu = 1}
    if(Use & (Player7:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.6) & (Y < 0.65)) {PlayerSel = 7, AdminMenu = 1}
    if(Use & (Player8:timeConnected() > 1) & (X > 0.08) & (X < 0.4) & (Y > 0.65) & (Y < 0.7)) {PlayerSel = 8, AdminMenu = 1}
 
} # End Playermenu
} # End Use
 
#Admin Menu
if(Use&~Use) {
if(AdminMenu) {
 
interval(1000)
S:writeCell(2041,1)
SelectedPlayer = findResult(PlayerSel) 
PlayerMenu = 0
 
    S:writeString(("Admin Menu                   "),0,0,111,999)
    S:writeString(("X"),29,0,111,666,0)    
    S:writeString(SelectedPlayer:name(),2,2,111)
    S:writeString(("HP:" + SelectedPlayer:health() + " Armor:"+SelectedPlayer:armor()),16,2,111)
    S:writeString(("______________________________"),0,3,111)
    S:writeString(("Back"),20,0,111,900)
 
        S:writeString(("     "),4,6,0,900)
        S:writeString(("     "),4,7,0,900)
        S:writeString(("     "),4,8,0,900)
        S:writeString(("Slap"),4,7,111,900)
        S:writeString(("     "),10,6,0,900)
        S:writeString(("     "),10,7,0,900)
        S:writeString(("     "),10,8,0,900)
        S:writeString(("Slay"),10,7,111,900)
        S:writeString(("     "),16,6,0,900)
        S:writeString(("     "),16,7,0,900)
        S:writeString(("     "),16,8,0,900)
        S:writeString(("Whip"),16,7,111,900)
        S:writeString(("     "),22,6,0,900)
        S:writeString(("     "),22,7,0,900)
        S:writeString(("     "),22,8,0,900)
        S:writeString(("Maul"),22,7,111,900)
        S:writeString(("     "),4,10,0,900)
        S:writeString(("     "),4,11,0,900)
        S:writeString(("     "),4,12,0,900)
        S:writeString(("Igni"),4,11,111,900)
        S:writeString(("     "),10,10,0,900)
        S:writeString(("     "),10,11,0,900)
        S:writeString(("     "),10,12,0,900)
        S:writeString(("unig"),10,11,111,900)
        S:writeString(("     "),16,10,0,900)
        S:writeString(("     "),16,11,0,900)
        S:writeString(("     "),16,12,0,900)
        S:writeString(("Frez"),16,11,111,900)
        S:writeString(("     "),22,10,0,900)
        S:writeString(("     "),22,11,0,900)
        S:writeString(("     "),22,12,0,900)
        S:writeString(("Unfz"),22,11,111,900)
 
if(Use & (X > 0.95) & (Y < 0.1)) {AdminMenu = 0, Reset = 1}
if(Use & (X > 0.66) & (X < 0.78) & (Y < 0.1)) {AdminMenu = 0, PlayerMenu = 1, Reset = 1}
 
if(Use & (X > 0.155) & (X < 2.9) & (Y > 0.365) & (Y < 0.5)) {concmd("ulx slap " + SelectedPlayer:name() + " 10")}
if(Use & (X > 0.36) & (X < 0.51) & (Y > 0.365) & (Y < 0.5)) {concmd("ulx slay " + SelectedPlayer:name())}
if(Use & (X > 0.54) & (X < 0.7) & (Y > 0.365) & (Y < 0.5)) {concmd("ulx whip " + SelectedPlayer:name() + " 10 10")}
if(Use & (X > 0.72) & (X < 0.86) & (Y > 0.365) & (Y < 0.5)) {concmd("ulx maul " + SelectedPlayer:name())}
if(Use & (X > 0.155) & (X < 0.29) & (Y > 0.55) & (Y < 0.67)) {concmd("ulx ignite " + SelectedPlayer:name())}
if(Use & (X > 0.36) & (X < 0.51) & (Y > 0.55) & (Y < 0.67)) {concmd("ulx unignite " + SelectedPlayer:name())}
if(Use & (X > 0.54) & (X < 0.7) & (Y > 0.55) & (Y < 0.67)) {concmd("ulx freeze " + SelectedPlayer:name())}
if(Use & (X > 0.72) & (X < 0.86) & (Y > 0.55) & (Y < 0.67)) {concmd("ulx unfreeze " + SelectedPlayer:name())}
 
} # End Admin Menu
} # End Use
 
# Media Menu
   
if(Use & ~Use) {
if(MediaMenu) {
 
 
    StartMenu = 0
    S:writeCell(2041,1)
    StartMenu = 0
    S:writeCell(2042,888)
    S:writeString(("Media Menu                   "),0,0,111,999)
    S:writeString(("X"),29,0,111,666)
    
    S:writeString(("Song List"),2,2,90,9)    
    if(SongList) {S:writeString(("V"),11,2,900,9)} else {S:writeString(("^"),11,2,900,9)}
    S:writeString(("  "),3,12,111,900)
    S:writeString(("<<"),3,13,900,9)
    S:writeString(("  "),3,14,111,900)
    S:writeString(("  "),25,12,111,900)
    S:writeString((">>"),25,13,900,9)  
    S:writeString(("  "),25,14,111,900)
    S:writeString(("Play"),10,10,90,111)
    S:writeString(("Stop"),16,10,90,111)
    S:writeString(("____________________"),5,11,111)
    S:writeString(("____________________"),5,14,111)
    S:writeString(("Pitch:"),4,16,111)
    S:writeString(("<"),3,16,111,900)
    S:writeString((">"),12,16,111,900)
 
    if(Use & (X > 0.95) & (Y < 0.1)) {MediaMenu = 0, Reset = 1}
    if(Use & (X > 0.35) & (X < 0.465) & (Y > 0.55) & (Y < 0.6)) {SongPlay = 1}
    if(Use & (X > 0.53) & (X < 0.665) & (Y > 0.55) & (Y < 0.6)) {SongPlay = 0}
    if(Use & (X > 0.09) & (X < 0.4) & (Y > 0.13) & (Y < 0.180)) {SongList += 1}
    } # End MediaMenu
    
    #SongMenu - Songlist
 
    if(SongList == 2) {SongList = 0}
    if(SongList) {
 
    S:writeCell(2039,10)
    S:writeString(("Half-life 1"),2,4,9,90)
    S:writeString(("Half-life 2"),2,6,9,90)
    S:writeString(("Counter Strike: Source"),2,8,9,90)
    S:writeString(("Team Fortress 2"),2,10,9,90)
 
    if(Use & (X > 0.08) & (X < 0.43) & (Y > 0.23) & (Y < 0.28)) {HL1S = 1, MediaMenu = 0, SongList = 0, Reset = 1}
    if(Use & (X > 0.08) & (X < 0.43) & (Y > 0.33) & (Y < 0.38)) {HL2S = 1, MediaMenu = 0, SongList = 0, Reset = 1}
    if(Use & (X > 0.08) & (X < 0.78) & (Y > 0.44) & (Y < 0.49)) {CSSS = 1, MediaMenu = 0, SongList = 0, Reset = 1}
    if(Use & (X > 0.08) & (X < 0.565) & (Y > 0.545) & (Y < 0.6)) {TF2S = 1, MediaMenu = 0, SongList = 0, Reset = 1}
    }
    
    if(HL1S) {
 
        MediaMenu = 0
        S:writeCell(2041,1)
        MediaMenu = 0
        S:writeCell(2042,888)
        S:writeString(("Half-Life 1                  "),0,0,111,666)
        S:writeString(("X"),29,0,111,666)
 
        if(Use & (X > 0.95) & (Y < 0.1)) {HL1S = 0, Reset = 1}
        
        S:writeString("HL1_song10.mp3",1,2,111)
        S:writeString("HL1_song11.mp3",1,3,111)
        S:writeString("HL1_song14.mp3",1,4,111)
        S:writeString("HL1_song15.mp3",1,5,111)
        S:writeString("HL1_song17.mp3",1,6,111)
        S:writeString("HL1_song19.mp3",1,7,111)
        S:writeString("HL1_song20.mp3",1,8,111)
        S:writeString("HL1_song21.mp3",1,9,111)
        S:writeString("HL1_song24.mp3",1,10,111)
        S:writeString("HL1_song25_remix3.mp3",1,11,111)
        S:writeString("HL1_song26.mp3",1,12,111)
        S:writeString("HL1_song3.mp3",1,13,111)
        S:writeString("HL1_song5.mp3",1,14,111)
        S:writeString("HL1_song6.mp3",1,15,111)
        S:writeString("HL1_song9.mp3",1,16,111)
        } #END HL1S
        
    if(HL2S) {
        
        MediaMenu = 0
        S:writeCell(2041,1)
        MediaMenu = 0
        S:writeCell(2042,888)
        S:writeString(("Half-Life 2                  "),0,0,111,666)
        S:writeString(("X"),29,0,111,666)
        
        if(Use & (X > 0.95) & (Y < 0.1)) {HL2S = 0, Reset = 1}
        } #End HL2S
        
    if(CSSS) {
        
        MediaMenu = 0
        S:writeCell(2041,1)
        MediaMenu = 0
        S:writeCell(2042,888)
        S:writeString(("Counter Strike: Source       "),0,0,111,666)
        S:writeString(("X"),29,0,111,666)
        
        if(Use & (X > 0.95) & (Y < 0.1)) {CSSS = 0, Reset = 1}        
        } #End CSSS
        
    if(TF2S) {
 
        MediaMenu = 0
        S:writeCell(2041,1)
        MediaMenu = 0
        S:writeCell(2042,888)
        S:writeString(("Team Fortress 2               "),0,0,111,666)
        S:writeString(("X"),29,0,111,666)
        
        if(Use & (X > 0.95) & (Y < 0.1)) {TF2S = 0, Reset = 1}        
        } #End TF2S
        
} # End Use