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 

Simple TCL Script
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
kevie
Voice


Joined: 10 Jun 2003
Posts: 12

PostPosted: Tue Jun 10, 2003 3:49 am    Post subject: Simple TCL Script Reply with quote

Hi, i would like to know how could i get a simple tcl script which enables the eggdrop to voice the user when he say certain line in the channel?
Back to top
View user's profile Send private message
mortician
Voice


Joined: 22 Sep 2002
Posts: 37
Location: Tsjakamaka

PostPosted: Tue Jun 10, 2003 3:58 am    Post subject: Reply with quote

Use a pubm bind
Code:

set line "line to say"
bind pubm - "*$line*" voiceUser
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
}

_________________
It is a mistake to think you can solve any major problems just with potatoes.
Back to top
View user's profile Send private message Visit poster's website
kevie
Voice


Joined: 10 Jun 2003
Posts: 12

PostPosted: Tue Jun 10, 2003 4:15 am    Post subject: Reply with quote

How do i add a reply to the user who was voiced?
Something like this? :
#puthelp "PRIVMSG $nick :you have been voiced in $chan"
Back to top
View user's profile Send private message
mortician
Voice


Joined: 22 Sep 2002
Posts: 37
Location: Tsjakamaka

PostPosted: Tue Jun 10, 2003 4:34 am    Post subject: Reply with quote

yup (if you remove that # off course Wink)
Oh, and the channel parameter in my proc is $channel and not $chan ...
_________________
It is a mistake to think you can solve any major problems just with potatoes.
Back to top
View user's profile Send private message Visit poster's website
kevie
Voice


Joined: 10 Jun 2003
Posts: 12

PostPosted: Tue Jun 10, 2003 5:01 am    Post subject: Reply with quote

Thanks so much. Just wonder how could i add a timer to it? like if the voiced user did not say the "something" within 30mins, it will devoice them.
Back to top
View user's profile Send private message
ReaLz
Op


Joined: 19 Oct 2002
Posts: 121
Location: Athens, Greece

PostPosted: Tue Jun 10, 2003 5:47 am    Post subject: Reply with quote

heh..... check this:

Code:
## Settings
set line "line to say"
set phrase "phrase to say not to be devoiced"
set channel "#channel"

## Binds
bind pubm - "*$line*" voiceUser
bind time - "00 * * * *" time_proc
bind time - "30 * * * *" time_proc
bind pubm - "*$phrase" saveUser

## Code
proc voiceUser {nick uhost hand channel rest} {
putserv "MODE $channel +v :$nick"
puthelp "NOTICE $nick :You've just been voiced, remember to say $phrase in 30 minutes to avoid getting devoiced"
return
}

proc time_proc {min hour day month year} {check_word}

proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
return
}
pushmode $::channel -v $user
}
}
}

proc saveUser {nick chan hand idx args} {
if {[validuser $hand]} {
chattr $hand +S
return
}
adduser $nick
chattr $nick +S
}

_________________
«A fantastic spaghetti is a spaghetti that does not exist»
Back to top
View user's profile Send private message Send e-mail
kevie
Voice


Joined: 10 Jun 2003
Posts: 12

PostPosted: Tue Jun 10, 2003 7:18 am    Post subject: Reply with quote

ReaLz, I have no prob with those lines concerning the voicing of users saying the line, but the bot wun devoice them when they didnt repeat that line for more than 30 minutes. Surprised
Back to top
View user's profile Send private message
ReaLz
Op


Joined: 19 Oct 2002
Posts: 121
Location: Athens, Greece

PostPosted: Tue Jun 10, 2003 7:57 am    Post subject: Reply with quote

uhm yes you're right...

change the time_proc with this:

proc time_proc {min hour day month year} {check_word}

proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
}
}
}
_________________
«A fantastic spaghetti is a spaghetti that does not exist»
Back to top
View user's profile Send private message Send e-mail
ReaLz
Op


Joined: 19 Oct 2002
Posts: 121
Location: Athens, Greece

PostPosted: Tue Jun 10, 2003 7:58 am    Post subject: Reply with quote

uhm yes you're right...

change the time_proc with this:

Code:
proc time_proc {min hour day month year} {check_word}

proc check_word {} {
if {![botisop $::channel]} {
putlog "I'm not oped in $::channel."
}
foreach user [chanlist $::channel] {
if {[isvoice $user $::channel]} {
set hand [nick2hand $user]
if {[matchattr $hand S]} {
chattr $hand -S
return
}
pushmode $::channel -v $user
}
}
}

_________________
«A fantastic spaghetti is a spaghetti that does not exist»
Back to top
View user's profile Send private message Send e-mail
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 8:00 am    Post subject: Reply with quote

Please avoid repeating/posting the same topic. Razz
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
ReaLz
Op


Joined: 19 Oct 2002
Posts: 121
Location: Athens, Greece

PostPosted: Tue Jun 10, 2003 8:01 am    Post subject: Reply with quote

oops.. I clicked the Back button Razz
_________________
«A fantastic spaghetti is a spaghetti that does not exist»
Back to top
View user's profile Send private message Send e-mail
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 9:08 am    Post subject: Reply with quote

btw, after the:
Quote:

putlog "I'm not oped in $::channel."

you should add a return cos as far as I can see it continues the proc after the putlog.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
kevie
Voice


Joined: 10 Jun 2003
Posts: 12

PostPosted: Tue Jun 10, 2003 9:13 am    Post subject: Reply with quote

It works now! Bravo. Anyway, can i put a puthelp "NOTICE $nick :you've been devoiced..." on it after the bot devoiced the user?
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3740
Location: Mint Factory

PostPosted: Tue Jun 10, 2003 9:19 am    Post subject: Reply with quote

Give it a try. I'm shure it won't bite you. Smile
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
kevie
Voice


Joined: 10 Jun 2003
Posts: 12

PostPosted: Tue Jun 10, 2003 10:09 am    Post subject: Reply with quote

seems like i ended up with more errors,
Tcl error [time_proc]: can't read "nick": no such variable
Can anyone help me out with that?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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