| View previous topic :: View next topic |
| Author |
Message |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sun Dec 17, 2006 8:06 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Mon Dec 18, 2006 4:03 am Post subject: |
|
|
Does this look somewhat correct?
| Code: |
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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Mon Dec 18, 2006 7:00 am Post subject: |
|
|
| Code: |
# 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 |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Thu Dec 21, 2006 12:09 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Thu Dec 21, 2006 7:37 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Dec 21, 2006 8:36 pm Post subject: |
|
|
Example
| Code: | 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."
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Fri Dec 22, 2006 4:10 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
starpossen Op
Joined: 10 Jan 2006 Posts: 139
|
Posted: Fri Jan 12, 2007 7:15 pm Post subject: |
|
|
| I know bumping is annoying, but I was just hoping for someone to reply to my above post. |
|
| Back to top |
|
 |
|