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.

chanserv.tcl

Support & discussion of released scripts, and announcements of new releases.
User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

chanserv.tcl

Post by aslpls »

example:
i am the owner of the channel in dalnet, then i've added the bot as channel manager or sop level access just
to add a new user access in the channel. here is the few basic command in dalnet chanserv services

/chanserv aop #docsteam add janedoe
/chanserv aop #docsteam del janedoe

/chanserv sop #docsteam add janedoe
/chanserv sop #docsteam del janedoe

/chanserv HOP #docsteam add bandit
/chanserv HOP #docsteam del bandit


is there a chance that we can add in the script to communicate the chanserv@services.dal.net via bot commands?

Code: Select all

#######################################################################
#This script was made by Jer.. To report problems                     #  
#with this script I can be found on irc.wweforums.org                 #
#in the #scripts channel..   							    #
#											    #
#Ok this is the second version of this script and it                  #
#works great I have added in hop,vop,akick to this version.           #
#											    #
#The first version was not released						    #
#											    #
#Ok this script is for adding and removing Vop/Hop/Aop/Sop/Akicks     #
#There is a few of these scripts out there and most of them work good #
#what sets this one apart from the rest is when you sop someone if    #
#you are not identify to chanserv or nickserv for founder access you  #
#can not add sops. So what i have done is when you sop someone it     #
#will identify to chanserv and then sop the person as with the remove #
#sop.											    #
#											    #
#This script also has a channel uflag so it will only work in         #
#channels that are marked with +chanserv . Which is nice if you have  #
#your bot in other channels that you dont want them commands to work  #
#on BECAUSE YOU DONT WANT YOU EGGDROP TO TRY TO IDENTIFY TO OTHER     #
#CHANNELS..										    #
#											    #
#This script will work on all networks that run with chanserv some    #
#verify like dalnet uses chanserv@services.dal.net if your on dalnet  #
#you may need to use this..So you would change the                    #
#set chanserv "chanserv" to set chanserv "chanserv@services.dal.net"  #
#but the defult chanserv may work for it as well ..			    #
#											    #
#I will also take suggestions on new features for this script         #
#											    #
#Chanserv Script Release Date February 20,2009                        #
#								                      #
#Please do not modify my code thanks...					    #
#											    #
#######################################################################

bind pub o|o ".aop" accessaop
bind pub o|o ".-aop" accessremoveaop
bind pub m|m ".sop" accesssop
bind pub m|m ".-sop" accessremovesop
bind pub o|o ".hop" accesshop
bind pub o|o "-hop" accessremovehop
bind pub o|o ".vop" accessvop
bind pub o|o ".-vop" accessremovevop




###This is to set chanserv some use Differnt things but this is standered For Most
set chanserv "chanserv"

###Your Channel Password Goes Here 
set passwd "Your password here"

###This is the udef flag do not change this or the script wont work right
setudef flag chanserv

###Chanserv Add Aop
proc accessaop {nick host handle channel testes} {
    global nxg chanserv
if {[channel get $channel chanserv]} { 
	set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :aop $channel add $who"
	putserv "PRIVMSG $channel :$who added to $channel Aop list."
    putlog "$nick added $who to the Aop list in $channel"
 }
}
###End Of Chanserv Add Aop

###Chanserv Remove Aop
proc accessremoveaop {nick host handle channel testes} {
    global nxg chanserv
if {[channel get $channel chanserv]} { 
	set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :aop $channel del $who"
	putserv "PRIVMSG $channel :$who deleted from $channel Aop list."
    putlog "$nick removed $who from the Aop list in $channel"
 }
}
###End Of Chanserv Remove Aop

###Chanserv Add Sop
proc accesssop {nick host handle channel testes} {
    global nxg chanserv passwd
if {[channel get $channel chanserv]} { 
    set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :identify $channel $passwd"
    putserv "PRIVMSG $chanserv :sop $channel add $who"
	putserv "PRIVMSG $channel :$who added to $channel Sop list."
    putlog "$nick added $who to the Sop list in $channel"
 }
}
###End Of Chanserv Add Sop

###Start Of Chanserv Remove Sop
proc accessremovesop {nick host handle channel testes} {
    global nxg chanserv passwd
if {[channel get $channel chanserv]} { 
	set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :identify $channel $passwd"
    putserv "PRIVMSG $chanserv :sop $channel del $who"
	putserv "PRIVMSG $channel :$who deleted from $channel Sop list."
    putlog "$nick removed $who from the Sop list in $channel"
 }
}
###End Of Chanserv Remove Sop

###Chanserv add Hop
proc accesshop {nick host handle channel testes} {
    global nxg chanserv
if {[channel get $channel chanserv]} { 
    set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :hop $channel add $who"
	putserv "PRIVMSG $channel :$who added to $channel Hop list."
    putlog "$nick added $who to the Hop list in $channel"
 }
}
###End Of Chanserv Hop

###Chanserv Remove Hop
proc accessremovehop {nick host handle channel testes} {
    global nxg chanserv
if {[channel get $channel chanserv]} { 
	set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :hop $channel del $who"
	putserv "PRIVMSG $channel :$who deleted from $channel Hop list."
    putlog "$nick removed $who from the Hop list in $channel"
 }
}
###End Of Chanserv Remove Hop

###Chanserv Add Vop
proc accessvop {nick host handle channel testes} {
    global nxg chanserv
if {[channel get $channel chanserv]} { 
    set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :Vop $channel add $who"
	putserv "PRIVMSG $channel :$who added to $channel Vop list."
    putlog "$nick added $who to the Vop list in $channel"
 }
}
###End Chanserv Add Vop

###Chanserv Remove Vop
proc accessremovevop {nick host handle channel testes} {
    global nxg chanserv
if {[channel get $channel chanserv]} { 
	set who [lindex $testes 0]
	putserv "PRIVMSG $chanserv :vop $channel del $who"
	putserv "PRIVMSG $channel :$who deleted from $channel Vop list."
    putlog "$nick removed $who from the Vop list in $channel"
 }
}
###End Of Chanserv Vop


putlog "Script loaded:Chanserv Script Made By Jer "



salute to all coders who can help.
It was FUNNY!
User avatar
CrazyCat
Revered One
Posts: 1318
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: chanserv.tcl

Post by CrazyCat »

What do you mean with "bot commands" ? public commands in the channel ?
User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

Re: chanserv.tcl

Post by aslpls »

CrazyCat wrote: Sat Dec 07, 2024 7:21 pm What do you mean with "bot commands" ? public commands in the channel ?
sorry for the term "bot commands".. what i mean is that..

from the public commands in the channel.. i need it in the tcl script. then add the tcl script in source scritps/chanserv.tcl

then when i do the commands via eggdrop;

!addaop #channel nickname

then the bot will read the tcl script (chanserv.tcl) then it will give response to:

botname: nickname added as aop in the #channel

you got the point?
It was FUNNY!
s
simo
Revered One
Posts: 1115
Joined: Sun Mar 22, 2015 2:41 pm

Re: chanserv.tcl

Post by simo »

are you gonna use this on dalnet ?
User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

Re: chanserv.tcl

Post by aslpls »

simo wrote: Sun Dec 08, 2024 3:37 pm are you gonna use this on dalnet ?
probably yes, and also in other network that have chanserv.
It was FUNNY!
s
simo
Revered One
Posts: 1115
Joined: Sun Mar 22, 2015 2:41 pm

Re: chanserv.tcl

Post by simo »

i ask this since not every network uses the same services package.

u can try this.

Syntax: !aop add/del nick

Code: Select all


bind PUB n !aop ChanServ:Add-DEL:OP
 
proc ChanServ:Add-DEL:OP {nick uhost hand chan arg} {
   set arg [string map [list \017 ""] [stripcodes abcgru $arg]]

   set items [split $arg]

   if {[llength $items] < 1 || [llength $items] > 1} {  putnow "NOTICE $nick :!aop add/del nick" ; return }

  set targetnick "[lindex [split $arg] 1]"

  switch -nocase -- [lindex [split $arg] 0] {
    add {
        putserv "ChanServ aop $chan :ADD $targetnick "
        putserv "NOTICE $nick :$targetnick has been added on the AOP List of channel\: $chan."
}
    del {
        putserv "ChanServ aop $chan :DEL $targetnick "
        putserv "NOTICE $nick :$targetnick has been removed from the AOP list of channel\: $chan."
    }    
  }
}


User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

Re: chanserv.tcl

Post by aslpls »

I've tried the script but this required:

it shows like this..

Code: Select all

<@aslpls> !aop
-Bot- !aop add/del nick
<@aslpls> !aop add janice
-Bot- !aop add/del nick
<@aslpls> !aop add
-Bot-  has been added on the AOP List of channel: #aslpls.

from DCC it shows

<Bot> [16:02:18] -ChanServ (service@dal.net)- Usage: AOP <#channel> <ADD|DEL|LIST|WIPE> [<nick/mask>]
<Bot> [16:02:18] -ChanServ (service@dal.net)- For help, /msg ChanServ@services.dal.net HELP AOP

Code: Select all

aslpls> .errorinfo
<Bot> [16:09:47] ----------------
<Bot> [16:09:47] can't find package tcllibc
<Bot>     while executing
<Bot> "package require tcllibc"
<Bot> [16:09:47] errorCode : TCL PACKAGE UNFOUND
<Bot> [16:09:47] ----------------
do you know how to install "package require tcllibc" ?

I've search online but i cannot find on how to install in debian.

i have this installed in my system.

apt install curl
apt install openssl libssl-dev
apt install tcl8.6-dev tk8.6-dev
apt install tcllib
apt install tcltls
apt install tdom
apt install libtcl8.6
apt install tcl-trf
It was FUNNY!
User avatar
Carlin0
Halfop
Posts: 41
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Re: chanserv.tcl

Post by Carlin0 »

try

Code: Select all

apt install tcllib-critcl
"From the diamonds nothing is born, from the manure the flowers are born ..."
--- F. De Andrè ---
User avatar
CrazyCat
Revered One
Posts: 1318
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: chanserv.tcl

Post by CrazyCat »

aslpls wrote: Sun Dec 08, 2024 4:57 pm I've tried the script but this required:

it shows like this..

Code: Select all

<@aslpls> !aop
-Bot- !aop add/del nick
<@aslpls> !aop add janice
-Bot- !aop add/del nick
<@aslpls> !aop add
-Bot-  has been added on the AOP List of channel: #aslpls.
from DCC it shows

Code: Select all

<Bot> [16:02:18] -ChanServ (service@dal.net)- Usage: AOP <#channel> <ADD|DEL|LIST|WIPE> [<nick/mask>]
<Bot> [16:02:18] -ChanServ (service@dal.net)- For help, /msg ChanServ@services.dal.net HELP AOP
Replace the following lines in the script from simo:
putserv "ChanServ aop $chan :ADD $targetnick "
...
putserv "ChanServ aop $chan :DEL $targetnick "
with the good syntax:
putserv "PRIVMSG ChanServ :AOP $chan ADD $targetnick"
...
putserv "PRIVMSG ChanServ :AOP $chan DEL $targetnick"
User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

Re: chanserv.tcl

Post by aslpls »

i have added the suggestion of Crazycat and Carlino but it seems still not working..
It was FUNNY!
User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

Re: chanserv.tcl

Post by aslpls »

based on my first post and the script the simo posted..
and as per on my search online, this is what i found and come up with the code..

simple but it is working 100% on the network that have Chanserv

Code: Select all


set channel "#aslpls"
set chanserv "ChanServ@services.dal.net"

bind pub - "!addaop" add_aop
bind pub - "!delaop" del_aop

proc add_aop {nick uhost hand chan text} {
    global channel chanserv

    if {$chan != $channel} {
        return
    }

    set params [split $text]
    if {[llength $params] < 1} {
        putserv "PRIVMSG $chan :Usage: !addaop <nickname>"
        return
    }

    set user [lindex $params 0]
    putserv "PRIVMSG $chanserv :AOP $channel ADD $user"
    putserv "PRIVMSG $chan :Added $user to the AutoOp (AOP) list."
}

proc del_aop {nick uhost hand chan text} {
    global channel chanserv

    if {$chan != $channel} {
        return
    }

    set params [split $text]
    if {[llength $params] < 1} {
        putserv "PRIVMSG $chan :Usage: !delaop <nickname>"
        return
    }

    set user [lindex $params 0]
    putserv "PRIVMSG $chanserv :AOP $channel DEL $user"
    putserv "PRIVMSG $chan :Removed $user from the AutoOp (AOP) list."
}
if you have a network with chanserv just change this "set chanserv"

Code: Select all

set channel "#aslpls"
[color=#FF0000]set chanserv "ChanServ@services.[b]yournetwork.net[/b]"[/color]

please share your thoughts if you have other ways..
It was FUNNY!
User avatar
Carlin0
Halfop
Posts: 41
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Re: chanserv.tcl

Post by Carlin0 »

aslpls wrote: Sun Dec 08, 2024 4:57 pm I've tried the script but this required:

Code: Select all

aslpls> .errorinfo
<Bot> [16:09:47] ----------------
<Bot> [16:09:47] can't find package tcllibc
<Bot>     while executing
<Bot> "package require tcllibc"
<Bot> [16:09:47] errorCode : TCL PACKAGE UNFOUND
<Bot> [16:09:47] ----------------
do you know how to install "package require tcllibc" ?
Do you still have this error ?
"From the diamonds nothing is born, from the manure the flowers are born ..."
--- F. De Andrè ---
User avatar
aslpls
Halfop
Posts: 62
Joined: Mon May 02, 2016 9:41 am

Re: chanserv.tcl

Post by aslpls »

no error after installing this

Code: Select all

apt install tcllib-critcl
and then restart your bot..
It was FUNNY!
s
simo
Revered One
Posts: 1115
Joined: Sun Mar 22, 2015 2:41 pm

Re: chanserv.tcl

Post by simo »

Code: Select all




bind PUB n !aop ChanServ:Add-DEL:OP
 
proc ChanServ:Add-DEL:OP {nick uhost hand chan arg} {
   set arg [string map [list \017 ""] [stripcodes abcgru $arg]]

   set items [split $arg]

   if {[llength $items] < 2 || [llength $items] > 2} {  putnow "NOTICE $nick :!aop add/del nick" ; return }

  set targetnick "[lindex [split $arg] 1]"

  if {![onchan $targetnick $chan]} {  putserv "NOTICE $nick :$targetnick is not on channel $chan" ; return }

  switch -nocase -- [lindex [split $arg] 0] {
    add {
        putserv "ChanServ :aop $chan ADD $targetnick" ; putserv "mode $chan +o $targetnick"
        putserv "NOTICE $nick :$targetnick has been added on the AOP List of channel\: $chan."
}
    del {
        putserv "ChanServ :aop $chan DEL $targetnick" ; putserv "mode $chan -o $targetnick"
        putserv "NOTICE $nick :$targetnick has been removed from the AOP list of channel\: $chan."
    }    
  }
}





User avatar
CrazyCat
Revered One
Posts: 1318
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: chanserv.tcl

Post by CrazyCat »

simo, read the thread before posting erroreous code !
simo wrote: Mon Dec 09, 2024 10:49 am

Code: Select all

        putserv "ChanServ :aop $chan ADD $targetnick"

        putserv "ChanServ :aop $chan DEL $targetnick"
These 2 lines can work only if the ircd is configured to have an alias of "chanserv".

The proper lines are:
putserv "PRIVMSG ChanServ :AOP $chan ADD $targetnick"

putserv "PRIVMSG ChanServ :AOP $chan DEL $targetnick"
When you do some code, use the real commands, never any alias or shortcut.
Post Reply