Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 IRC Client in Turing 3.11
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
echeese




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
templest




PostPosted: Fri Dec 05, 2003 4:10 pm   Post subject: (No subject)

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




PostPosted: Mon Dec 08, 2003 12:50 pm   Post subject: (No subject)

Actually, you CAN chat, just type and hit enter
PaddyLong




PostPosted: Mon Dec 08, 2003 1:14 pm   Post subject: (No subject)

that's pretty cool +bits
krikor0322




PostPosted: 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
jonos




PostPosted: Wed Feb 25, 2004 5:57 pm   Post subject: (No subject)

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




PostPosted: Wed Feb 25, 2004 7:09 pm   Post subject: (No subject)

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




PostPosted: Thu Feb 26, 2004 6:47 pm   Post subject: (No subject)

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




PostPosted: Thu Feb 26, 2004 7:04 pm   Post subject: (No subject)

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




PostPosted: Thu Feb 26, 2004 8:35 pm   Post subject: (No 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: