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.

Kick specific user on word

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Maybe look at other scripts to see how pub binds are done. And as far as channels, look at how other scripts add channel support (you can make a list of channels in the script, and the use lsearch to see if the current channel matches, or you can use the channel udef flags).. And as far as the warning stuff, take a look at the badchan script by mc_8 that's in the archive.
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Does this look somewhat correct?

Code: Select all

bind pub n .addnick pub:addnick 

proc pub:addnick {nick uhost hand chan arg} {
set chan [string tolower $chan]
}
Just a part of the script.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Code: Select all

# channels we allow public use in:
set dreamchans "#mychan #chan2 #etc"

# out of the above channels, these will only respond by PRIVMSG:
set dreamquiet "#chan2 #etc"

bind pub - .dream dreamproc
bind msg - .dream dreammsg

proc dreammsg {nick uhost hand text} {
        if {![onchan $nick]} {return}
        dreamproc $nick $uhost $hand privmsg $text
        return
}

proc dreamproc {nick uhost hand chan text} {
        if {([lsearch -exact $::dreamchans $chan] == -1) && ($chan != "privmsg")} {return}
        if {([lsearch -exact $::dreamquiet $chan] != -1) || ($chan == "privmsg")} {set chan $nick}
partial example
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

I appriciate the help, but I am so lost here, would it be possible that you would make the complete script or is that to much to ask?
If so then im sorry for not being able to read me out of this.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

There's enough info to figure this out on your own. All you'd be doing is adding the above example of checking the channels from the lists, to your pub and msg proc's from the examples shown by sir_fz.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Example

Code: Select all

bind pub n .addnick [list addtolist nicklist]

proc addtolist {t nick uhost hand chan arg} {
 upvar $t list
 if {[lsearch -exact $list [string tolower $arg]] == -1} {
  lappend list [string tolower $arg]
  puthelp "notice $nick :Successfully added $arg to $t."
 } {
  puthelp "notice $nick :$arg already exists in $t."
 }
}
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

Okay, I think I have been looking for too long at the wwrong script, but finally im getting it, and I tested it and it works perfectly, thank you so much for putting up with my n00bness.

Now, is there anyway of making it react on the added word no matter what place it has in a line?
Like:
Badword: test
User type: this is a test

Cause now it works only if the badword is the first word.
Hope this is not to much to ask.
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Post by starpossen »

I know bumping is annoying, but I was just hoping for someone to reply to my above post.
Post Reply