egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Public commands and channel management

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Mike05
Voice


Joined: 12 Dec 2020
Posts: 22

PostPosted: Sun Mar 28, 2021 4:34 pm    Post subject: Public commands and channel management Reply with quote

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
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Sun Mar 28, 2021 7:35 pm    Post subject: Reply with quote

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:

##
# 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
View user's profile Send private message Send e-mail Visit poster's website
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Mon Mar 29, 2021 5:30 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Mar 29, 2021 6:25 am    Post subject: Reply with quote

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
View user's profile Send private message
Mike05
Voice


Joined: 12 Dec 2020
Posts: 22

PostPosted: Mon Mar 29, 2021 1:10 pm    Post subject: Reply with quote

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

Thanks again friends
Back to top
View user's profile Send private message
Mike05
Voice


Joined: 12 Dec 2020
Posts: 22

PostPosted: Mon Mar 29, 2021 1:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Mon Mar 29, 2021 2:23 pm    Post subject: Reply with quote

I personally recommend Bass's Seen script


There are however, many other's

http://tclarchive.org/search.php?Seen
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Mon Mar 29, 2021 3:12 pm    Post subject: Reply with quote

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. 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 Razz
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mike05
Voice


Joined: 12 Dec 2020
Posts: 22

PostPosted: Tue Mar 30, 2021 7:39 pm    Post subject: Reply with quote

ComputerTech;

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

Thanks guys
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber