EXEC Script (TCL)
Posted by Kyle
Thursday, September 29, 2005
Description: Eggdrop scripts to execute commands on any *nix variant server that can run eggdrops.


# pubexec.tcl v1.0 by Kyle

## CONFIG ##

# Path to executable
set pubexec(executable) "/path/to/executable"

# User flags required for trigger
# (Use "-" to allow all users)
set pubexec(flags) "-|-"

# Trigger
set pubexec(trigger) "!exec"

## END OF CONFIG ##

bind pub $pubexec(flags) $pubexec(trigger) pubexec:pub

proc pubexec:pub {nick uhost hand chan text} {
  global pubexec

  set data ""

  if {![file executable $pubexec(executable)]} {
    puthelp "PRIVMSG $chan :Error trying to execute $pubexec(executable)"
    return
  }

  if {[set text [string trim $text]] != ""} {
    catch {eval exec $pubexec(executable) $text} data
  } else {
    catch {exec $pubexec(executable)} data
  }
  if {[set data [string trim $data]] != ""} {
    foreach line [split $data \n] {
      puthelp "PRIVMSG $chan :$line"
    }  
  }
}

putlog "pubexec.tcl v1.0 by Kyle now loaded."

If you have any questions or requests email Kyle@InvisionGaming.net
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world