| View previous topic :: View next topic |
| Author |
Message |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Jul 29, 2004 7:59 pm Post subject: |
|
|
Sergios: Be patient, there will be a script that will do as you wish and will work as you wish and will only respond to a specific message from ChanServ "soonish".
awyeah was indicating that it could be used for other ChanServ notices as well, by simply changing what to look for in the bind.
One item I had missed early on was the fact that the first line of a ChanServ notice contains bold text. If that isn't filtered then basically nothing works.
In the code I wrote for testing I replaced "putquick" with "putserv". Using "putquick" ends up with ChanServ (DALnet) sending this >> "-ChanServ- Error! "/msg ChanServ" is no longer supported. Use "/msg chanserv@services.dal.net" or "/chanserv" instead."
I shall now go and do battle  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Thu Jul 29, 2004 8:44 pm Post subject: |
|
|
Stripping the codes is a good idea.
I've only seen ChanServ put it in bold in the first line
'-ChanServ- SOp list for #awyeah'.
After that, I know all nicks, and ip addresses listed of
the access list are in plain text format without any control codes.
However there might be one, at the end as well '-ChanServ- End of list'.
Alchera use, any:
But specify, 'chanserv@services.dal.net' not simply 'chanserv'
DALnet has enfocred this because:
Services impersonators use similar nicks to ChanServ, like:
ChanSev, ChannelServ, ChanService, ChanServices, ChanServer etc.
to fool people into getting their passwords. So just by simply: /msg chanserv <bla bla> (wont make chanserv get your command)
On DALnet you will need to specify: /chanserv@services.dal.net.
As the part after the @ is like the uhost. So even if an impersonator uses a nick, and a user mistakenly sends a notice to:
E.g: /msg ChanService@services.dal.net (the msg will not go as a nick with that uhost would cease to exist, if the nick ChanService is online)
That is why they came up with this thing.
So for everyone I suggest you use: /msg chanserv@services.dal.net bla bla
Another alteration can be: /chanserv bla bla
For that, on mIRC like I use: /chanserv aop #chan list
In, tcl if it works it can be something like: (Only for DALnet!)
| Code: |
putserv "chanserv aop $chan list"
or
putserv "chanserv :aop $chan list"
#I am not sure but one of these will work. I think the one without the ":".
#You can use the same with putquick, puthelp etc.
|
Everyone, who reads this post... please be aware this is only for DALnet's ChanServ as I am not aware with ChanServ services of other IRC networks. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Jul 29, 2004 9:08 pm Post subject: |
|
|
awyeah:
| Quote: | How about:
| Code: | | bind notc - "*(*@*)*" << ??? | |
Just brilliant  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Thu Jul 29, 2004 10:12 pm Post subject: |
|
|
Ok ... Here's what I have. It works!
| Code: | # File name of the storage file for the access list.
set accesslist "accesslist.txt"
# Full name of channel services
set chanserv "chanserv@Services.dal.net"
bind pub n list access:list
bind notc - "*(*@*)*" write:list
proc write:list {nick host hand arg {dest ""}} {
if {([string equal $dest $::botnick]) && ([string equal $nick "ChanServ"])} {
# Create the storage file for the access list.
if {![file exists $::accesslist]} {
set acc_fd [open $::accesslist w]
puts $acc_fd "-ChanServ Access List Records-\n"
close $acc_fd
}
set acc_fd [open $::accesslist a]
puts $acc_fd $arg
close $acc_fd
}
}
proc access:list {nick uhost hand chan text} {
set type [string tolower $text]
if {[string match $type "aop"] || [string match $type "sop"]} {
# Remove old storage file
if {[file exists $::accesslist]} {file delete $::accesslist}
putserv "PRIVMSG $::chanserv :$type $chan list"
} else {
return
}
} |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Fri Jul 30, 2004 6:58 am Post subject: |
|
|
Btw, you also might want to bind to the starting and the ending notices.
| Code: |
bind notc - "*list for #*" write:list
bind notc - "*End of list*" write:list
|
This should complete it! yay  _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Jul 30, 2004 11:43 am Post subject: |
|
|
Ooooo .. I never thought of trying that idea. I am, however, aware of stackable notices and that idea of yours awyeah has given me another idea. LOL
The ability to have the access list files named for each channel ie accesslist.channel.txt (I hope).
Sergios: Theroretically, what I have done so far (in my last post) will work on your network. You just simply change "set chanserv" to what you use to access your channel services.
The script is triggered via public command in main ie "list aop" or "list sop". To have it list HOp & VOp as well, just change this | Code: | | if {[string match $type "aop"] || [string match $type "sop"]} { | to this | Code: | | if {[string match $type "aop"] || [string match $type "sop"] || [string match $type "hop"] || [string match $type "vop"]} { |
Re DALnet services access: I know of only one other network that has a similar setup ie /msg ChanService@services.dal.net _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jul 30, 2004 11:55 am Post subject: |
|
|
Why do you do an match when you should compare them if are equal?! _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Papillon Owner

Joined: 15 Feb 2002 Posts: 724 Location: *.no
|
Posted: Fri Jul 30, 2004 12:02 pm Post subject: |
|
|
or just use regexp to make it abit smaller
| Code: | | if {[regexp {(sop|aop|vop|hop)} $type]} { |
_________________ Elen sila lúmenn' omentielvo |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Jul 30, 2004 12:04 pm Post subject: |
|
|
I'm all in favour of small and the famous KISS (Keep It Simple Stupid) principle.
Thank you gentlemen  _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Jul 30, 2004 2:59 pm Post subject: |
|
|
Here's the finished (?) code.
| Code: | # Name of the storage file for the access list.
set accesslist "accesslist.txt"
# Full name of channel services
set chanserv "chanserv@Services.dal.net"
#################
# BIND commands #
#################
bind pub n list access:list
bind notc - "* list for *" write:list
bind notc - "*(*@*)*" write:list
bind notc - "*End of list.*" write:list
proc write:list {nick host hand arg {dest ""}} {
set msg [ctrl:filter $arg]
if {([string equal $dest $::botnick]) && ([string equal $nick "ChanServ"])} {
# Create the storage file for the access list.
set acc_fd [open $::accesslist a]
puts $acc_fd $msg
close $acc_fd
}
}
proc access:list {nick uhost hand chan text} {
set type [string tolower $text]
if {[regexp {(sop|aop)} $type]} {
# Remove old storage file
if {[file exists $::accesslist]} {file delete $::accesslist}
putserv "PRIVMSG $::chanserv :$type $chan list"
} else {
return
}
}
# ctrl:filter <string>
# Strip all control characters. Thanks to Ppslim.
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
} |
Here's the contents of the file.
| Quote: | SOp list for #ballarat
1 - almozo (Almozo@mctn1-8053.nb.aliant.net)
2 - Ricochet (~ricochet@82-37-208-102.cable.ubr06.dudl.blueyonder.co.uk)
End of list. |
Sergios: You may need to delete this line of code
| Code: | | bind notc - "*End of list.*" write:list |
And you need to change
| Code: | | if {[regexp {(sop|aop)} $type]} { | To | Code: | | if {[regexp {(sop|aop|hop|vop)} $type]} { |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jul 30, 2004 3:33 pm Post subject: |
|
|
Actualy the ctrl:filter is from ppslim
[string equal $dest $::botnick] <~ [isbotnick $dest]? also, use string equal -nocase if you want to make it compare it nocase (lower and upper chars and so on) _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Fri Jul 30, 2004 10:00 pm Post subject: |
|
|
Capital 'p' now lower case 'p'
I keep forgetting about this one. LOL
Thanks again caesar.
Senatus Populusque Romanus _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Jul 31, 2004 6:35 pm Post subject: |
|
|
| Code: | # Name of the storage file for the access list.
set accesslist "accesslist.txt"
# Full name of channel services.
set chanserv "chanserv@Services.dal.net"
#################
# BIND commands #
#################
bind pub n list access:list
bind notc - "* list for *" write:list
bind notc - "*(*@*)*" write:list
bind notc - "*End of list.*" write:list
proc write:list {nick host hand arg {dest ""}} {
set msg [ctrl:filter $arg]
if {([isbotnick $dest]) && ([string equal $nick "ChanServ"])} {
# Create the storage file for appending.
set acc_fd [open $::accesslist a]
puts $acc_fd $msg
close $acc_fd
}
}
proc access:list {nick uhost hand chan text} {
set type [string tolower $text]
if {[regexp {(sop|aop)} $type]} {
# Remove old storage file
if {[file exists $::accesslist]} {file delete $::accesslist}
putserv "PRIVMSG $::chanserv :$type $chan list"
} else {
return
}
}
# ctrl:filter <string>
# Strip all control characters. Thanks to ppslim.
proc ctrl:filter {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
} |
_________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun Aug 01, 2004 10:57 pm Post subject: |
|
|
Okay... after 42 posts, we have finally sovled this tiny issue.
Delayed... but relevant  _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Aug 02, 2004 12:08 am Post subject: |
|
|
A learning curve for moi
What's the bet Sergios doesn't even use it? LOL _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
|