@name Trans Server Communicator
@inputs TextScreen:wirelink
@outputs Receive:string [Fore Back]:vector Buffer:array [Sender Receiver]:string
@persist [Addr Buffer]:array Last:string
@trigger 
#@model models/props_junk/TrashDumpster02b.mdl
@model models//props_combine/headcrabcannister01a_skybox.mdl
Me="maim"
You="otherguy"
GMTOffset=-7 #this is the default GMT like, incase your not on my list down below.
#140 character max player message size

if(owner():name()=="Captain Maim"){
    Sender=Me #put in a unique file name here, no extention
    Receiver=You #put in the unique file name of the other person
}else{
    Sender=You
    Receiver=Me
}

runOnTick(1)
Brk="<<|>>" #I use this to strip off the player's steam ID when displaying on a text screen.


if(first()){
    Fore=vec(0,128,255)
    Back=vec(64,64,64)
    Addr=array()
    Addr:pushString("http://capnmaim.dlinkddns.com:8000/Upload/upload/duplexer.php?") #the address of my PHP file
    #Addr:pushString("http://www1.dd-tech.com:9090/Upload/upload/duplexer.php?") #the address of my PHP file
    Addr:pushString("output=")
    Addr:pushString("") #Write to what file?
    Addr:pushString("&input=")
    Addr:pushString("") #Read from what file?
    Addr:pushString("&inputtext=")
    Addr:pushString("") #what do you want to write to file? 
}
runOnHTTP(1)
runOnChat(1)

if(chatClk()){
    Buffer:pushString(lastSpoke():steamID():replace(":","_")+Brk+lastSpoke():name()+": "+lastSaid())
}

if(Buffer:count()){
    timer("rety",100)
}#else{timer("clear",5000)}
if(httpCanRequest()){Send=1 Message=Buffer:shiftString()}
if(Send){
    #stoptimer("clear")
    O=owner()
    Addr1=Addr:clone()
    Addr1[3,string]=Sender
    Addr1[5,string]=Receiver
    Addr1[7,string]=httpUrlEncode(Message)
    httpRequest(Addr1:concat())
    #if(Message){print(Message)}
}
#if(clk("clear")){
#    Receive=""
#}

if(httpClk()){
    #automatic compensation for spesific users
    SID=owner():steamID()
    if(SID=="STEAM_0:1:9395361"){GMTOffset=-8} #Little Ninja
    if(SID=="STEAM_0:0:7302826"){GMTOffset=-8} #Soap
    if(SID=="STEAM_0:1:19091184"){GMTOffset=-7} #TurtleMadness
    if(SID=="STEAM_0:0:19519871"){GMTOffset=-8} #Polymorph
    if(SID=="STEAM_0:1:8017844"|SID=="STEAM_0:1:20368596"|SID=="STEAM_0:0:25531620"){GMTOffset=-7-time("isdst")} #Captain Maim
    #end compenesation resume time stamp
    L=":"
    if(time("sec")<10){Sec="0"+time("sec")}else{Sec=toString(time("sec"))}
    if(time("min")<10){Min="0"+time("min")}else{Min=toString(time("min"))}
    Hour=time("hour")+GMTOffset
    if((Hour>=(24+GMTOffset))&(Hour<=23)){Day=time("day")}else{Day=time("day")-1}
    if(Hour<0){Hour+=10-GMTOffset*2}
    Time="["+Hour+L+Min+L+Sec+"] "   

    Last=Receive
    Receive=httpUrlDecode(httpData())
    if(Last!=Receive&Receive!=""){printColor(vec(0,128,255),Time+Receive:replace(Brk," "))}
    Dump=Receive:explode(Brk)
    Dump:remove(1)
    Receive=Dump:concat()
    
}
TextScreen["String",string]=Receive
TextScreen["FGColor",vector]=Fore
TextScreen["BGColor",vector]=Back
