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 

TAG Voice

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Madalin
Master


Joined: 24 Jun 2005
Posts: 310
Location: Constanta, Romania

PostPosted: Wed Feb 06, 2013 9:52 am    Post subject: TAG Voice Reply with quote

Code:

#### ++++ Author: MadaliN <madalinmen28@yahoo.com>
### +++ Script name: TAG Voice
## +++ Version 1.0 (2/6/2013)
# Commands
#   !tagvoice -add
#   !tagvoice -del
#   !tagvoice -list
#
# You have to use .chanset #channel +tagvoice so that the script will work

bind PUB n !tagvoice tagvoice:pub
bind JOIN - * tagvoice:join

setudef flag tagvoice

proc tagvoice:join {nick uhost hand chan} {
   global tagvoice

   if {[channel get $chan tagvoice] && [info exists tagvoice]} {
      foreach n [array names tagvoice] {
         if {[string match -nocase "$n*" $nick]} {
            pushmode $chan +v $nick

            putserv "PRIVMSG $chan :tag found.."
         }
      }
   }
}

proc tagvoice:pub {nick uhsot hand chan arg} {
   global tagvoice

   switch -exact -- [lindex [split $arg] 0] {
      add -
      -add {
         if {[lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You have to specify a TAG name"; return }

         set tagvoice([lindex [split $arg] 1]) "[unixtime]"
         tagvoice:save

         putserv "PRIVMSG $chan :\002$nick\002 - You succesfully saved TAG \00312[lindex [split $arg] 1]"
      }
      del -
      -del {
         if {[lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You have to specify a TAG name"; return }
         if {![info exists tag([lindex [split $arg] 1])]} { putserv "PRIVMSG $chan :\002$nick\002 - TAG \00304[lindex [split $arg] 1]\003 doesnt exists"; return }

         unset -nocomplain tagvoice([lindex [split $arg] 1])
         tagvoice:save

         putserv "PRIVMSG $chan :\002$nick\002 - You succesfully erased TAG \00304[lindex [split $arg] 1]"
      }
      list -
      -list {
         if {![info exists tagvoice]} { putserv "PRIVMSG $chan :\002$nick\002 - There is no TAG added"; return }

         set list ""

         foreach n [array names tagvoice] { lappend list $n }

         putserv "PRIVMSG $chan :\002$nick\002 - TAG list: [join $list ", "]"
      }
   }
}

proc tagvoice:save {} {
   global tagvoice

   set ofile [open tagvoice w]
   puts $ofile "array set tagvoice [list [array get tagvoice]]"
   close $ofile
}

catch {source tagvoice}

putlog "+++ Succesfully loaded: \00312TAG Voice TCL Script"

_________________
https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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