| View previous topic :: View next topic |
| Author |
Message |
Mike05 Voice
Joined: 12 Dec 2020 Posts: 22
|
Posted: Sun Mar 28, 2021 4:34 pm Post subject: Public commands and channel management |
|
|
Hello Friends;
Please recommend me the best tcl script with public commands and channel management.
Example: !k !b !kb !v !op !nb (nick ban) !flag +V Nick (autovoice).
And how to add custom commands ?
Thanks in advance. I would highly appreciate your help.
Thanks |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Sun Mar 28, 2021 7:35 pm Post subject: |
|
|
Try the following
SirFz's FZcommands
Download
My Code CTcommands
Download
caesar's code
Here
Lol'z tools
Download
or this code i just made for you
Untested
| Code: |
##
# Flags for script usage
set foo(flag) "ofmn"
##
# Voice triggers
set foo(vtrig) "voice v"
##
# Devoice triggers
set foo(dvtrig) "devoice dv"
##
# Op triggers
set foo(otrig) "op o"
##
# Deop triggers
set foo(dotrig) "deop do"
##
# Kick triggers
set foo(kick) "kick k"
##
# Ban triggers {"ban" "b"}
set foo(ban) "ban b"
##
# Kickban triggers
set foo(kickb) "kickban kb"
#####
#Stop
#############
bind PUB $foo(flag) [split $foo(vtrig)] voice:proc
bind PUB $foo(flag) [split $foo(dvtrig)] devoice:proc
bind PUB $foo(flag) [split $foo(otrig)] op:proc
bind PUB $foo(flag) [split $foo(dotrig)] deop:proc
bind PUB $foo(flag) [split $foo(kick)] kick:proc
bind PUB $foo(flag) [split $foo(kickb)] kb:proc
bind PUB $foo(flag) [split $foo(ban)] ban:proc
proc voice:proc {nick host hand chan text} {
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "MODE $chan +v [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
pushmode $chan +v $vnick
}
}
}
proc devoice:proc {nick host hand chan text} {
if {![botisop $chan]} {return}
if {![isbotnick $nick]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "MODE $chan -v [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
pushmode $chan -v $vnick
}
}
}
proc op:proc {nick host hand chan text} {
if {![botisop $chan]} {return}
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "MODE $chan +o [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
pushmode $chan +o $vnick
}
}
}
proc deop:proc {nick host hand chan text} {
if {[isbotnick $nick]} {return}
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "MODE $chan -o [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
pushmode $chan -o $vnick
}
}
}
proc kick:proc {nick host hand chan text} {
if {[isbotnick $nick]} {return}
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "KICK $chan [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
putkick $chan $vnick
}
}
}
proc kb:proc {nick host hand chan text} {
if {[isbotnick $nick]} {return}
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "MODE $chan +b [lindex [split $text] 0]"
putquick "KICK $chan [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
set bhost "[maskhost $vnick![getchanhost $vnick $chan] 2]"
pushmode $chan +b $bhost
putkick $chan $vnick
}
}
}
proc ban:proc {nick host hand chan text} {
if {[isbotnick $nick]} {return}
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
set vnick [lindex [split $text] 0]
set bhost "[maskhost $vnick![getchanhost $vnick $chan] 2]"
putquick "MODE $chan +b $bhost"
} else {
foreach vnick [split $text] {
set bhost [maskhost $vnick![getchanhost $vnick $chan] 2]
pushmode $chan +b $bhost
}
}
}
|
_________________ ComputerTech |
|
| Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
Posted: Mon Mar 29, 2021 5:30 am Post subject: |
|
|
I've a little doubt about:
| Code: | | bind PUB $foo(flag) [split $foo(vtrig)] voice:proc |
I never heard about using a list as keyword/mask. _________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Mon Mar 29, 2021 6:25 am Post subject: |
|
|
Since binds expect a certain amount of arguments it will just crash.
On top of that "my code" isn't quite what he really needs, not to mention that code has room for improvements.
Speaking about code, yours has some logic faults and won't get the expected results. For example:
| Code: |
proc op:proc {nick host hand chan text} {
if {![botisop $chan]} {return}
if {![botisop $chan]} {return}
if {[lindex [split $text] 0] == ""} {
putquick "MODE $chan +o [lindex [split $text] 0]"
} else {
foreach vnick [split $text] {
pushmode $chan +o $vnick
}
}
}
|
3rd if line says if first element of the list is empty (most likely is a typo and you wanted to negate not make it equal) then do +o on the first element, that is like I just said empty, else loop over the list and do +o on each element. You don't bother using onchan to see if the list contains valid elements or not, nor if any of the names already has the @. _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
Mike05 Voice
Joined: 12 Dec 2020 Posts: 22
|
Posted: Mon Mar 29, 2021 1:10 pm Post subject: |
|
|
Thank you so much for your response and help.
Much appreciate.
Thanks again friends |
|
| Back to top |
|
 |
Mike05 Voice
Joined: 12 Dec 2020 Posts: 22
|
Posted: Mon Mar 29, 2021 1:15 pm Post subject: |
|
|
Friends;
Please recommend me the best seen script, and Please guide me how to set the seen private, example if a user performs seen on his/her friends the seen result must be visible to the user who perform seen, not for the whole channel.
And how to add custom alias command , example, !nbon that should prevent users to change their nick, example, !nboff, now users can change their nick . How to set auto voice flag. example. !flag +V Nick.
I would highly appreciate your help
Thanks in advance |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Mon Mar 29, 2021 3:12 pm Post subject: |
|
|
And for your !flag code
| Code: |
bind PUB ofmn|ofmn "!autovoice" auto:voice
proc auto:voice {nick host hand chan text} {
#Sets $nick2 which will be !autovoice thisnickhere
set nick2 [lindex [split $text] 0]
#Checks if nick2 is on the channel and if not, will stop the script and return with a error message
if {![onchan $nick2 $chan]} {
puthelp "PRIVMSG $chan :I don't see $nick2 on $chan"
return
}
#Grabs the handle of the nick
set hand2 [nick2hand $nick2]
#sets userflag +g on specified nick on the channel
chattr $hand2 +g $chan
#Message
puthelp "PRIVMSG $chan :{$nick2}(with handle $hand2) now has Autovoice on $chan"
}
|
simply use !autovoice Nick
and it will give the nick userflag +g which will autovoice on join for the channel the command was used on.
I also added comments explaining how the code works, try reading them and see if you can understand them
Links:
https://docs.eggheads.org/ << Documentation of Eggdrop
http://suninet.the-demon.de/ << a great basic guide to Tcl
Hope this helps  _________________ ComputerTech |
|
| Back to top |
|
 |
Mike05 Voice
Joined: 12 Dec 2020 Posts: 22
|
Posted: Tue Mar 30, 2021 7:39 pm Post subject: |
|
|
ComputerTech;
Thank you so much for your response and help. And thank you those who responded to my request.
Thanks guys |
|
| Back to top |
|
 |
|