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.

Enabl and Disable script

Help for those learning Tcl or writing their own scripts.
Post Reply
s
starpossen
Op
Posts: 139
Joined: Tue Jan 10, 2006 1:08 am

Enabl and Disable script

Post by starpossen »

Is there anyways to make a public command for Enabling and Disabling a script?
Like example:
!scriptname on
!scriptname off

If this has already been covered in another topic, im sorry for my bad search.
d
deadite66
Halfop
Posts: 74
Joined: Mon May 30, 2005 2:49 am
Location: Great Yarmouth, UK

Post by deadite66 »

http://www.eggheads.org/support/egghtml ... mands.html

eggdrop has bind and unbind, so you could have a separate procedure to disable/re-enable a bind
<- tcl newb
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Example:

Code: Select all

setudef flag blascript

bind PUB -|- !bla pub:blascript

proc pub:blascript {nickname hostname handle channel arguments} {
  if {[string equal "on" [set type [lindex [split $arguments] 0]]]} {
    channel set $channel +blascript
  } elseif {[string equal "off" $type]} {
    channel set $channel -blascript
  } elseif {![channel get $channel blascript]} {
    return 0
  } else {
    # Do something here
  }
}
You should be able to implement something similar for your own script(s).[/code]
Post Reply