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 

+v can k\ban users in diff # without having access to the #

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


Joined: 22 Jul 2007
Posts: 4

PostPosted: Sun Jul 22, 2007 7:57 pm    Post subject: +v can k\ban users in diff # without having access to the # Reply with quote

I'll really appreciate if some1 would spare some time to make this script..

+v users in #ChannelA can kick users in #ChannelB

In details,

Voiced users in #ChannelA can kick users in #ChannelB with or without being in #channelB
Voiced users in #ChannelA dont have any flag or access in #ChannelB
If possible,if not
Tell me nearest possible match or i need to link this two channel..
Please teach me....

Please make this tcl possible ohh,Wise scripters....

Crying or Very sad
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun Jul 22, 2007 8:56 pm    Post subject: Reply with quote

Well I don't see a valid reason to create this type of script in my opinion it is redundant, but anyway here it goes.

Quote:

On channel1, the voiced user will type:

!k <nick> <reason>
!kick <nick> <reason>

where, <nick> will be the person to kick on channel2


Code:

#Channel from where users will kick people
set chan1 "#mychan"

#Channel where users will get kicked
set chan2 "#yourchan"


#############################
bind pub - "!k" kick:in:chan2
bind pub - "!kick" kick:in:chan2

proc kick:in:chan2 {nick uhost hand chan text} {
 global chan1 chan2
 if {![string equal -nocase $chan $chan2]} { return 0 }
 if {[botonchan $chan1] && [botonchan $chan2] && [botisop $chan2]} {
  if {[isvoice $nick $chan2]} {
   set text [split $text]
   set user [lindex $text 0]
   set chan1 [string tolower $chan1]
   set chan2 [string tolower $chan2]
   set reason [lrange $text 1 end]
  if {$user != ""} {
   if {[onchan $user $chan2]} {
    if {$reason == ""} { set reason "Kick requested by $nick on $chan1" }
    putserv "KICK $chan2 $user :$reason"
   } else {
    putserv "PRIVMSG $chan1 :$user is not on $chan2"
   }
  } else {
    putserv "PRIVMSG $chan1 :Usage: !kick <nick on $chan2> <reason>"
   }
  }
 }
}


NOTE: Edited for a small bug fix..
Fixed $text from a string to a list..
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================


Last edited by awyeah on Mon Jul 23, 2007 11:23 am; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
dr3am3rs
Voice


Joined: 22 Jul 2007
Posts: 4

PostPosted: Sun Jul 22, 2007 9:11 pm    Post subject: Reply with quote

Thanks alot awyeah..

The script only works for users above voice status from #channel1 to work right?
Or it does work for all?

Thanks Again awyeah..really thanks for the fast respond and time spend...
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun Jul 22, 2007 10:37 pm    Post subject: Reply with quote

dr3am3rs wrote:
Thanks alot awyeah..

The script only works for users above voice status from #channel1 to work right?
Or it does work for all?

Thanks Again awyeah..really thanks for the fast respond and time spend...


I edited the script above for a small bug fix. Make sure you copy it again and use this bug fixed code in your eggdrop now. As for your question, this script only works for people who have "+v" (voice) on their nick.

Code:

  if {[isvoice $nick $chan2]} {


And no it does not work for all, only voiced people will be able to use it. So it can apply that, not even ops or bot masters or the bot owner can use it.

And to make it more clearer, only voices from channel1 can kick:

-ops in channel2
-voices in channel2
=> meaning anyone, with any access on channel2
(condition bot is on both channels and is opped on channel2)

Just coded as you requested from your initial request.
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Jul 23, 2007 6:09 am    Post subject: Reply with quote

Just a note, you're using list-commands on $text, which is a user-supplied string, and not a list. Might wanna split it first...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Jul 23, 2007 11:25 am    Post subject: Reply with quote

nml375 wrote:
Just a note, you're using list-commands on $text, which is a user-supplied string, and not a list. Might wanna split it first...


My bad sorry.. fixed and edited it. A small split of $text before using the list indexes to retrieve the user and the kick reason.

The edited code should work fine now, this would IMHO be nml375's suggestion for nicks and kick reasons with special characters. Razz
_________________
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
dr3am3rs
Voice


Joined: 22 Jul 2007
Posts: 4

PostPosted: Mon Jul 23, 2007 2:19 pm    Post subject: Reply with quote

Thanks again GUys...
Thanks for the lovely help..
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