| View previous topic :: View next topic |
| Author |
Message |
Fiby Voice

Joined: 23 Feb 2008 Posts: 7 Location: Spain
|
Posted: Sat Feb 23, 2008 1:36 pm Post subject: helpe to finish. |
|
|
need a script that pics randomly a nick from my channel userlist and sends it a message.
| Code: |
set messg "here put my message"
set mychanlist [chanlist #madrid]
set randomnick [lindex $mychanlist [rand [llength $mychanlist]]]
putmsg "PRIVMSG $randomnick : $messg"
|
this code its good? or not? o how it's?
 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Feb 23, 2008 1:50 pm Post subject: |
|
|
You didn't specify when do you want this message to be sent, however this is your code edited to make your bot send the message on public command !randmsg:
| Code: | set randmessg "here put my message"
bind pub - !randmsg send:randmsg
proc send:randmsg {nick uhost hand chan arg} {
global randmessg
set mychanlist [chanlist $chan]
set randomnick [lindex $mychanlist [rand [llength $mychanlist]]]
puthelp "PRIVMSG $randomnick :$randmessg"
} |
Edit: Changed putmsg to puthelp. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts
Last edited by Sir_Fz on Sat Feb 23, 2008 2:50 pm; edited 2 times in total |
|
| Back to top |
|
 |
Fiby Voice

Joined: 23 Feb 2008 Posts: 7 Location: Spain
|
Posted: Sat Feb 23, 2008 2:09 pm Post subject: |
|
|
sssssmmmmmmuuuuuaaaaaaaaakkkkkkksssssssssss ;*****
thanks Sir_Fz
 |
|
| Back to top |
|
 |
|