1. RE: euLibnet and IRC
Would you kindly post the source for that?
GrapeVine
Kat wrote:
> On 27 May 2001, at 9:59, Thomas Parslow (PatRat) wrote:
>
>
> >
> > > Hi Peter,
> > >
> > > I "attempted" to help Ryan Breen get an IRC client going using euLibnet
> > > (and also I tried euTcp4u) and had no success.
> > >
> > > I "suspected" the problem lies in the fact you need an "Ident" server
> > > running on your own PC. This allows IRC servers to verify who you
> > > say you are.
> > >
> > > I tried using external Ident servers but had no success.
> > > Possibly the ident server needs to be built into the client in which
> > > case both
> > > euLibnet and euTcp4u won't work because they both use blocked sockets
> > > and
> > > Euphoria doesn't allow threads. Possibly I just had poor code and it is
> > > possibly both wrappers could work as well!!!
> > >
> > > I "think" the only way possibly would be to use the winsock wrappers
> > > which can
> > > be found through the archive. It will be more difficult to implement as
> > > you
> > > need to use pure winsock instead of using higher level libraries.
> > >
> > > About my home page ... all the files have been removed for some reason
> > > and I
> > > can't get an answer from Yahoo as to why. A FAQ page says it "possibly"
> > > because of a breach of the terms of conditons but I can't get it
> > > confirmed.
> > > (and don't know what I would have breached!)
> > >
> > > If you (or anyone) want any of my software please email me privately and
> > > I'll
> > > send it to you (smithr at ix.net.au).
> > >
> > > Ray Smith
> >
> > Hi!
> > I had a little look around and found a couple of usefull IRC related
> > documents, there's the specs at:
> > http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1459.html
> > And a page about using Telnet to access IRC at:
> > http://www.daemonnews.org/199907/irchack.html
> > I tried using telnet and it works fine, you need to also send the:
> > NICK username
> > command after the USER command though (at least on irc.sorcery.net
> > where I tried it)
<snip>
Grape Vine
13728824
2. RE: euLibnet and IRC
- Posted by gertie at ad-tek.net
May 31, 2001
On 31 May 2001, at 16:10, Grape Vine wrote:
> Would you kindly post the source for that?
>
> GrapeVine
> Kat wrote:
> > On 27 May 2001, at 9:59, Thomas Parslow (PatRat) wrote:
<snip>
Without any gui? All it's suitable for now is a bot running code. I put in a few
commands to verify it's working, but the only thing it can do now is replace
the irc-connection-part of mirc,, not the gui (display and text entry). So you
can write a program and launch it, but not interact thru it as a human.
What i was hoping is if sleep(0) can be used to revert control to win32lib, and
a higher priority task was found in the task que there, win32lib could shuffle
the scheduled tasks so the line following the sleep(0) would not always be
the next line executed, and this would eliminate some time spent polling the
socket or continuously reading the ServerNeedsAttention(sock_connect[2]).
It would be a cheap way to make pseudo-threads, by setting these priority
flags, and the highest priority gets the cpu after the sleep(0).
Like:
-- start program
procedure checksocket()
while ServerNeedsAttention(sock_connect[2]) do
keep looping, but at a low priority
set priority real low
sleep(0)
deal with the data on the socket
end while
end procedure
procedure gui_code()
the humans wants something!
high priority!
end procedure
x = routine_id("gui_code")
set x high priority
end program
-------------------------------
So win32lib, when windoze gives it back the cpu, will check the callbacks,
and rearrange the list in order of the priorities we dynamically set, and if we
gui'd somehow, deal with that, and when done with that, then go back to the
line after the sleep(0). But i doubt i can pull this off, so many more people
have tons more windows gui experinece than i have.
Oh, and it is for tcp4u, not euLibnet. Still want it?
Kat
3. RE: euLibnet and IRC
Yea, i dont need a gui right now, A) ill make my own when i need it B)
im going to run this as a command line bot tell i get used to makign IRC
apps
gertie at ad-tek.net wrote:
> On 31 May 2001, at 16:10, Grape Vine wrote:
>
> > Would you kindly post the source for that?
> >
> > GrapeVine
> > Kat wrote:
> > > On 27 May 2001, at 9:59, Thomas Parslow (PatRat) wrote:
>
> <snip>
>
> Without any gui? All it's suitable for now is a bot running code. I put
> in a few
> commands to verify it's working, but the only thing it can do now is
> replace
> the irc-connection-part of mirc,, not the gui (display and text entry).
> So you
> can write a program and launch it, but not interact thru it as a human.
>
> What i was hoping is if sleep(0) can be used to revert control to
> win32lib, and
> a higher priority task was found in the task que there, win32lib could
> shuffle
> the scheduled tasks so the line following the sleep(0) would not always
> be
> the next line executed, and this would eliminate some time spent polling
> the
> socket or continuously reading the
> ServerNeedsAttention(sock_connect[2]).
> It would be a cheap way to make pseudo-threads, by setting these
> priority
> flags, and the highest priority gets the cpu after the sleep(0).
>
> Like:
> -- start program
> procedure checksocket()
> while ServerNeedsAttention(sock_connect[2]) do
> keep looping, but at a low priority
> set priority real low
> sleep(0)
> deal with the data on the socket
> end while
> end procedure
>
> procedure gui_code()
> the humans wants something!
> high priority!
> end procedure
>
> x = routine_id("gui_code")
> set x high priority
<snip>
Grape Vine
13728824
4. RE: euLibnet and IRC
- Posted by gertie at ad-tek.net
May 31, 2001
On 31 May 2001, at 22:03, Grape Vine wrote:
>
> Yea, i dont need a gui right now, A) ill make my own when i need it B)
> im going to run this as a command line bot tell i get used to makign IRC
> apps
You'll share your code too?
Ok, here it is, use at your own risk, etc..... It's not clean, it's just as i i
used it in
testing last time. It doesn't check for err_msgs, and the do_events() and
sleep(0) need
to be tied together, so an abort can be sent to tcp4u if the server is
disconnected
during a loop somehow, etc. etc.. Oh, and the numeric parse isn't working, etc..
I was
going to set up something along the lines of mirc's on_events{} following the
NumericParse(). It does demo how to get on irc, and how to get and send some
msgs.
That poke4() fix to tcp4u *must* be done, since it's a bug anyhow, or you will
not be
able to connect to any ports higher than 255, and irc generally lives on ports
6665-
7000 and 9000! Also, you must set the ip# of the server you wish to connect to,
since i
didn't bother to do a dns on the server name. Valinor on sorcerynet is set
below. It's a
good idea to ask the server owner about testing new code on their servers, i
asked,
and i tested during a relatively idle time. The owner is mentioned in the motd.
And it needs a cleanup, i threw this together since i couldn't sleep one nite
due to
storms, i wrote and tested the whole thing tween 1am and 8am.
For reference material, check out:
RFC 1459 from
http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1459.html
or
http://ds.internic.net/rfc/rfc1459.txt
(there are later rfcs for irc, but they don't offer anything useful)
and
http://www.teleport.com/~jeepster/numeric.html
Jeepster’s Numeric’s may also be found at: http://www.ircworks.com/
Have fun!
Kat
-- BE SURE TO SET my_nick TO SOMETHING!!
-- no errors are checked for....
with trace
include tcp4u.ew
with trace
integer ret, char, port, logfile
sequence sock_connect, sock_receive, server_ip, server_name, data, logfilename
sequence recievedline, my_nick
-- where to store the log?
logfilename = "D:\\irc_Tiggr\\Eu client\\log.txt"
-- sorcerynet prefers port 9000, check your net
port = 9000
-- i haven't done any dns on the servername,
-- so i declared the ip address
server_ip = "216.122.249.75"
server_name = "valinor.sorcery.net"
my_nick = "" -- you must have a nick!!
function find_all(object value, sequence s)
-- Gabriel Boehme
-- return a list of all indexes where value is found in s
sequence list
list = {}
for i = 1 to length(s) do
if equal(value, s[i]) then
list = append(list, i)
end if
end for
return list
end function
function deparse(sequence list, integer c)
-- Gabriel Boehme
-- convert parsed list back into a string with c delimiters
sequence s
integer len
len = length(list)
if len then
s = list[1]
for i = 2 to len do
s = s & c & list[i]
end for
return s
end if
return ""
end function -- deparse
global function parse(sequence s, object c)
sequence list
integer prev, curr
if integer(c) then
-- Gabriel Boehme
-- parse string s based on delimiter c into a sequence of values
-- s = "http://coverage.cnet.com/Resources/Info/Glossary/Terms/ac3.html"
-- c = '/'
while length(s) and ( s[1] = c ) do
s = s[2..length(s)]
end while
while length(s) and ( s[length(s)] = c ) do
s = s[1..length(s)-1]
end while
if length(s) then
list = find_all(c, s & c) -- list of delimiter positions
prev = 0
for i = 1 to length(list) do
curr = list[i]
list[i] = s[prev+1..curr-1]
prev = curr
end for
return list -- now, a list of the delimited values
end if
end if -- integer(c)
return""
end function -- parse
function ParseNumeric(sequence data)
if not sequence(data) then return "" end if
if not length(data) then return "" end if
data = parse(data,32)
if equal(data[1],":"&server_name)
--and integer(data[2])
then
trace(1)
if equal(data[1][1],':') then data[1][1] = 32 end if
if equal(data[4][1],':') then data[4][1] = 32 end if
if equal(data[4][1],'-') then data[4][1] = 32 end if
data = data[2] & data[3] & deparse(data[4..length(data)],32)
return data
else
return ""
end if
return ""
end function -- ParseNumeric(sequence data)
function numeric(sequence data)
sequence val
if not sequence(data) then return 0 end if
if not length(data) then return 0 end if
data = parse(data,32)
val = value(data[2])
if equal(data[1],':'&server_name) and not equal(val[1],"GET_FAIL")
then return 1
else return 0
end if
end function -- numeric()
function GetMyText()
return""
end function -- GetMyText()
function ServerNeedsAttention(object sock)
if tcp4u_is_data_avail(sock)
then return(1)
else return(0)
end if
end function -- ServerNeedsAttention()
function ReadServer(object sock)
recievedline = ""
while tcp4u_is_data_avail(sock) do
sock_receive = tcp4u_receive(sock,1,1)
if sock_connect[1] != TCP4U_SUCCESS then
printf(1, "tcp4u_connect error '%s'\n",
{tcp4u_error_string(sock_connect[tcp4u_ret])} )
exit
end if
if equal(sock_receive[2],{10}) then
sock_receive[2] = ""
end if
if equal(sock_receive[2],{13})
then
puts(1,recievedline&"\n")
puts(logfile,recievedline&"\n")
return recievedline
else
recievedline &= sock_receive[2]
end if
end while -- tcp4u_is_data_avail(sock_connect[2]) do
return""
end function -- checkserver
procedure SendToServer(object sock, sequence data)
if not equal(data[length(data)],"\n") then
data &= "\n"
end if
ret = tcp4u_send(sock, data, length(data))
end procedure -- SendToServer(sequence data)
logfile = open(logfilename,"w")
puts (1,"Connecting to an IRC server.\n")
puts (logfile,"Connecting to an IRC server.\n")
if tcp4u_init() != TCP4U_SUCCESS then
wait_abort("tcp4u_init error")
end if
-- the following will fail if you didn't make the poke4 correction to tcp4u!!
sock_connect = tcp4u_connect(server_ip, NULL, port)
if sock_connect[tcp4u_ret] != TCP4U_SUCCESS then
printf(1, "tcp4u_connect error
'%s'\n",{tcp4u_error_string(sock_connect[tcp4u_ret])} )
puts(1,"\naborting on any keypress")
char = wait_key()
abort(1)
end if
puts(1, "...connection
established\n------------------------------------------\n")
puts(logfile, "...connection
established\n------------------------------------------\n")
-- :valinor.sorcery.net NOTICE AUTH :*** Hello, you are connecting to
valinor.sorcery.net, the progress of your connection follows
-- etc
-- then numerics 001 , 002, 003, 004, and 005
if ServerNeedsAttention(sock_connect[2]) then
data = ReadServer(sock_connect[2])
end if
if 1=1 then
--trace(1)
-- send the ip# of the server as the pass! <blink>
data = "PASS "&server_ip&"\n"
ret = tcp4u_send(sock_connect[2], data, length(data))
if ret != TCP4U_SUCCESS then
printf(1, "tcp4u_send error '%s'\n", tcp4u_error_string(ret))
puts(1,"\naborting on any keypress")
char = wait_key()
abort(1)
end if
data = "NICK "&my_nick&"\n"
ret = tcp4u_send(sock_connect[2], data, length(data))
-- check for:
-- Numeric Replies:
-- ERR_NONICKNAMEGIVEN
-- ERR_ERRONEUSNICKNAME
-- ERR_NICKNAMEINUSE
-- ERR_NICKCOLLISION
-- Parameters: <username> <hostname> <servername> <realname>
data = "USER username \"\" "&server_name&" :something cute\n"
ret = tcp4u_send(sock_connect[2], data, length(data))
-- check for numerics:
-- ERR_NEEDMOREPARAMS
-- ERR_ALREADYREGISTRED
--data = "MOTD\n"
--ret = tcp4u_send(sock_connect[2], data, length(data) )
end if
SendToServer(sock_connect[2],"MODE "&my_nick&" +i \n")
SendToServer(sock_connect[2],"ISON chanserv nickserv\n")
SendToServer(sock_connect[2],"JOIN #TiggrBot\n")
SendToServer(sock_connect[2],"PRIVMSG #TiggrBot testing!\n")
while 1 do
char = get_key()
if (char = 'Q') then
SendToServer(sock_connect[2],"QUIT :my quit message goes here!")
exit
end if
--trace(1)
if ServerNeedsAttention(sock_connect[2]) then
data = ReadServer(sock_connect[2])
end if
-- process the data here, like mirc events
if numeric(data) then
data = ParseNumeric(data)
if equal(data[1],"303") then puts(1,"Notify: "&data[3]) end if
end if
data = GetMyText()
-- process the on_input here, like, send it to the server
if not equal(data,"") then
SendToServer(sock_connect[2],data)
end if
end while -- 1 do
ret = tcp4u_close(sock_connect[2])
if ret != TCP4U_SUCCESS then
printf(1, "tcp4u_close error '%s'\n", {tcp4u_error_string(ret)} )
puts(1,"\naborting on any keypress")
char = wait_key()
abort(1)
end if
puts(1, "\n------------------------------------------\n...connection closed\n")
puts(logfile, "\n------------------------------------------\n...connection
closed\n")
ret = tcp4u_cleanup()
if ret != TCP4U_SUCCESS then
printf(1, "tcp4u_cleanup error '%s'\n", {tcp4u_error_string(ret)} )
puts(1,"\naborting on any keypress")
char = wait_key()
abort(1)
end if
close(logfile)
puts(1, "press any key to close up and abort\n")
ret = wait_key()
abort(0)
5. RE: euLibnet and IRC
Thanx for code.
Sure ill share mine, tho i think it will scare you.
Well, none of my older code will, I lost 2K today =(
Lot 100% of my Eu code <insert mild heart attack here>
Ya mind sending more info on the poke4 fix?
gertie at ad-tek.net wrote:
> On 31 May 2001, at 22:03, Grape Vine wrote:
>
> >
> > Yea, i dont need a gui right now, A) ill make my own when i need it B)
> > im going to run this as a command line bot tell i get used to makign IRC
> >
> > apps
>
> You'll share your code too?
>
> Ok, here it is, use at your own risk, etc..... It's not clean, it's just
> as i i used it in
> testing last time. It doesn't check for err_msgs, and the do_events()
> and sleep(0) need
> to be tied together, so an abort can be sent to tcp4u if the server is
> disconnected
> during a loop somehow, etc. etc.. Oh, and the numeric parse isn't
> working, etc.. I was
> going to set up something along the lines of mirc's on_events{}
> following the
> NumericParse(). It does demo how to get on irc, and how to get and send
> some msgs.
> That poke4() fix to tcp4u *must* be done, since it's a bug anyhow, or
> you will not be
> able to connect to any ports higher than 255, and irc generally lives on
> ports 6665-
> 7000 and 9000! Also, you must set the ip# of the server you wish to
> connect to, since i
> didn't bother to do a dns on the server name. Valinor on sorcerynet is
> set below. It's a
> good idea to ask the server owner about testing new code on their
> servers, i asked,
> and i tested during a relatively idle time. The owner is mentioned in
> the motd.
>
> And it needs a cleanup, i threw this together since i couldn't sleep one
> nite due to
> storms, i wrote and tested the whole thing tween 1am and 8am.
>
> For reference material, check out:
>
> RFC 1459 from
> http://www.cis.ohio-state.edu/cgi-bin/rfc/rfc1459.html
> or
> http://ds.internic.net/rfc/rfc1459.txt
>
> (there are later rfcs for irc, but they don't offer anything useful)
>
>
> and
<snip>
Grape Vine
13728824
6. RE: euLibnet and IRC
- Posted by gertie at ad-tek.net
May 31, 2001
On 1 Jun 2001, at 4:04, Grape Vine wrote:
>
> Thanx for code.
> Sure ill share mine, tho i think it will scare you.
> Well, none of my older code will, I lost 2K today =(
> Lot 100% of my Eu code <insert mild heart attack here>
I thought 2K was bullet proof?! Anyhow, whatever the OS, back up *everything* on
several harddrives, and back up on a hd you can remove from the puter after the
backup! (just unplug the power and ide cable, the OS will never know it's
there.)
> Ya mind sending more info on the poke4 fix?
Np, i thought i had sent it to the list a few days ago, it's not the only patch
to tcp4u, be
sure you get both of these done...
I found two bugs in tcp4u:
line 505 in function tcp4u_connect()
connect_socket should be an atom, it goes outside the range of integers
lines:
495: port_addr = allocate(2)
496: poke(port_addr, port)
make them into:
port_addr = allocate(4)
poke4(port_addr,port)
Kat
7. RE: euLibnet and IRC
2K is, I have tried to crash it and its hard,
tho it can be done. I dunno what happened, I
use a drive bay. One day i poped it in and it
booted with crap loads of drive errors, then
on forced reboot it give a 2K version of windows
protection error and fails to boot, ahh well.
I think i ~might~ have a back up, never got around
to having the cd's burned. Once i get my new toy
up and going ill find out.
gertie at ad-tek.net wrote:
> On 1 Jun 2001, at 4:04, Grape Vine wrote:
>
>
> >
> > Thanx for code.
> > Sure ill share mine, tho i think it will scare you.
> > Well, none of my older code will, I lost 2K today =(
> > Lot 100% of my Eu code <insert mild heart attack here>
>
> I thought 2K was bullet proof?! Anyhow, whatever the OS, back up
> *everything* on
> several harddrives, and back up on a hd you can remove from the puter
> after the
> backup! (just unplug the power and ide cable, the OS will never know
> it's there.)
>
> > Ya mind sending more info on the poke4 fix?
>
> Np, i thought i had sent it to the list a few days ago, it's not the
> only patch to tcp4u, be
> sure you get both of these done...
>
> I found two bugs in tcp4u:
>
> line 505 in function tcp4u_connect()
> connect_socket should be an atom, it goes outside the range of integers
>
> lines:
> 495: port_addr = allocate(2)
> 496: poke(port_addr, port)
>
> make them into:
>
> port_addr = allocate(4)
> poke4(port_addr,port)
>
>
> Kat
>
Grape Vine
13728824