Code:
@name chat
@inputs
@outputs
@persist Color:vector [CA LS2 LS3 WNames LSA ReceiveStr]:array [Chatroom SendStr SendPM PM RecievePm Name LS]:string A
@trigger
runOnChat(1)
gShare(1)
O=owner()
LSA=O:lastSaid():explode("")
LS=O:lastSaid()
LS2=owner():lastSaid():explode(" ")
if(first()){
Color=vec(255,255,255)
A=1
Chatroom="chat"
gSetGroup("chatterboxernators")
printColor(vec(150,0,255),"made by bulletBlr-rpj. Contact jesse1412 on the wm(wire-mod) forums for help.")
}
if(first()|LS=="@help"){
hideChat(1)
hint("type @help to open these hints",7)
hint("type @(Message goes here)",7)
hint("to type in a chatroom",7)
hint(" ",7)
hint("type @join (chatroom-name)",7)
hint("to join a chatroom",7)
hint(" ",7)
hint("type @pm (there name)",7)
hint("to pm some1",7)
hint(" ",7)
hint("type @color N,N,N",7)
hint("to set your chat color",7)
}
if(LS2:string(1)=="@join"&chatClk(O)){
hideChat(1)
Chatroom=LS2:string(2)
hint("you are in chatroom "+Chatroom+"!",5)
hint("re-join the public chat",5)
hint("by typing[ @join chat]",5)
}
if(LS2:string(1)=="@pm"&chatClk(O)){
hideChat(1)
Name=findPlayerByName(LS2:string(2)):name()
hint("PM sent to "+Name,5)
LS3=LS2
LS3:setString(1,"PM from "+O:name()+":")
LS3:setString(2," ")
SendPM=LS3:concat(" ")
gSetStr(Name,SendPM)
hint(SendPM,10)
}
if(LSA:string(1)=="/"&chatClk(O)){
hideChat(1)
LSA:setString(1,"")
SendStr=LSA:concat("")
WNames:setString(1,O:name()+": ")
WNames:setString(2,SendStr)
gSetStr(Chatroom,glonEncode(WNames))
}
if(LS2:string(1)=="@color"&chatClk(O)){
hideChat(1)
CA=LS2:string(2):explode(",")
Color=vec(CA:string(1):toNumber(),CA:string(2):toNumber(),CA:string(3):toNumber())
}
if(chatClk()&A){
gSetStr(O:name(),"")
gSetStr(Chatroom,"")
A=!A
}
RecieveStr=glonDecode(gGetStr(Chatroom))
RecievePm=gGetStr(O:name())
if(changed(RecieveStr:string(2))&lastSaid():explode(""):string(1)=="/"){
printColor(teamColor(lastSpoke():team()),Chatroom+", "+RecieveStr:string(1),Color,RecieveStr:string(2))
}
if(changed(RecievePm)&chatClk()&lastSaid():explode(""):string(1)=="@pm"){
printColor(vec(150,0,255),RecievePm)
} the commands are quite simple:
Bookmarks