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.

Tag Script

Support & discussion of released scripts, and announcements of new releases.
Post Reply
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Tag Script

Post by Football »

Hey, using this tag script to voice users using tags.

Was wondering if someone could improve it so I can add/remove tags via pubmsg?
Thanks

Code: Select all

setudef flag tagvoice 
bind join - {% ARG|*} voice:user 
bind nick - {% ARG|*} voice:user 
bind join - {% COL|*} voice:user 
bind nick - {% COL|*} voice:user 
bind join - {% CRC|*} voice:user 
bind nick - {% CRC|*} voice:user 
bind join - {% BOL|*} voice:user 
bind nick - {% BOL|*} voice:user 
bind join - {% BRA|*} voice:user 
bind nick - {% BRA|*} voice:user 
bind join - {% PAR|*} voice:user 
bind nick - {% PAR|*} voice:user 
bind join - {% URU|*} voice:user 
bind nick - {% URU|*} voice:user 
bind join - {% PER|*} voice:user 
bind nick - {% PER|*} voice:user 
bind join - {% VEN|*} voice:user 
bind nick - {% VEN|*} voice:user 
bind join - {% MEX|*} voice:user 
bind nick - {% MEX|*} voice:user 
bind join - {% ECU|*} voice:user 
bind nick - {% ECU|*} voice:user 
bind join - {% CHI|*} voice:user 
bind nick - {% CHI|*} voice:user 




bind nick - * devoice:user 

proc voice:user {nick uhost hand chan {nn ""}} { 
 if { ![channel get $chan tagvoice] } { return 0 } 
 if {$nn == ""} {set nn $nick} 
 if {![isvoice $nn $chan]} { 
  pushmode $chan +v $nn 
 } 
} 

proc devoice:user {nick uhost hand chan nn} { 
 if { ![channel get $chan tagvoice] } { return 0 } 
 if {![string match -nocase ARG|* $nn] && ![string match -nocase BRA|* $nn] && ![string match -nocase PAR|* $nn] && ![string match -nocase CHI|* $nn] &&  ![string match -nocase ECU|* $nn] &&  ![string match -nocase MEX|* $nn] &&  ![string match -nocase VEN|* $nn] && ![string match -nocase PER|* $nn] && ![string match -nocase URU|* $nn] && ![string match -nocase CRC|* $nn] && ![string match -nocase COL|* $nn] && ![string match -nocase BOL|* $nn] && [isvoice $nn $chan]} { 
  pushmode $chan -v $nn 
} 
 } 
Idling at #Football, Quakenet.
F
Football
Master
Posts: 205
Joined: Fri Dec 26, 2008 3:08 pm
Location: Quakenet, #Football

Post by Football »

Anyone ? Please?
Idling at #Football, Quakenet.
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

Didnt tested but if you encounter errors please let me know and i will fix them

Code: Select all

#### ++++ 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"
a
angel1092
Voice
Posts: 1
Joined: Mon Oct 13, 2014 12:41 am

Post by angel1092 »

I cant really test the script because i don`t have 'package require ip' installed on the server but i looked in the script and the first check of ::ripecheck::maskarray is when it checks this file "scripts/iplist.txt".
Post Reply