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 

Kick specific user on word
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Dec 17, 2006 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Mon Dec 18, 2006 4:03 am    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Dec 18, 2006 7:00 am    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Thu Dec 21, 2006 12:09 am    Post subject: Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu Dec 21, 2006 7:37 pm    Post subject: Reply with quote

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


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Dec 21, 2006 8:36 pm    Post subject: Reply with quote

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


Joined: 10 Jan 2006
Posts: 139

PostPosted: Fri Dec 22, 2006 4:10 am    Post subject: Reply with quote

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
View user's profile Send private message
starpossen
Op


Joined: 10 Jan 2006
Posts: 139

PostPosted: Fri Jan 12, 2007 7:15 pm    Post subject: Reply with quote

I know bumping is annoying, but I was just hoping for someone to reply to my above post.
Back to top
View user's profile Send private message
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 Previous  1, 2
Page 2 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