| View previous topic :: View next topic |
| Author |
Message |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Wed Apr 20, 2005 11:44 pm Post subject: script request |
|
|
hello
i was wondering if some one could make a tcl that would make the eggdrop do a /msg chanserv@services.dal.net why #name nick whenever some one is oped in a channel and kick the user if the nick is using someone else's access.
thanx in advance .. _________________ !~!~!~!~!~ ::Long Live The REpubLic ::~!~!~! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Apr 21, 2005 9:22 am Post subject: |
|
|
| Code: | bind mode - "* +o" why:nick
bind notc - "*Identification to the nickname*" nick:whyed
proc why:nick {nick uhost hand chan mc vict} {
global whyed
putserv "PRIVMSG chanserv@services.dal.net :why $chan $vict"
set whyed([string tolower $vict])
}
proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} {
putquick "KICK [stripcodes b [string trimright [lindex [split $text] 5] .]] [string trimright [lindex [split $text] end] .] :You're using someone else's access"
unset whyed([string tolower [lindex [split $text] 0]])
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Sat Apr 23, 2005 11:03 am Post subject: |
|
|
thanx for that code..
can that script b made channel specific, which i can controle from the dcc commands . like
.chanset #name +/- deop _________________ !~!~!~!~!~ ::Long Live The REpubLic ::~!~!~! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Apr 23, 2005 2:25 pm Post subject: |
|
|
| Code: | setudef flag deop
bind mode - "* +o" why:nick
bind notc - "*Identification to the nickname*" nick:whyed
proc why:nick {nick uhost hand chan mc vict} {
global whyed
if {![channel get $chan deop]} { return 0 }
putserv "PRIVMSG chanserv@services.dal.net :why $chan $vict"
set whyed([string tolower $vict])
}
proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} {
putquick "KICK [stripcodes b [string trimright [lindex [split $text] 5] .]] [string trimright [lindex [split $text] end] .] :You're using someone else's access"
unset whyed([string tolower [lindex [split $text] 0]])
} |
.chanset #channel +/-deop to enable disable. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Sat Apr 23, 2005 7:49 pm Post subject: |
|
|
i got this error
| Code: |
missing close-brace
while executing
"proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if { |
^DooM^ Owner

Joined: 26 Aug 2003 Posts: 772 Location: IronForge
|
Posted: Sat Apr 23, 2005 8:15 pm Post subject: |
|
|
change this
| Code: | | if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} |
to this
| Code: | | if {![string equal -nocase [lindex [split $text] 0]] [string trimright [lindex [split $text] end] .]} |
_________________ The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Apr 23, 2005 9:12 pm Post subject: |
|
|
| Quote: | | missing close-brace |
add a } at the end of the proc.
| Code: |
........
unset whyed([string tolower [lindex [split $text] 0]])
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Sun Apr 24, 2005 5:38 am Post subject: |
|
|
| Code: | setudef flag deop
bind mode - "* +o" why:nick
bind notc - "*Identification to the nickname*" nick:whyed
proc why:nick {nick uhost hand chan mc vict} {
global whyed
if {![channel get $chan deop]} { return 0 }
putserv "PRIVMSG chanserv@services.dal.net :why $chan $vict"
set whyed([string tolower $vict])
}
proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} {
putquick "KICK [stripcodes b [string trimright [lindex [split $text] 5] .]] [string trimright [lindex [split $text] end] .] :You're using someone else's access"
unset whyed([string tolower [lindex [split $text] 0]])
}
} |
thats the code and this the error that i got
| Code: | | Tcl error [why:nick]: can't read "whyed(metallica-)": no such variable |
metallica- was the nick that i used to op in the channel with someone elses access. _________________ !~!~!~!~!~ ::Long Live The REpubLic ::~!~!~! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Apr 24, 2005 8:46 am Post subject: |
|
|
forgot to set anything to whyed(nick), this should fix it:
| Code: | setudef flag deop
bind mode - "* +o" why:nick
bind notc - "*Identification to the nickname*" nick:whyed
proc why:nick {nick uhost hand chan mc vict} {
global whyed
if {![channel get $chan deop]} { return 0 }
putserv "PRIVMSG chanserv@services.dal.net :why $chan $vict"
set whyed([string tolower $vict]) 1
}
proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} {
putquick "KICK [stripcodes b [string trimright [lindex [split $text] 5] .]] [string trimright [lindex [split $text] end] .] :You're using someone else's access"
unset whyed([string tolower [lindex [split $text] 0]])
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Sun Apr 24, 2005 9:54 am Post subject: |
|
|
Also try to string map or regsub, $vict for as that nick can contain special chars [, ], etc which for arrays it can be deadly. _________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Apr 24, 2005 11:12 am Post subject: |
|
|
| awyeah wrote: | | Also try to string map or regsub, $vict for as that nick can contain special chars [, ], etc which for arrays it can be deadly. |
I don't think that's necessary, I never had any problems with it anyways. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Sun Apr 24, 2005 11:57 pm Post subject: |
|
|
now i got this error ..
| Code: | | Tcl error [nick:whyed]: invalid command name "stripcodes" |
_________________ !~!~!~!~!~ ::Long Live The REpubLic ::~!~!~! |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Mon Apr 25, 2005 12:09 am Post subject: |
|
|
You're eggdrop version is less than 1.6.17. Please upgrade it to the latest version from www.eggheads.org or use:
wget www.geteggdrop.com
The 'stripcodes' function is only in eggdrop versions 1.6.17 or greater, or you have to use a filter like this:
| Code: |
proc stripcodes {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
pakistani1 Voice
Joined: 20 Apr 2005 Posts: 26 Location: Pakistan Zindabad
|
Posted: Mon Apr 25, 2005 1:55 am Post subject: |
|
|
i tried upgrading to 1.6.17 but i couldnot .. some warnings are displayed when i use the make command.
i upgraded to version 1.6.16
here is the code i am using .. now ...
| Code: |
setudef flag deop
bind mode - "* +o" why:nick
bind notc - "*Identification to the nickname*" nick:whyed
proc stripcodes {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
proc why:nick {nick uhost hand chan mc vict} {
global whyed
if {![channel get $chan deop]} { return 0 }
putserv "PRIVMSG chanserv@services.dal.net :why $chan $vict"
set whyed([string tolower $vict]) 1
}
proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} {
putquick "KICK [stripcodes b [string trimright [lindex [split $text] 5] .]] [string trimright [lindex [split $text] end] .] :You're using someone else's access"
unset whyed([string tolower [lindex [split $text] 0]])
}
} |
the bot does a /msg chanserv@services.dal.net why #name nick
but does not kick the nick ..
here is the error it displays in the dcc
| Code: | | Tcl error [nick:whyed]: wrong # args: should be "stripcodes str" |
_________________ !~!~!~!~!~ ::Long Live The REpubLic ::~!~!~! |
|
| Back to top |
|
 |
awyeah Revered One

Joined: 26 Apr 2004 Posts: 1580 Location: Switzerland
|
Posted: Mon Apr 25, 2005 1:26 pm Post subject: |
|
|
Well you had to change the input variables in the main proc for stripcodes. Here use this:
| Code: |
setudef flag deop
bind mode - "*+o*" why:nick
bind notc - "*Identification to the nickname*" nick:whyed
proc why:nick {nick uhost hand chan mc vict} {
global whyed
if {![channel get $chan deop]} { return 0 }
putserv "PRIVMSG chanserv@services.dal.net :why $chan $vict"
set whyed([string tolower $vict]) 1
}
proc nick:whyed {nick uhost hand text dest} {
global whyed
if {![info exists whyed([string tolower [lindex [split $text] 0]])]} { return 0 }
if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]} {
putquick "KICK [stripcodes [string trimright [lindex [split $text] 5] .]] [string trimright [lindex [split $text] end] .] :You're using someone else's access"
unset whyed([string tolower [lindex [split $text] 0]])
}
proc stripcodes {str} {
regsub -all -- {\003[0-9]{0,2}(,[0-9]{0,2})?|\017|\037|\002|\026|\006|\007} $str "" str
return $str
}
|
_________________ ·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
================================== |
|
| Back to top |
|
 |
|