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 

Very simple script

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


Joined: 12 Mar 2009
Posts: 4

PostPosted: Thu Mar 12, 2009 9:54 am    Post subject: Very simple script Reply with quote

I have no clue how to write this Sad i know it's a very simple script though.

All i need it to do is if i type a command like !release (text here) it will make the eggdrop take whatever text after !release and display it in another channel of my choosing.
Back to top
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Thu Mar 12, 2009 11:17 am    Post subject: Reply with quote

Code:
# !release cmd channels
set bcast_cmd_chans {#channel1 #channel2}

# target channel
set bcast_chan "#channel"

#############################################
bind pub -|- !release do_bcast

proc do_bcast { nick uhost hand chan arg } {
   global bcast_chan bcast_cmd_chans

   if {[lsearch $bcast_cmd_chans $chan] == -1} {
      return
   }

   if {[botonchan $bcast_chan]} {
      putserv "PRIVMSG $bcast_chan :$arg"
   }
}

putlog "release.tcl loaded"


test it
Back to top
View user's profile Send private message Visit poster's website
Kemikals
Voice


Joined: 12 Mar 2009
Posts: 4

PostPosted: Thu Mar 12, 2009 2:25 pm    Post subject: Reply with quote

you my sir Smile are my hero works like a charm!!!
Back to top
View user's profile Send private message
Kemikals
Voice


Joined: 12 Mar 2009
Posts: 4

PostPosted: Thu Mar 12, 2009 5:05 pm    Post subject: Reply with quote

thanks

Last edited by Kemikals on Thu Mar 12, 2009 5:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
tomekk
Master


Joined: 28 Nov 2008
Posts: 255
Location: Oswiecim / Poland

PostPosted: Thu Mar 12, 2009 5:26 pm    Post subject: Reply with quote

try:
Code:
namespace eval newp {
   variable bcast_cmd_chans
   variable bcast_chan

   # !new cmd channels
   set bcast_cmd_chans {#chan #chan2}

   # target channel
   set bcast_chan "#chan"

   #############################################
   bind pub -|- !new [namespace current]::do_bcast

   proc ::newp::do_bcast { nick uhost hand chan arg } {
      variable bcast_cmd_chans
                                variable bcast_chan

      if {[lsearch $bcast_cmd_chans $chan] == -1} {
         return
      }

      if {[botonchan $bcast_chan]} {
         putserv "PRIVMSG $bcast_chan :$arg"
      }
   }

   putlog "release.tcl loaded"
}


2nd:
Code:
namespace eval upp {
   variable bcast_cmd_chans
   variable bcast_chan

   # !up cmd channels
   set bcast_cmd_chans {#chan #chan2}

   # target channel
   set bcast_chan "#chan"

   #############################################
   bind pub -|- !up [namespace current]::do_bcast

   proc ::upp::do_bcast { nick uhost hand chan arg } {
      variable bcast_cmd_chans
                                variable bcast_chan

      if {[lsearch $bcast_cmd_chans $chan] == -1} {
         return
      }

      if {[botonchan $bcast_chan]} {
         putserv "PRIVMSG $bcast_chan :$arg"
      }
   }

   putlog "release.tcl loaded"
}


anyway, this should be all in one script
and btw. don't tell me that script is for some warez?


Last edited by tomekk on Thu Mar 12, 2009 5:58 pm; edited 3 times in total
Back to top
View user's profile Send private message Visit poster's website
Kemikals
Voice


Joined: 12 Mar 2009
Posts: 4

PostPosted: Thu Mar 12, 2009 5:33 pm    Post subject: Reply with quote

Thanks Smile and no
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