| View previous topic :: View next topic |
| Author |
Message |
IWillNotChange Voice
Joined: 17 Mar 2012 Posts: 8
|
Posted: Sat Apr 14, 2012 7:00 am Post subject: simple if not voice+ kick from channel |
|
|
I need a super simple script.
I need it to kick users who talk in the channel who arent voice or higher, saying that they arent aloud to talk without permission.
And on a side note, a simple on text !servers reply with
Current list of servers is:
(Ill fill in the rest >.<i cant code but i can do that part haha)
Thank you in advance. _________________ Lower expectations, greater achievements. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Apr 14, 2012 9:10 am Post subject: Re: simple if not voice+ kick from channel |
|
|
| IWillNotChange wrote: | I need a super simple script.
I need it to kick users who talk in the channel who arent voice or higher, saying that they arent aloud to talk without permission.
...
|
"super simple" being the operative words.
i.e. It has no frills.
| Code: |
# April 14, 2012
# forum user = iwillnotchange
# requested kick on post, if not voiced.
# http://forum.egghelp.org/viewtopic.php?t=18923
#I need a super simple script.
#I need it to kick users who talk in the channel who arent voice or higher, saying that they arent aloud to talk without permission.
# ...
#Thank you in advance.
#########
# Note: Script is active in all channels that bot is in
bind pubm - "*" kicknovoice
proc kicknovoice { nick uhost handle chan text} {
if {[isvoice $nick $chan]} {
return 0
}
if {[isop $nick $chan]} {
return 0
}
putkick $chan $nick "You are not allowed to post in $chan without permission"
return 0
}
|
Tested only briefly.
I hope this helps.
p.s. I took the liberty of changing the spelling of "aloud". " |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Apr 14, 2012 9:37 am Post subject: Re: simple if not voice+ kick from channel |
|
|
| IWillNotChange wrote: | I need a super simple script.
...
And on a side note, a simple on text !servers reply with
Current list of servers is:
(Ill fill in the rest >.<i cant code but i can do that part haha)
Thank you in advance. |
| Code: |
# April 14, 2012
# forum user = iwillnotchange
# http://forum.egghelp.org/viewtopic.php?p=99188
# ...
# And on a side note, a simple on text !servers reply with
# Current list of servers is:
#(Ill fill in the rest >.<i cant code but i can do that part haha)
# Thank you in advance.
###
# Set the filename/path of the file that will hold the list of servers
set serversfile "scripts/added/testing/serversfile.txt"
bind pub - "!servers" say_servers
proc say_servers {nick uhost handle chan text} {
global serversfile
# Reference: http://forum.egghelp.org/viewtopic.php?t=6885
set fname "$serversfile"
set fp [open $fname "r"]
set data [read -nonewline $fp]
close $fp
set lines [split $data "\n"]
putserv "privmsg $chan :Current list of servers is:"
foreach server $lines {
putserv "privmsg $chan :$server"
}
}
|
Again - super simple. For example, does not check to see if file exists... simply coughs up an error if it does not.
See :
set serversfile "scripts/added/testing/serversfile.txt"
You need to edit that line.
Then create the file, with your list of servers (or whatever).
All this script does is:
Find a text file, open it, and read it.
Post it to the channel, line-by-line.
Experiment with it, and see if it does what you want. |
|
| Back to top |
|
 |
IWillNotChange Voice
Joined: 17 Mar 2012 Posts: 8
|
Posted: Sat Apr 14, 2012 9:55 am Post subject: |
|
|
Perfect! Thank you very much will test it out when i get home, but can i ask for one change? For the first one, can it be set to only certian channels? _________________ Lower expectations, greater achievements. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Apr 14, 2012 10:22 am Post subject: |
|
|
| IWillNotChange wrote: | Perfect! Thank you very much
|
You're welcome.
| Quote: |
will test it out when i get home, but can i ask for one change? For the first one, can it be set to only certian channels?
|
| Code: |
# April 14, 2012
# forum user = iwillnotchange
# requested kick on post, if not voiced.
# http://forum.egghelp.org/viewtopic.php?t=18923
#I need a super simple script.
#I need it to kick users who talk in the channel who arent voice or higher, saying that they arent aloud to talk without permission.
# ...
#Thank you in advance.
#########
# Usage: To enable on a given channel: .chanset #channel +novoicekick
# To disable on a given channel: .chanset $channel -novoicekick
setudef flag novoicekick
bind pubm - "*" kicknovoice
proc kicknovoice { nick uhost handle chan text} {
if {![channel get $chan novoicekick]} {
return 0
}
if {[isvoice $nick $chan]} {
return 0
}
if {[isop $nick $chan]} {
return 0
}
putkick $chan $nick "You are not allowed to post in $chan without permission"
return 0
}
|
Now, it is one small step away from "super simple".
Still not complicated though.
Rather than edit/overwrite my first post, I made a second complete post, so you can compare, and see what I added.
If you are trying to learn basics of TCL for Eggdrop, that should be helpful.
You can read about
channel get
and
setudef
here: http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html |
|
| Back to top |
|
 |
IWillNotChange Voice
Joined: 17 Mar 2012 Posts: 8
|
Posted: Sat Apr 14, 2012 2:05 pm Post subject: |
|
|
Haha thank you very much, I know a little bit of mIRC and see a slight resemblance, I'm not looking to be able to code it proficiently, but to at least know how it functions and get the general idea to make small fixes would be great, so I really do appreciate it more then you think! _________________ Lower expectations, greater achievements. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
|
| Back to top |
|
 |
IWillNotChange Voice
Joined: 17 Mar 2012 Posts: 8
|
Posted: Sat Apr 14, 2012 2:40 pm Post subject: |
|
|
# Usage: To enable on a given channel: .chanset #channel +novoicekick
# To disable on a given channel: .chanset $channel -novoicekick
so those two, do they get set right after that?
And, if I enable them
.chanset #lobby +novoicekick
do I need to set -novoicekick on the rest of the channels its in?
or just set it to the ones i need in it? _________________ Lower expectations, greater achievements. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Apr 14, 2012 3:56 pm Post subject: |
|
|
| IWillNotChange wrote: | # Usage: To enable on a given channel: .chanset #channel +novoicekick
# To disable on a given channel: .chanset $channel -novoicekick
so those two, do they get set right after that?
|
Right after what? What is "that"?
| Quote: |
And, if I enable them
.chanset #lobby +novoicekick
do I need to set -novoicekick on the rest of the channels its in?
or just set it to the ones i need in it? |
I believe that each channel will default to -novoicekick .
But, check them, with
.chaninfo
to be sure. |
|
| Back to top |
|
 |
|