
-----------------------------------
echeese
Fri Nov 28, 2003 11:40 am

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 " ",
            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

-----------------------------------
templest
Fri Dec 05, 2003 4:10 pm


-----------------------------------
DUUDE.... LEET! +10 bits Just because it Turing ... ON IRC... Too bad you can't  actually  chat...  :?

-----------------------------------
echeese
Mon Dec 08, 2003 12:50 pm


-----------------------------------
Actually, you CAN chat, just type and hit enter

-----------------------------------
PaddyLong
Mon Dec 08, 2003 1:14 pm


-----------------------------------
that's pretty cool +bits

-----------------------------------
krikor0322
Wed Feb 25, 2004 5:35 pm

Wow
-----------------------------------
dude your brilliant ... this will even connect through firewalls for some reason... works for me at school haha good job bro

-----------------------------------
jonos
Wed Feb 25, 2004 5:57 pm


-----------------------------------
i can connect, but i can't see anyone chatting, i just type in words. that's awesome though...

-----------------------------------
Maverick
Wed Feb 25, 2004 7:09 pm


-----------------------------------
sweet arse job. u deserve money, but instead u shall recieve bits

-----------------------------------
apomb
Thu Feb 26, 2004 6:47 pm


-----------------------------------
WOW!! but how do you actually chat .. does someone have to be on at the same time? well it is crazy awsome!

-----------------------------------
Cervantes
Thu Feb 26, 2004 7:04 pm


-----------------------------------
looks good!  But can you actually chat with other ppl?

-----------------------------------
shorthair
Thu Feb 26, 2004 8:35 pm


-----------------------------------
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
