| View previous topic :: View next topic |
| Author |
Message |
lenooxx Voice
Joined: 24 Mar 2009 Posts: 27 Location: Hungarian
|
Posted: Sat Nov 21, 2009 10:40 am Post subject: help needed |
|
|
heya , i need help , i have tried creating a script , but it dosent work for me , someone know whats wrong? Thank you
| Code: |
set urls {
"http://whaterver.com"
}
set posting_chans "*"
bind time 10 posting
proc posting {nick uhost hand chan arg} {
global urls posting_chans
foreach chan [channels] {if {(([lsearch -exact [string tolower $posting_chans] [string tolower $chan]] != -1) || ($posting_chans == "*"))} {putserv "PRIVMSG $chan :[lindex $urls [rand [llength $urls]]]"}}
} |
|
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Nov 21, 2009 11:26 am Post subject: |
|
|
I'm in a hurry, so I'm just going to comment on the binding (without checking the code inside the procedure). If you want it to execute every 10 minutes, then this is the proper binding:
| Code: | | bind time - {?0 *} posting |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
lenooxx Voice
Joined: 24 Mar 2009 Posts: 27 Location: Hungarian
|
Posted: Sat Nov 21, 2009 12:06 pm Post subject: :) |
|
|
| thank you very much ^^ |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sat Nov 21, 2009 9:45 pm Post subject: |
|
|
Also, you're using [lsearch] to search in a string (which is never recommended), $posting_chans should be a list. Wildcards in [lsearch] can only be used with -glob switch and the wildcards are specified in the third argument (the search string). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|