| View previous topic :: View next topic |
| Author |
Message |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Tue Aug 09, 2005 6:09 am Post subject: Pub Voiceme script |
|
|
Hi guys,
I searched the archive for the script in the topic and found voiceme.tcl by Silviu. However I think it's limited to only 1 channel. Can it be edited to include more than 1? Also, is this script secure to be allowed for pub? Thanks
| Code: | set vchan #channel
bind msg - voiceme msg:voiceme
proc msg:voiceme { nick host hand text } {
global vchan
global botnick
if {![onchan $nick $vchan]} {
puthelp "NOTICE $nick :I do not see you on $vchan"
return 0
}
if {[isvoice $nick $vchan]} {
puthelp "NOTICE $nick :You already have +v on $vchan. If you do not need use /msg $botnick devoiceme"
return 1
}
pushmode $vchan +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
return 1
} |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Aug 09, 2005 6:58 am Post subject: |
|
|
| Code: | set vchans "#channel #channel2"
bind msg - voiceme msg:voiceme
proc msg:voiceme { nick host hand text } {
global vchans botnick
foreach vchan [split $vchans] {
if {![onchan $nick $vchan]} {
puthelp "NOTICE $nick :I do not see you on $vchan"
continue
}
if {[isvoice $nick $vchan]} {
puthelp "NOTICE $nick :You already have +v on $vchan. If you do not need use /msg $botnick devoiceme"
continue
}
pushmode $vchan +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
}
return 1
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Tue Aug 09, 2005 9:02 am Post subject: |
|
|
Hey Sir_Fz
Thanks for the prompt reply. It's all good except it assumes that the user is on both channels. So if the user is only on #channel, he'll receive the message: "I do not see you on #channel2"
Is there anyway to make the bot scan which channels the user is on and then voice him in that channel without noticing him that he is not on the other channels in the script? Or do I need to bind another keyword like voiceme2? |
|
| Back to top |
|
 |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Tue Aug 09, 2005 9:52 am Post subject: |
|
|
Ok. I played around and this seemed to work.
| Code: |
set vchan1 #channel1
set vchan2 #channel2
##### Channel 1 #####
bind msg - voiceme1 msg:voiceme1
proc msg:voiceme1 { nick host hand text } {
global vchan1
global botnick
if {![onchan $nick $vchan1]} {
puthelp "NOTICE $nick :I do not see you on $vchan1"
return 0
}
if {[isvoice $nick $vchan1]} {
puthelp "NOTICE $nick :You already have +v on $vchan1. If you do not need use /msg $botnick devoiceme1"
return 1
}
pushmode $vchan1 +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
return 1
}
##### Channel 2 #####
bind msg - voiceme2 msg:voiceme2
proc msg:voiceme2 { nick host hand text } {
global vchan2
global botnick
if {![onchan $nick $vchan2]} {
puthelp "NOTICE $nick :I do not see you on $vchan2"
return 0
}
if {[isvoice $nick $vchan2]} {
puthelp "NOTICE $nick :You already have +v on $vchan2. If you do not need use /msg $botnick devoiceme2"
return 1
}
pushmode $vchan2 +v $nick
puthelp "NOTICE $nick :Have fun and enjoy your stay here"
return 1
} |
One question I have is, is it possible to bind 2 trigger wrods to one command? For example:
| Code: | | bind msg - vm #channel1 msg:voiceme1 |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Aug 09, 2005 10:02 am Post subject: |
|
|
Use
| Code: | | bind msgm - "vm #channel1 *" msg:voiceme1 |
This way the channel name is [lindex [split $arg] 1]. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
sarius Voice
Joined: 05 Aug 2005 Posts: 20
|
Posted: Tue Aug 09, 2005 10:58 am Post subject: |
|
|
Dude! It worked!
Thanks muchos!  |
|
| Back to top |
|
 |
|