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 

script request
Goto page 1, 2  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Wed Apr 20, 2005 11:44 pm    Post subject: script request Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Apr 21, 2005 9:22 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Sat Apr 23, 2005 11:03 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Apr 23, 2005 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Sat Apr 23, 2005 7:49 pm    Post subject: Reply with quote

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 {![..."
    (file "scripts/deop.tcl" line 13)
    invoked from within
"source scripts/deop.tcl"

_________________
!~!~!~!~!~ ::Long Live The REpubLic ::~!~!~!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
^DooM^
Owner


Joined: 26 Aug 2003
Posts: 772
Location: IronForge

PostPosted: Sat Apr 23, 2005 8:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Apr 23, 2005 9:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Sun Apr 24, 2005 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 24, 2005 8:46 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Sun Apr 24, 2005 9:54 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 24, 2005 11:12 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Sun Apr 24, 2005 11:57 pm    Post subject: Reply with quote

now i got this error ..

Code:
Tcl error [nick:whyed]: invalid command name "stripcodes"

_________________
!~!~!~!~!~ ::Long Live The REpubLic ::~!~!~!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Apr 25, 2005 12:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
pakistani1
Voice


Joined: 20 Apr 2005
Posts: 26
Location: Pakistan Zindabad

PostPosted: Mon Apr 25, 2005 1:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Mon Apr 25, 2005 1:26 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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