| View previous topic :: View next topic |
| Author |
Message |
Andika Voice

Joined: 06 Jul 2020 Posts: 4 Location: Malaysia
|
Posted: Mon Jul 06, 2020 5:12 am Post subject: need help with watch.tcl from willyw |
|
|
Hi there
This tcl running smoothly. Thanks To willyw.
visit here: http://forum.egghelp.org/viewtopic.php?t=19934
| Code: | # April 20, 2015
# http://forum.egghelp.org/viewtopic.php?t=19934
# the poster is asking to make something similar to mIRC's built in "notify" list
# mIRC uses the IRC server's /watch command or the /monitor command
# Usage:
# To temporarily add a nick to the watch list:
# !addwatch <nick>
# To temporarily remove a nick from the watch list:
# !remwatch <nick>
# To display the current watch list:
# !watchlist
# You must create a plain text file, with one nick per line
# This file will be read by the bot upon .restart and the nicks in it
# will be added to the watch list held by the IRC server for this session.
#set the path/filename of file that holds the nicks to watch (Required)
set nicks_watch_file "scripts/added/use_irc_watch/nicks_watch_file.txt"
#set channel where you can experiment and demonstrate this script (Required - and bot must be on this channel)
set your_demo_chan #eggdrop
##########################################################################
##########################################################################
bind pub - "!addwatch" add_to_watchlist
bind pub - "!remwatch" remove_from_watchlist
bind pub - "!watchlist" get_watch_stats
bind raw - 600 rpl_logon
bind raw - 601 rpl_logoff
bind raw - 606 rpl_watchlist
#Reference : https://www.alien.net.au/irc/irc2numerics.html
######### to read the nicks to watch, and send them to the IRC server
proc send_watch_command {nicks_watch_file} {
if {![file exists $nicks_watch_file]} {
putlog " "
putlog "$nicks_watch_file not found !"
putlog " "
return 0
}
set fp [open $nicks_watch_file "r"]
set data [read -nonewline $fp]
close $fp
set lines [split $data "\n"]
foreach n $lines {
puthelp "watch +$n"
}
putlog "Added these nicks to watch list on IRC server : $lines"
}
proc rpl_logon {from key text } {
global your_demo_chan
#putserv "privmsg $your_demo_chan :$from $key $text"
putserv "privmsg $your_demo_chan :[lindex [split $text] 1 ] has logged on "
putserv "invite [lindex [split $text] 1] $your_demo_chan "
}
proc rpl_logoff {from key text} {
global your_demo_chan
#putserv "privmsg $your_demo_chan :$from $key $text"
putserv "privmsg $your_demo_chan :[lindex [split $text] 1 ] has logged off"
}
proc rpl_watchlist {from key text} {
global your_demo_chan
putserv "privmsg $your_demo_chan :Watch list of nicks is currently: [lindex [split $text :] 1]"
}
proc add_to_watchlist {nick uhost handle chan text} {
putserv "watch +[lindex [split $text] 0 ]"
putserv "privmsg $chan :[lindex [split $text] 0 ] temporarily added to watch list"
putserv "privmsg $chan :Edit the watch list file, to make it permanent for next restart of bot"
}
proc remove_from_watchlist {nick uhost handle chan text} {
putserv "watch -[lindex [split $text] 0 ]"
putserv "privmsg $chan :[lindex [split $text] 0 ] temporarily removed from watch list"
putserv "privmsg $chan :Edit the watch list file, to permanently remove for next restart of bot"
}
proc get_watch_stats {nick uhost handle chan text} {
putserv "watch stat"
}
######### read the nicks to watch, and send them to the IRC server
bind evnt - init-server do_watch_command_wrap
proc do_watch_command_wrap {type} {
global nicks_watch_file
send_watch_command $nicks_watch_file
}
######### |
can anyone help me to add host on nick that logon/logout
exp
<bot> nick ident@bla.bla.bla has logon to server
<bot> nick ident@bla.bla.bla has logout from server
Thank You. so much
-------------------------------------
GuardianAngel |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Jul 06, 2020 11:28 am Post subject: Re: need help with watch.tcl from willyw |
|
|
| Andika wrote: |
...
can anyone help me to add host on nick that logon/logout
exp
<bot> nick ident@bla.bla.bla has logon to server
<bot> nick ident@bla.bla.bla has logout from server
|
First:
It has been quite some time since I did this. I'd have to re-read it just to see what all I did.
Next:
To get the info you want, I would want to load it and experiment with it.
It should be possible.
However, I don't know when I will have time to sit and work on it. I'm sorry.
Since I posted it in public like this, I don't mind if somebody else takes it up though. I would ask that whatever they do to it, they simply post it in public too, right along with the original. Here in this thread would be fine.
Hopefully somebody else will jump in here. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
Andika Voice

Joined: 06 Jul 2020 Posts: 4 Location: Malaysia
|
Posted: Tue Jul 07, 2020 5:08 am Post subject: need help with watch.tcl from willyw |
|
|
Thanks willyw Really Appreciate That
Hope Someone Will Help Me
-------------------------------
GuardianAngel |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Jul 07, 2020 12:12 pm Post subject: Re: need help with watch.tcl from willyw |
|
|
Find proc rpl_logon.
Replace it with this:
| Code: |
###
proc rpl_logon {from key text } {
global your_demo_chan
#putserv "privmsg $your_demo_chan :[lindex [split $text] 1 ] has logged on "
set ident [lindex [split $text] 2]
set hostmask [lindex [split $text] 3]
putserv "privmsg $your_demo_chan :[lindex [split $text] 1 ] [join "$ident $hostmask" "@"] has logged on "
putserv "invite [lindex [split $text] 1] $your_demo_chan "
}
###
|
Find proc rpl_logoff.
Replace it with this:
| Code: |
###
proc rpl_logoff {from key text} {
global your_demo_chan
#putserv "privmsg $your_demo_chan :[lindex [split $text] 1 ] has logged off"
set ident [lindex [split $text] 2]
set hostmask [lindex [split $text] 3]
putserv "privmsg $your_demo_chan :[lindex [split $text] 1 ] [join "$ident $hostmask" "@"] has logged off"
}
###
|
Rehash.
Test.
Test some more.
 _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
Andika Voice

Joined: 06 Jul 2020 Posts: 4 Location: Malaysia
|
Posted: Wed Jul 08, 2020 11:35 am Post subject: |
|
|
hi willyw thank you for being able to help even if you don't have time you are still willing to help. thank you very much.
I've tested it and it works well And Perfectly. you really brighten my day, thanks willyw.
| Code: | [23:22:28]+Chika : plankton ~admin@bla.bla.bla.bla.IP has logged on
[23:22:50]+Chika : plankton ~admin@bla.bla.bla.bla.IP has logged off |
Thank You So MUch Sir
---------------------------------------------
GuardianAngel |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Wed Jul 08, 2020 12:08 pm Post subject: |
|
|
| Andika wrote: |
...
I've tested it and it works well
...
|
and THAT is good to hear. ( That makes MY day. )
Thanks for reporting back.
You're welcome. _________________ For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia ! |
|
| Back to top |
|
 |
|