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.

script request

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

script request

Post by pakistani1 »

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 ::~!~!~!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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]])
}
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

Post by pakistani1 »

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 ::~!~!~!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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.
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

Post by pakistani1 »

i got this error

Code: Select all

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 {![..."
    (file "scripts/deop.tcl" line 13)
    invoked from within
"source scripts/deop.tcl"
!~!~!~!~!~ ::Long Live The REpubLic ::~!~!~!
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

change this

Code: Select all

if {![string equal -nocase [lindex [split $text] 0] [string trimright [lindex [split $text] end] .]]}
to this

Code: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

missing close-brace
add a } at the end of the proc.

Code: Select all

 ........
 unset whyed([string tolower [lindex [split $text] 0]]) 
 }
}
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

Post by pakistani1 »

Code: Select all

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

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 ::~!~!~!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

forgot to set anything to whyed(nick), this should fix it:

Code: Select all

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

Post by awyeah »

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.
==================================
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

Post by pakistani1 »

now i got this error ..

Code: Select all

Tcl error [nick:whyed]: invalid command name "stripcodes"
!~!~!~!~!~ ::Long Live The REpubLic ::~!~!~!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

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

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.
==================================
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

Post by pakistani1 »

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

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

Tcl error [nick:whyed]: wrong # args: should be "stripcodes str"
!~!~!~!~!~ ::Long Live The REpubLic ::~!~!~!
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well you had to change the input variables in the main proc for stripcodes. Here use this:

Code: Select all

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.
==================================
Post Reply