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.

!xadd nickname

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Ashoq
Voice
Posts: 11
Joined: Sat Jul 17, 2010 4:35 pm

!xadd nickname

Post by Ashoq »

hi again :)
i have this TCL it works great :)
i want just add a msg when user have already access on chan

<mybot> User has already access on chan as level $level

Code: Select all

bind pub m !xadd xadd

proc xadd {nick uhost hand chan arg} {

   set who [lindex $arg 0]
        set level "100"

   if {![llength $who]} {puthelp "notice $nick :SYNTAX: !xadd nick "; return}

      puthelp "privmsg X :adduser $chan =$who $level"
      puthelp "privmsg X :modinfo $chan automode =$who op"
      puthelp "privmsg $chan :ADDED $who to $chan with access level $level"
}
10x alot
User avatar
Madalin
Master
Posts: 310
Joined: Fri Jun 24, 2005 11:36 am
Location: Constanta, Romania
Contact:

Post by Madalin »

You can try this version. I didnt test the script but it has no errors in the code. Yet if you encouter some problems you can reply here and ill modify the code and test it.

Code: Select all

bind pub m !xadd x:add
bind notc - * x:notc

proc x:add {nick uhost hand chan arg} {
	global temp

	set temp(chan) $chan
	set temp(user)  [lindex [split $arg] 0]
	set temp(level) [lindex [split $arg] 1]

	if {($temp(user) == "") || ($temp(level) == "")} {putserv "PRIVMSG $chan :4XADD:2 Comanda de folosire este 7» 4!xadd <nick> <nivel> 7«"; return}

	putserv "PRIVMSG X :adduser $chan =$temp(user) $temp(level)"
	utimer 5 [list x:say $chan $temp(user) $temp(level)]
}

proc x:say {chan user level} {
	global temp

	if {![info exists temp(stop)]} {
		putserv "PRIVMSG $chan :4XADD:2 L-am adaugat pe 7» 04$user 7«2 pe canalul 7» 04$chan 7«2 cu access la X de nivel 7» 04$level 7« "
		unset -nocomplain temp(stop)
	}
}

proc x:notc {nick uhost hand arg dest} {
	global temp

	switch -exact -- $nick {
		"X" {
			if {[string match -nocase "*is already added*" $arg]} {
				putserv "PRIVMSG $temp(chan) :\002$temp(user)\002 is already added with X access on \00312$temp(chan)"
				set temp(stop) da
			}
		}
	}
}
Post Reply