This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How to..?

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

How to..?

Post by caesar »

1) I would like to send a msg to x to tell the status to the eggdrop and he to say it to the channel. He must return from a notice like: nick/user [access] nick/user [access] user [access] to a privmsg or notice to a user/channel. The part of saing to channel or user I can do myself, the only thing I'm not shure I can do is the return of the notice. Well.. humm, just give me an sugestion :)

2) The next thing I would like is to make an whois, an irc one who is or not in the channel and say the reply to the channel, like: it's hostmask, irc name, away if so, idle and uptime.

3) It's possible to do a telnet/ssh somewhere and reply what msg he get's from there? Like the prompt for user and password.

4) How to make it calculate the diference betwen Aug. 07 2002, at the 00:00 hour and the time when the proc is called (as a pub command)? Ex: Sep. 18 2002 12:36 hour.
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

1) Read doc/tcl-commands.doc for "bind notc"
2) putserv "WHOIS $nick" plus some "bind raw" to catch different raw replies (who is nick, what channels he is on, how lond idle time ect...). Every reply has a different numeric, i.e. every line that you see in your IRC client has a different code. You can find info about those codes and other IRC stuff at http://www.irchelp.org. Look for RFC archives (RFC1459)
3) What do you mean?
4) It is possible, but unless you want to do some heavy scripting, users will have to follow syntax that you determine (the format of querry). Still, it needs certain amount of sripting to parse query and get for example unixtime format. On the other hand, to return from unixtime to a human readible time TCL provides method called 'strftime'. Read about it in doc/tcl-commands.doc.
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

4) You don't need a whole lot of heavy scripting if you use the "clock scan" command. It lets you convert strings like "aug 7" or "aug 7 3:45am" and even relative like "2 weeks ago" to unixtime. Then all you have to do is subtract it from the current unixtime, and use the 'duration' command to get the human readable time difference.
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

2) A sample script of such functionality is http://members.fortunecity.com/eggheadt ... me.tcl.txt

Some part of that script is a rather "awkward". That part could be replaced by stdragon's suggestion to use [duration]. Even though the output of [duration] is also a bit awkward :)

3) Such functionality can be written very easily using [connect] and [control].
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Hi.
1. I've said I can manage the notice part, I was asking how can I split the stuff he recives from the command.
2. I know what command I must use, I've asked what is the bind for the reply of the whois.
3. Wanted to make it connect to a server, reply to the request's of the user and the password.
4. I wanted to make it calculate the diference betwen 2 dates with two diferent hours. To calculate the diference betwen August 08 2002 hour 10:00 and the date and time when a pub command is called.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

2. the bind for the reply from whois is: bind raw - 311
Elen sila lúmenn' omentielvo
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

4.this is what I think stdragon meant, I have not tested it :)

Code: Select all

#makes the date a unixtime format
set a [clock scan aug 08 2002 10:00]
#extrackts current time(in unixformat) from $a
set b [expr [unixtime] - $a]
#makes $b into days,hours,mins....
set difference [duration $b]
maybe u should use [clock seconds] instead of [unixtime]..... guess you'll just have to try ;)
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I remember that I've seen in lol.tcl the raw for the whois reply, for the not found and for one more .. but I've forgot for what was it :)

Thx for the code. :) Ow you one. :)

Anyone knows a site from where I can get my hands on an IRC Server like IRC Plus, if anyone knows it.. not to complex, something simple for Windows 2K/XP? Thanks in advance :)
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

take a look at this http://www.mirc.co.uk/help/rfc1459.txt for the list of raw replies, it's in chapter 6

happy to be of assistance
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Where is that damn chapter? ;) I haven't found it yet, neither the raw. I'll surf the file again :)
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

what page? be more precisly please.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

from page 42 and downwards :)
starting at chapter 6.1
line number 2364
:D accurate enough?
Elen sila lúmenn' omentielvo
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

oh, sorry :) thanks mate. verry accurate :)
d
darko``
Op
Posts: 121
Joined: Sun Sep 08, 2002 5:33 pm
Location: Malta

Post by darko`` »

/me looks at Papillion

Heh, well, i am not a very pesky character, but, didn't i say in one of the first posts that all raw numerics are available in RFC archives of http://www.irchelp.org ? Also, bind 311 IS NOT a whois reply. It is only A PART of reply as i said in the same earlier post. No offence intended.
Ignorant and lazy people will save 30 minutes by chosing simple config file. Smart ones will save 3000 minutes of *everyone's* time by opting for complete config file.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

hehe none taken ;)
I just gave him the complete url, so that he would not have to go looking for it himself :)
also I know it's just a part of the whois reply, 311 - 313 and 317 - 319 are all replies of whois, he has to find something out for himself doesn't he ;)
Elen sila lúmenn' omentielvo
Locked