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.

Public commands and channel management

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
M
Mike05
Voice
Posts: 22
Joined: Sat Dec 12, 2020 1:37 am

Public commands and channel management

Post by Mike05 »

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
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

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 :wink:
Untested

Code: Select all

##
# 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
User avatar
CrazyCat
Revered One
Posts: 1301
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

I've a little doubt about:

Code: Select all

bind PUB $foo(flag) [split $foo(vtrig)] voice:proc
I never heard about using a list as keyword/mask.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

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: Select all

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.
M
Mike05
Voice
Posts: 22
Joined: Sat Dec 12, 2020 1:37 am

Post by Mike05 »

Thank you so much for your response and help.
Much appreciate.

Thanks again friends
M
Mike05
Voice
Posts: 22
Joined: Sat Dec 12, 2020 1:37 am

Post by Mike05 »

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
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

I personally recommend Bass's Seen script


There are however, many other's

http://tclarchive.org/search.php?Seen
ComputerTech
User avatar
ComputerTech
Master
Posts: 399
Joined: Sat Feb 22, 2020 10:29 am
Contact:

Post by ComputerTech »

And for your !flag code

Code: Select all

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. :wink:

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 :P
ComputerTech
M
Mike05
Voice
Posts: 22
Joined: Sat Dec 12, 2020 1:37 am

Post by Mike05 »

ComputerTech;

Thank you so much for your response and help. And thank you those who responded to my request.

Thanks guys
Post Reply