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 

simple if not voice+ kick from channel

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


Joined: 17 Mar 2012
Posts: 8

PostPosted: Sat Apr 14, 2012 7:00 am    Post subject: simple if not voice+ kick from channel Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Apr 14, 2012 9:10 am    Post subject: Re: simple if not voice+ kick from channel Reply with quote

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. Smile
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". Very Happy"
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Apr 14, 2012 9:37 am    Post subject: Re: simple if not voice+ kick from channel Reply with quote

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


Joined: 17 Mar 2012
Posts: 8

PostPosted: Sat Apr 14, 2012 9:55 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Apr 14, 2012 10:22 am    Post subject: Reply with quote

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. Smile

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


Joined: 17 Mar 2012
Posts: 8

PostPosted: Sat Apr 14, 2012 2:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Apr 14, 2012 2:13 pm    Post subject: Reply with quote

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/1.6.21/tcl-commands.html


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

Have fun with it. Smile
Back to top
View user's profile Send private message
IWillNotChange
Voice


Joined: 17 Mar 2012
Posts: 8

PostPosted: Sat Apr 14, 2012 2:40 pm    Post subject: Reply with quote

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


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Apr 14, 2012 3:56 pm    Post subject: Reply with quote

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
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