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!
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun May 13, 2012 2:12 pm
Err.. try this:
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 {![string equal $nick "ChanServ"]} return
set pos [lsearch $csWhyList $user]
set csWhyList [lreplace $csWhyList $pos $pos]
channel set $chan csWhyList $csWhyList
puthelp "NOTICE @$chan :$text"
}
}
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 2:30 pm
[20:29:38] Tcl error [::csWhy::checkReply]: invalid bareword "neq"
in expression "$nick neq "ChanServ"";
should be "$neq" or "{neq}" or "neq(...)" or ...
[20:29:38] -ChanServ (
service@dal.net )- nick has SOP access to #chan. Reason: Identification to the nickname nick. Channel Frozen: NO
[20:29:38] Tcl error [::csWhy::checkReply]: invalid bareword "neq"
in expression "$nick neq "ChanServ"";
should be "$neq" or "{neq}" or "neq(...)" or ...
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun May 13, 2012 3:10 pm
There's no "neq" in the last piece of code I've posted above. Make sure you copy/paste it right and load that file on the bot then rehash it.
Once the game is over, the king and the pawn go back in the same box.
nml375
Revered One
Posts: 2860 Joined: Fri Aug 04, 2006 2:09 pm
Post
by nml375 » Sun May 13, 2012 4:25 pm
NML_375
Amr
Halfop
Posts: 94 Joined: Fri Sep 14, 2007 7:13 am
Location: Egypt
Post
by Amr » Sun May 13, 2012 9:40 pm
Yes , like nml said (line 20)
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon May 14, 2012 12:17 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 {![string equal $nick "ChanServ"]} return
set text [split $text]
set user [lindex $text 0]
set chan [string trim [lindex $text 5] {.}]
set csWhyList [channel get $chan csWhyList]
set pos [lsearch $csWhyList $user]
if {$pos == -1} return
set csWhyList [lreplace $csWhyList $pos $pos]
channel set $chan csWhyList $csWhyList
puthelp "NOTICE @$chan :$text"
}
}
There. Was tiered so mixed a few lines and forgot a few things. It should work now. Hopefully.
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 » Mon May 14, 2012 5:17 am
[11:16:38] Tcl error [::csWhy::checkReply]: no such channel record
[11:16:38] -ChanServ (
service@dal.net )- nick has FOUNDER access to #chan. Reason: Identification to the founder's nickname, nick. Channel Frozen: NO
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Tue May 15, 2012 1:13 am
That's weird. I just tested this and works as should.
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 » Tue May 15, 2012 9:21 am
I tried it again but it gives the same error.
[11:16:38] Tcl error [::csWhy::checkReply]: no such channel record
[11:16:38] -ChanServ (
service@dal.net )- nick has FOUNDER access to #chan. Reason: Identification to the founder's nickname, nick. Channel Frozen: NO
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed May 16, 2012 12:18 am
Is #chan a valid channel? Add the following
before:
Code: Select all
set csWhyList [channel get $chan csWhyList]
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 » Wed May 16, 2012 5:38 am
I got no errors now , but it replies the result to the telnet not to the @#chan O.o
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed May 16, 2012 9:44 am
Wait, what?!
So, you see the reply (notice) from ChanServ and the bot itself repeats the same line in the telnet, or you see only ChanServ's reply?
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 » Wed May 16, 2012 10:48 am
exactly , I see the chanserv's reply on the telnet only.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed May 16, 2012 1:32 pm
Since the channel variable is set correctly:
tclsh wrote:
% set text "nick has FOUNDER access to #chan. Reason: Identification to the founder's nickname, nick. Channel Frozen: NO"
nick has FOUNDER access to #chan. Reason: Identification to the founder's nickname, nick. Channel Frozen: NO
% string trim [lindex [split $text] 5] {.}
#chan
I don't get it why it says #chan is not valid.
Let's do a little debug of the chan variable by adding:
Code: Select all
putlog "cswhy.tcl debug - chan is: $chan"
after:
Code: Select all
set chan [string trim [lindex $text 5] {.}]
and report back what you get in telnet.
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 » Wed May 16, 2012 1:59 pm
here we go
[19:55:49] cswhy.tcl debug - chan is: #chan
[19:55:49] -ChanServ (
service@dal.net )- nick has FOUNDER access to #chan. Reason: Identification to the founder's nickname, nick. Channel Frozen: NO
And I got this on telnet on channel which the script is disabled in.
[19:56:18] cswhy.tcl debug - chan is: xeo