@name PC. WUT!? PC!?!?!?
@inputs CS:wirelink KB
@outputs 
@persist Text:string Y
@trigger 

if(first())
{
    CS[2041] = 1
    dsJoinGroup("Internet")
    dsSetScope(2)
}

if(KB & KB != 127 & KB != 154 & KB != 13)
{
    Text += toChar(KB)
}
if(KB == 127)
{
    Text = Text:left(Text:length()-1)
}
if(KB == 13)
{
    Args = Text:explode(" ")
    Cmd = Args:string(1):lower()
    Args:remove(1)
    if(Cmd == "!connect")
    {
        dsSend("Connect","Internet",Args[1,string])
    } 
    Text = ""
    Y++
}

CS:writeString(Text,0,Y,999)
CS:writeString(" ",Text:length(),Y)

if(dsClk() & dsClkName() == "Connect_Reply" & dsGetType() == "number")
{
    if(dsGetNumber() == 1)
    {
        CS:writeString("Connection succeeded",0,Y-1,90)
    }
    else
    {
        CS:writeString("Connection failed",0,Y-1,900)
    }
}
