egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need to port over a script from mirc to tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
janipewter
Voice


Joined: 22 Jan 2006
Posts: 16

PostPosted: Thu Feb 16, 2006 12:20 pm    Post subject: Need to port over a script from mirc to tcl Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Feb 16, 2006 12:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
janipewter
Voice


Joined: 22 Jan 2006
Posts: 16

PostPosted: Thu Feb 16, 2006 12:43 pm    Post subject: Reply with quote

Thanks very much Smile

What about making it only work on #cows for example?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Feb 16, 2006 12:49 pm    Post subject: Reply with quote

add
Code:
if {![string equal -nocase #cows $chan]} {return 0}

to the procs.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
janipewter
Voice


Joined: 22 Jan 2006
Posts: 16

PostPosted: Thu Feb 16, 2006 12:51 pm    Post subject: Reply with quote

You are awesome.

Thanks so much.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber