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.

Trying to create a sop/vop/aop/akick list

Help for those learning Tcl or writing their own scripts.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

slight error

Post by user »

regarding the ctrl:filter thing... http://forum.egghelp.org/viewtopic.php?t=7115#34956
Have you ever read "The Manual"?
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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. :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

As a sidenote:
The upcoming eggdrop1.6.17 will have a new tcl command called 'stripcodes'
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.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Well, that's certainly going to simplify things a lot. :mrgreen:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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. :mrgreen:

Hope they add this new function so this can be implemented for channels, and private messages/notices as you mentioned gb. :wink:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

That's strip, this is a new one called stripcodes.
* Added a "stripcodes" Tcl command for efficiantly removing control
codes from strings
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

For WEBCHAT:
[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: Select all

Usage: !chanserv <aop|sop|akick> list

Code: Select all

#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: Select all

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.
==================================
I
IRCNick
Halfop
Posts: 64
Joined: Wed Oct 12, 2005 9:43 pm
Location: Germany
Contact:

Post by IRCNick »

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 ...
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

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
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: Select all

 tag when posting logs, code
I
IRCNick
Halfop
Posts: 64
Joined: Wed Oct 12, 2005 9:43 pm
Location: Germany
Contact:

Post by IRCNick »

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.
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Post by Thanhas »

Why this happpens?

Code: Select all

#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 ...
<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
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Thanhas wrote:Why this happpens?
The parser expects plain text, not rtf.
Have you ever read "The Manual"?
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Post by Thanhas »

really not getting u can u Explian a bit?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

You can't use word[pad] to save the file.

Use notepad or any other decent text editor.
User avatar
Thanhas
Op
Posts: 124
Joined: Sat Sep 02, 2006 11:14 am
Location: Ottawa, Canada

Post by Thanhas »

-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
Locked