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.

Need to port over a script from mirc to tcl

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
janipewter
Voice
Posts: 16
Joined: Sun Jan 22, 2006 8:59 pm

Need to port over a script from mirc to tcl

Post by janipewter »

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: Select all

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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]]
 }
}
j
janipewter
Voice
Posts: 16
Joined: Sun Jan 22, 2006 8:59 pm

Post by janipewter »

Thanks very much :)

What about making it only work on #cows for example?
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

add

Code: Select all

if {![string equal -nocase #cows $chan]} {return 0}
to the procs.
j
janipewter
Voice
Posts: 16
Joined: Sun Jan 22, 2006 8:59 pm

Post by janipewter »

You are awesome.

Thanks so much.
Post Reply