egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trying to create a sop/vop/aop/akick list
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Jul 29, 2004 7:59 pm    Post subject: Reply with quote

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". Smile

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 Smile
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Thu Jul 29, 2004 8:44 pm    Post subject: Reply with quote

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:

Code:

putquick "PRIVMSG chanserv@services.dal.net :AOP $chan list" -next
putquick "PRIVMSG chanserv@services.dal.net :AOP $chan list"
putserv "PRIVMSG chanserv@services.dal.net :AOP $chan list"


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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Jul 29, 2004 9:08 pm    Post subject: Reply with quote

awyeah:
Quote:
How about:


Code:
bind notc - "*(*@*)*" << ???

Just brilliant Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Thu Jul 29, 2004 10:12 pm    Post subject: Reply with quote

Ok ... Here's what I have. It works! Smile
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
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Fri Jul 30, 2004 6:58 am    Post subject: Reply with quote

Btw, you also might want to bind to the starting and the ending notices. Laughing

Code:

bind notc - "*list for #*" write:list
bind notc - "*End of list*" write:list


This should complete it! yay Mr. Green
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Jul 30, 2004 11:43 am    Post subject: Reply with quote

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). Very Happy

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
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Jul 30, 2004 11:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Papillon
Owner


Joined: 15 Feb 2002
Posts: 724
Location: *.no

PostPosted: Fri Jul 30, 2004 12:02 pm    Post subject: Reply with quote

or just use regexp to make it abit smaller Smile
Code:
if {[regexp {(sop|aop|vop|hop)} $type]} {

_________________
Elen sila lúmenn' omentielvo
Back to top
View user's profile Send private message MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Jul 30, 2004 12:04 pm    Post subject: Reply with quote

I'm all in favour of small and the famous KISS (Keep It Simple Stupid) principle.

Thank you gentlemen Very Happy
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Jul 30, 2004 2:59 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Jul 30, 2004 3:33 pm    Post subject: Reply with quote

Actualy the ctrl:filter is from ppslim Mr. Green

[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
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Fri Jul 30, 2004 10:00 pm    Post subject: Reply with quote

Capital 'p' now lower case 'p' Very Happy

I keep forgetting about this one. LOL
Code:
[isbotnick $dest]

Thanks again caesar. Smile

Senatus Populusque Romanus
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Jul 31, 2004 6:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun Aug 01, 2004 10:57 pm    Post subject: Reply with quote

Okay... after 42 posts, we have finally sovled this tiny issue.
Delayed... but relevant Mr. Green Wink
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Aug 02, 2004 12:08 am    Post subject: Reply with quote

A learning curve for moi Very Happy

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2, 3, 4, 5  Next
Page 3 of 5

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber