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.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Wed May 09, 2012 9:24 am
hello guys , anyone got a tcl script which do "/cs why #chan nick" whenever anyone get oped in the channel and then do "/notice @#chan" with the result.
thanks.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Thu May 10, 2012 12:45 am
Code: Select all
namespace eval csWhy {
setudef str csWhyList
setudef flag cswhy
bind mode * "% +o" [namespace current]::checkWhy
bind notc * * [namespace current]::checkReply
# someone got OP'ed on the channel
proc checkWhy {nick uhost hand chan mode target} {
if {[isbotnick $target]} return
if {![channel get $chan cswhy]} return
set csWhyList [channel get $chan csWhyList]
lappend csWhyList $target
channel set $chan csWhyList $csWhyList
puthelp "ChanServ WHY $chan $target"
}
# reply of WHY command from ChanServ
proc checkReply {nick uhost hand text {dest ""}} {
if {[string equal -length 1 # $dest]} return
if {$nick neq "ChanServ"} return
set text [split $text]
set user [lindex $text 0]
set chan [string trim [lindex $text 5] {.}]
set csWhyList [channel get $chan csWhyList]
if {$nick ni $csWhyList} return
set pos [lsearch $csWhyList $user]
set csWhyList [lreplace $csWhyList $pos $pos]
channel set $chan csWhyList $csWhyList
puthelp "NOTICE @$chan :$text"
}
}
Do a .chanset #channel +cswhy for the channel you wish this to be activated.
Haven't tested it so let me know if you get any errors.
Edit: fixed.
Last edited by
caesar on Sun May 13, 2012 6:32 am, edited 1 time in total.
Once the game is over, the king and the pawn go back in the same box.
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sat May 12, 2012 2:47 am
I got this error
[08:45:38] Tcl error [::csWhy::checkReply]: syntax error in expression "$nick neq "ChanServ"": variable references require preceding $
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sat May 12, 2012 5:41 am
There are two ways to fix this. One is to install the latest version of TCL library and the second is to just replace:
with:
Code: Select all
if {![string equal $nick "ChanServ"]} return
Once the game is over, the king and the pawn go back in the same box.
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sat May 12, 2012 10:38 am
new error appears [16:37:55] Tcl error [::csWhy::checkReply]: can't read "chan": no such variable
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sat May 12, 2012 2:55 pm
That's weird. From a link to Dalnet's documentation that I can't find right now the channel vas stored in the 5th word. Could you do a WHY on someone and reply back with the message you get from ChanServ?
Once the game is over, the king and the pawn go back in the same box.
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sat May 12, 2012 3:07 pm
Here we go : ChanServ - Samprite2 has FOUNDER access to #alex. Reason: Identification to services with the channel password. Channel Frozen: NO
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sat May 12, 2012 3:08 pm
and we got another one dim has SOP access to #alex. Reason: Identification to the nickname AutoCross. Channel Frozen: NO
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sat May 12, 2012 3:11 pm
Easily overlooked, but you're trying to read
chan before you set it.
This line must come after you set
chan (currently on line 7 of checkReply).
Code: Select all
set csWhyList [channel get $chan csWhyList]
NML_375
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sat May 12, 2012 3:14 pm
I got this error after enable the script to work on specific channel;
[21:13:40] Tcl error [::csWhy::checkReply]: can't read "chan": no such variable
[21:13:40] -ChanServ (
service@dal.net )- Usage: WHY <channel> <nick>
[21:13:40] Tcl error [::csWhy::checkReply]: can't read "chan": no such variable
[21:13:40] -ChanServ (
service@dal.net )- For help, /msg
ChanServ@services.dal.net HELP WHY
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun May 13, 2012 6:33 am
nml375 is right, duno how I missed that. I've fixed this and adjusted the WHY command accordingly. Test it and report back.
Please do notice that you will have to replace the
line like I've previously mentioned.
Once the game is over, the king and the pawn go back in the same box.
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sun May 13, 2012 9:07 am
please , can you type the whole fixed one ?
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sun May 13, 2012 11:35 am
we got another error
[17:31:48] Tcl error [::csWhy::checkReply]: can't read "csWhyList": no such variable
[17:31:48] -ChanServ (
service@dal.net )- Usage: WHY <channel> <nick>
[17:31:48] Tcl error [::csWhy::checkReply]: can't read "csWhyList": no such variable
[17:31:48] -ChanServ (
service@dal.net )- For help, /msg
ChanServ@services.dal.net HELP WHY
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun May 13, 2012 12:46 pm
Are you sure you got the fixed code I've edited above and rehashed the bot?
Once the game is over, the king and the pawn go back in the same box.
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sun May 13, 2012 1:11 pm
Ya I got it , but another error appears
[19:10:09] Tcl error [::csWhy::checkReply]: invalid bareword "neq"
in expression "$nick neq "ChanServ"";
should be "$neq" or "{neq}" or "neq(...)" or ...
[19:10:10] Tcl error [::csWhy::checkReply]: invalid bareword "neq"
in expression "$nick neq "ChanServ"";
should be "$neq" or "{neq}" or "neq(...)" or ...