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.

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

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
d
dr3am3rs
Voice
Posts: 4
Joined: Sun Jul 22, 2007 3:33 pm

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

Post by dr3am3rs »

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

:cry:
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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.
On channel1, the voiced user will type:

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

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

Code: Select all

#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..
Last edited by awyeah on Mon Jul 23, 2007 11:23 am, edited 3 times in total.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dr3am3rs
Voice
Posts: 4
Joined: Sun Jul 22, 2007 3:33 pm

Post by dr3am3rs »

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...
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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

  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.
==================================
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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. :P
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
d
dr3am3rs
Voice
Posts: 4
Joined: Sun Jul 22, 2007 3:33 pm

Post by dr3am3rs »

Thanks again GUys...
Thanks for the lovely help..
Post Reply