This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Fiby
Voice
Posts: 7 Joined: Sat Feb 23, 2008 11:29 am
Location: Spain
Contact:
Post
by Fiby » Sat Feb 23, 2008 1:36 pm
need a script that pics randomly a nick from my channel userlist and sends it a message.
Code: Select all
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?
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sat Feb 23, 2008 1:50 pm
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: Select all
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.
Last edited by
Sir_Fz on Sat Feb 23, 2008 2:50 pm, edited 2 times in total.
Fiby
Voice
Posts: 7 Joined: Sat Feb 23, 2008 11:29 am
Location: Spain
Contact:
Post
by Fiby » Sat Feb 23, 2008 2:09 pm
sssssmmmmmmuuuuuaaaaaaaaakkkkkkksssssssssss ;*****
thanks Sir_Fz