| View previous topic :: View next topic |
| Author |
Message |
janipewter Voice
Joined: 22 Jan 2006 Posts: 16
|
Posted: Thu Feb 16, 2006 12:20 pm Post subject: Need to port over a script from mirc to tcl |
|
|
Currently I've got a kind-of news script being run from a mirc bot, but I wanted to put it on my eggdrop instead. Anyone know the equivelant in tcl language?
| Code: | on *:text:!news:#: { /msg $chan News: %news }
on *:TEXT:!setnews*:#:if ($nick isop $chan) { /set %news $2- } |
Bascially an op can do !setnews <news> and the bot remembers it, and then anyone can do !news and it will relay News: <whatever op has set>
Thanks, Jani. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Feb 16, 2006 12:34 pm Post subject: |
|
|
| Code: | set news "no news set"
bind pub - !news news
bind pub - !setnews setnews
proc news {nick uhost hand chan arg} {
puthelp "privmsg $chan :News: $::news"
}
proc setnews {nick uhost hand chan arg} {
if {[isop $nick $chan]} {
set ::news [join [lrange [split $arg] 0 end]]
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
janipewter Voice
Joined: 22 Jan 2006 Posts: 16
|
Posted: Thu Feb 16, 2006 12:43 pm Post subject: |
|
|
Thanks very much
What about making it only work on #cows for example? |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Thu Feb 16, 2006 12:49 pm Post subject: |
|
|
add
| Code: | | if {![string equal -nocase #cows $chan]} {return 0} |
to the procs. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
janipewter Voice
Joined: 22 Jan 2006 Posts: 16
|
Posted: Thu Feb 16, 2006 12:51 pm Post subject: |
|
|
You are awesome.
Thanks so much. |
|
| Back to top |
|
 |
|