| View previous topic :: View next topic |
| Author |
Message |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Mon Aug 02, 2004 1:30 am Post subject: |
|
|
Ah thanks user. You are no doubt a tcl master. I am not good with regexp, regsub complex matching myself!
Though I use, the same ppslim filter, which Alchera posted for almost all of my scripts and it tends to work fine for me.  _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Mon Aug 02, 2004 8:26 pm Post subject: |
|
|
As a sidenote:
The upcoming eggdrop1.6.17 will have a new tcl command called 'stripcodes'
| Quote: | stripcodes <strip-flags> <string>
| Description: strips specified control characters from the string given.
| strip-flags can be any combination of the following:
| b - remove all boldface codes
| c - remove all color codes
| r - remove all reverse video codes
| u - remove all underline codes
| a - remove all ANSI codes
| g - remove all ctrl-g (bell) codes
| Returns: the stripped string. |
|
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Mon Aug 02, 2004 8:52 pm Post subject: |
|
|
Well, that's certainly going to simplify things a lot.  _________________ 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: Mon Aug 02, 2004 9:30 pm Post subject: |
|
|
Actually there is one currently as well using the same, strip names.
I think its stripcodes or just strip. It only works for stripping codes in DCC (Partyline) with the bot currently, nothing other than that. You can check it by typing .help strip I think or .help all and see its name then do a help search on it.
Hope they add this new function so this can be implemented for channels, and private messages/notices as you mentioned gb.  _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Mon Aug 02, 2004 9:32 pm Post subject: |
|
|
That's strip, this is a new one called stripcodes.
| Quote: | * Added a "stripcodes" Tcl command for efficiantly removing control
codes from strings |
|
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Thu Aug 19, 2004 12:08 am Post subject: |
|
|
For WEBCHAT:
| Quote: |
[03:06] -ChanServ- Listing of #usa AOp:
[03:06] -ChanServ- - atlas (last mask: Eagle@***.d.la, last on: 08/19/04 02:41:25 GMT) added by Asphyxiate:2 on 08/08/04 17:06:36 GMT
[03:06] -ChanServ- - FreshBoy (last mask: ~FrozenHear@***.adsl.ttnet.net.tr, last on: 08/18/04 20:30:06 GMT) added by Asphyxiate:7 on 08/04/04 14:25:26 GMT
[03:06] -ChanServ- End of #usa AOp listing - 2 matches found
ChanServ is service@webchat.org * Channel Services
ChanServ is a Services Agent
ChanServ using webmaster.webchat.org ConferenceRoom Services 2.1.4a-SEC-WEBCHAT
ChanServ encrypt 128
chanserv End of /WHOIS list
|
For this type of output use this:
| Code: |
Usage: !chanserv <aop|sop|akick> list
|
| Code: |
#Name of the storage file for the access list.
set accesslist "accesslist.txt"
#Full name of channel services.
set chanserv "chanserv"
#################
# BIND commands #
#################
bind pub n "!chanserv" access:list
bind notc - "*Listing of #*" write:list
bind notc - "*(last mask:*" write:list
bind notc - "*End of #*" write:list
proc write:list {nick host hand text {dest ""}} {
set msg [ctrl:filter $text]
if {([isbotnick $dest]) && ([string equal $nick "ChanServ"])} {
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 [lindex $text 0]]
if {[file exists $::accesslist]} {file delete $::accesslist}
putserv "PRIVMSG $::chanserv :$type $chan list"
return 0
}
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
}
|
Or you can also try the some binds like:
| Code: |
bind notc - "*Listing of * *" write:list
bind notc - "*-* *(last mask:* *last on:* *added by* *GMT*" write:list
bind notc - "*End of * * * * * * *" write:list
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
IRCNick Halfop
Joined: 12 Oct 2005 Posts: 64 Location: Germany
|
Posted: Thu Dec 22, 2005 10:43 pm Post subject: |
|
|
Hmm what should be change for listing a access list that looks like that:
[03:37] -CS- -- Access List for [#demons] --
[03:37] -CS- Num Level Hostmask
[03:37] -CS- --- ----- --------
[03:37] -CS- 1 1000 Nick1 - Added by founder (10000)
[03:37] -CS- 2 1001 Nick2 - Added by founder (10000)
[03:37] -CS- -- End of list --
And instaed of writing into a file... how to get the firs line and split it ... |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Thu Dec 22, 2005 11:27 pm Post subject: |
|
|
| IRCNick wrote: | | Hmm what should be change for listing a access list that looks like that: |
hmm wasn't it you that asked about this already somewhere else? and why are you bumping old topics
| Quote: |
And instaed of writing into a file... how to get the firs line and split it ... |
naturally, by using [split], what's the problem? _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
IRCNick Halfop
Joined: 12 Oct 2005 Posts: 64 Location: Germany
|
Posted: Fri Dec 23, 2005 2:11 pm Post subject: |
|
|
| You are right... I have asked about this ... and I bumped this topic cause I havent found a solution for my problem... I'm not very "close" with tcl, I learne now from your posts, I'm reading all of the topics, help if nesseccery and if I can. |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Fri Nov 17, 2006 11:44 am Post subject: |
|
|
Why this happpens?
| Code: | #Name of the storage file for the access list.
set accesslist "accesslist.txt"
#Full name of channel services.
set chanserv "chanserv"
#################
# BIND commands #
#################
bind pub n "!chanserv" access:list
bind notc - "*Listing of #*" write:list
bind notc - "*(last mask:*" write:list
bind notc - "*End of #*" write:list
proc write:list {nick host hand text {dest ""}} {
set msg [ctrl:filter $text]
if {([isbotnick $dest]) && ([string equal $nick "ChanServ"])} {
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 [lindex $text 0]]
if {[file exists $::accesslist]} {file delete $::accesslist}
putserv "PRIVMSG $::chanserv :$type $chan list"
return 0
}
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
}
|
The Errers are ...
| Quote: | <HosTer> [20:40] invalid command name "\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}}
[08:40:p:17:Nov] <HosTer> {\*\generator Msftedit 5.41.15.1503;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24 #Name of the storage file for the access list. \line set accesslist "accesslist.txt" \line\line #Full name of channel services. \line set chanserv "chanserv" \line\line ################# \line # BIND commands # \line ################# \line bind pub n "!chanserv" access:lis
[08:40:p:17:Nov] <HosTer> [20:40] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR) |
Let me know the Errer as soon as u can Thanks
Regards |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Nov 17, 2006 12:04 pm Post subject: |
|
|
| Thanhas wrote: | | Why this happpens? |
The parser expects plain text, not rtf. _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Fri Nov 17, 2006 12:10 pm Post subject: |
|
|
| really not getting u can u Explian a bit? |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Fri Nov 17, 2006 1:50 pm Post subject: |
|
|
You can't use word[pad] to save the file.
Use notepad or any other decent text editor. |
|
| Back to top |
|
 |
Thanhas Op

Joined: 02 Sep 2006 Posts: 124 Location: Ottawa, Canada
|
Posted: Fri Nov 17, 2006 2:01 pm Post subject: |
|
|
-ChanServ (service@dal.net)- Error! "/msg ChanServ" is no longer supported. Use "/msg chanserv@services.dal.net" or "/chanserv" instead.
now what? i am on Dalnet |
|
| Back to top |
|
 |
|