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.

help with ""

Old posts that have not been replied to for several years.
Locked
e
e-force
Voice
Posts: 23
Joined: Tue Jan 04, 2005 7:10 pm

help with ""

Post by e-force »

Hello there! I`m trying to make my script with public commands, but i have problem with the kick procedure.
This is my procedure:
### Kick ###
bind pub o .k pub_kick
proc pub_kick {nick uhost hand chan txt} {
set opc_knick [lindex $txt 0]
set opc_kreason [lrange $txt 1 end]
if [matchattr $opc_knick b] {
putserv "PRIVMSG $chan :This is not allowed!"
return 0
}
if {![onchan $opc_knick $chan]} {
putserv "notice $nick :$opc_knick is not on $chan"
return 0
}
if {$opc_kreason == ""} {
putserv "kick $chan $opc_knick :Requested by $nick"
return 0
}
putserv "kick $chan $opc_knick :$opc_kreason"
}
When i try to .k nick\something my bot give a mistake:
[04:41] <e-force> .k e-f\test
[04:41] -SpeeD_- e-f est is not on #SpeeD_
[04:41] <e-force> [04:41] -SpeeD_- e-f est is not on #SpeeD_
It can`t reconize nicks with "\"
Can someone explain me how to repair my script?
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Re: help with ""

Post by egghead »

e-force wrote:Hello there! I`m trying to make my script with public commands, but i have problem with the kick procedure.
This is my procedure:

Code: Select all

### Kick ###
bind pub o .k pub_kick
proc pub_kick {nick uhost hand chan txt} {
  set opc_knick [lindex $txt 0]
  set opc_kreason [lrange $txt 1 end]
[snip]
It can`t reconize nicks with ""
Can someone explain me how to repair my script?
http://forum.egghelp.org/viewtopic.php?t=2603
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Here, this is mine. Favourably it is similar to your one which doesn't work, heh.

Code: Select all

bind pub n !kick kick_chan

proc kick_chan {nick uhost hand chan text} {
 if {([botisop $chan]) && ([onchan [lindex $text 0] $chan]) && ([string length $text] > 0)} {
 if {([lindex $text 1] != "")} { set reason "REQUESTED KICK: [lrange $text 1 end]" }
 if {([lindex $text 1] == "")} { set reason "KICKED: Requested by $nick" }
  putquick "KICK $chan [lindex $text 0] :$reason" -next
  }
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
User avatar
arcane
Master
Posts: 280
Joined: Thu Jan 30, 2003 9:18 am
Location: Germany
Contact:

Post by arcane »

however, i'd use [split] on $text first. :)
aVote page back online!
Check out the most popular voting script for eggdrop bots.

Join the metal tavern!
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

bind pub o|o .k pub:kick
proc pub:kick { nickname hostname handle channel arguments } {
set victim [lindex [split $arguments] 0]
set reason [lrange [split $arguments] 1 end]
if {[matchattr $victim b] && [matchattr $victim n]} {
putquick "NOTICE $nickname :You aren't allowed to kick this user!"
return 0
}
if {![onchan $victim $channel]} {
putquick "NOTICE $nickname :$victim is not on $channel"
return 0
}
if {$reason == ""} {
set reason "Requested"
}
putquick "KICK $channel $victim :$reason"
} 
This code will work alot better :p
e
e-force
Voice
Posts: 23
Joined: Tue Jan 04, 2005 7:10 pm

Post by e-force »

Ok, thanks to all, now my problem is fixed,
Locked