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.

simple if not voice+ kick from channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
I
IWillNotChange
Voice
Posts: 8
Joined: Sat Mar 17, 2012 5:45 pm
Contact:

simple if not voice+ kick from channel

Post by IWillNotChange »

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.
w
willyw
Revered One
Posts: 1202
Joined: Thu Jan 15, 2009 12:55 am

Re: simple if not voice+ kick from channel

Post by willyw »

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


# 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". :D"
w
willyw
Revered One
Posts: 1202
Joined: Thu Jan 15, 2009 12:55 am

Re: simple if not voice+ kick from channel

Post by willyw »

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



# 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.
I
IWillNotChange
Voice
Posts: 8
Joined: Sat Mar 17, 2012 5:45 pm
Contact:

Post by IWillNotChange »

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.
w
willyw
Revered One
Posts: 1202
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

IWillNotChange wrote:Perfect! Thank you very much
You're welcome.
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: Select all


# 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 ... mands.html
I
IWillNotChange
Voice
Posts: 8
Joined: Sat Mar 17, 2012 5:45 pm
Contact:

Post by IWillNotChange »

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.
w
willyw
Revered One
Posts: 1202
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

IWillNotChange wrote: ... 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!
Bookmark these then:

http://suninet.the-demon.de/

http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm

http://www.eggheads.org/support/egghtml ... mands.html


If you have those three open, in front of you, you can do a LOT.

Have fun with it. :)
I
IWillNotChange
Voice
Posts: 8
Joined: Sat Mar 17, 2012 5:45 pm
Contact:

Post by IWillNotChange »

# 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.
w
willyw
Revered One
Posts: 1202
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

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"?
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.
Post Reply