Computer Science Canada

IRC Client in Turing 3.11

Author:  echeese [ Fri Nov 28, 2003 11:40 am ]
Post subject:  IRC Client in Turing 3.11

var data, svr, name : string
var ns : int
put "Please enter your nick:"
get name
function returnword (s : string, separator : char, n : int) : string
var wi := 0
var s2 := ""
for i : 1 .. length (s)
if wi >= n then
if s (i) = separator then
result s2
end if
s2 += s (i)
end if
if s (i) = separator then
wi += 1
end if

end for
if s2 not= "" then
result s2
else
result "Couldn't find that many words!"
end if

end returnword

function returnwords (s : string, separator : char, n : int) : string
var wi := 0
var s2 := ""
for i : 1 .. length (s)
if wi >= n then
s2 += s (i)
end if
if s (i) = separator then
wi += 1
end if

end for
if s2 not= "" then
result s2
else
result "Couldn't find that many words!"
end if

end returnwords


proc parse (data : string)
if returnword (data, " ", 0) = "PING" then
put : ns, "PONG ", returnword (data, " ", 1)
elsif returnword (data, " ", 1) = "376" then
put : ns, "JOIN #oot"
elsif returnword (data, " ", 1) = "PRIVMSG" then
put "<", returnword (data, "!", 0) (2 .. *), "> ",
returnwords (data, " ", 3) (2 .. *)
else
put data ..
end if
end parse

ns := Net.OpenConnection ("irc.choopa.net", 6667)
put : ns, "USER ", name, " echeese echeese :echeese"
put : ns, "NICK ", name
loop
if Net.CharAvailable (ns) then
get : ns, data : *
parse (data)
end if
if hasch then
get data : *
put : ns, "privmsg #oot :", data
end if
end loop

Author:  templest [ Fri Dec 05, 2003 4:10 pm ]
Post subject: 

DUUDE.... LEET! +10 bits Just because it Turing ... ON IRC... Too bad you can't actually chat... Confused

Author:  echeese [ Mon Dec 08, 2003 12:50 pm ]
Post subject: 

Actually, you CAN chat, just type and hit enter

Author:  PaddyLong [ Mon Dec 08, 2003 1:14 pm ]
Post subject: 

that's pretty cool +bits

Author:  krikor0322 [ Wed Feb 25, 2004 5:35 pm ]
Post subject:  Wow

dude your brilliant ... this will even connect through firewalls for some reason... works for me at school haha good job bro

Author:  jonos [ Wed Feb 25, 2004 5:57 pm ]
Post subject: 

i can connect, but i can't see anyone chatting, i just type in words. that's awesome though...

Author:  Maverick [ Wed Feb 25, 2004 7:09 pm ]
Post subject: 

sweet arse job. u deserve money, but instead u shall recieve bits

Author:  apomb [ Thu Feb 26, 2004 6:47 pm ]
Post subject: 

WOW!! but how do you actually chat .. does someone have to be on at the same time? well it is crazy awsome!

Author:  Cervantes [ Thu Feb 26, 2004 7:04 pm ]
Post subject: 

looks good! But can you actually chat with other ppl?

Author:  shorthair [ Thu Feb 26, 2004 8:35 pm ]
Post subject: 

i hate to plug this old thread up , but for the whole nine yards templests is really good for chat but with mine you can cheack your email , FROM SCHOOL , connect to an irc server , go ont oan FTP , you can chat (2 people ), its not hard , i posted my source to it for peopel to learn , turing has a nice easy way of ding it but its very basic , THATS THE END OF MY PLUG


: