bind pub -|- !uac pub:uac
proc pub:uac {nick host hand chan text} {
if {![string match [string tolower $chan] "#clanbase.crew.mw2"]} {
return 0
}
if {[llength $text] == 0} {
putserv "MODE #clanbase.mw2 -c"
putserv "PRIVMSG #clanbase.mw2 :** NOTICE ** The gamecrew can provide limited support for UAC2, if you are having problems please visit: http://uac2.com/forums/ and wait for a UAC2 admin to respond to your issue."
putserv "MODE #clanbase.mw2 +c"
} else {
set target [lindex [split $text] 0]
putserv "MODE #clanbase.mw2 -c"
putserv "PRIVMSG #clanbase.mw2 :** NOTICE FOR $target ** The gamecrew can only provide limited support for UAC2, if you are having problems please visit: http://uac2.com/forums/ and wait for a UAC2 admin to respond to your issue."
putserv "MODE #clanbase.mw2 +c"
}
}
You will notice that this script sends a message to the client channel (#clanbase.mw2) then someone in the admin channel (#clanbase.crew.m2) says !uac UserName. However I would like to extend this script so that it also works in #clanbase.cod4 and #clanbase.crew.cod4, I want it to have the same message etc. however just to extend it to work in both channels.
set uac_chans "#clanbase.mw2 #clanbase.cod4 #clanbase.crew.cod4"
bind pub -|- !uac pub:uac
proc pub:uac {nick host hand chan text} {
global uac_chans
if {[lsearch "$uac_chans" "$chan"] == -1} {
return 0
}
if {[llength $text] == 0} {
pushmode $chan -c
puthelp "PRIVMSG $chan :** NOTICE ** The gamecrew can provide limited support for UAC2, if you are having problems please visit: http://uac2.com/forums/ and wait for a UAC2 admin to respond to your issue."
pushmode $chan +c
} else {
set target [lindex [split $text] 0]
pushmode $chan -c
puthelp "PRIVMSG $chan :** NOTICE FOR $target ** The gamecrew can only provide limited support for UAC2, if you are having problems please visit: http://uac2.com/forums/ and wait for a UAC2 admin to respond to your issue."
pushmode $chan +c
}
}
Thanks but I kind of think you misunderstood my problem a little. What your script will do is respond to the !uac command when it is said in any of the 4 channels however what I want it to do is for an admin to say "!uac" or "!uac nick" in of the #xxx.crew channels and for the message to display in the standard channel. For example I will say "!uac Test" in #clanbase.crew.cod4 and in #clanbase.cod4 the message "**Notice for Test** Blah Blah" will appear. My script that I posted in the first post already does this for one pair of channels however I would like to work for the other pair too. So that the messages will appear in like so
!uac Sent Here ---> Notice Displayed Here
#Clanbase.crew.mw2 ---> #clanbase.mw2
#Clanbase.crew.cod4 ---> #clanbase.cod4
bind pub -|- !uac pub:uac
proc pub:uac {nick host hand chan text} {
set c [lindex [split [string tolower $chan] #] 1]
if {([regexp -- {^(clanbase.crew.mw2|clanbase.crew.cod4|clanbase.mw2|clanbase.cod4)$} "$c"])&&([llength $text] == 0)} {
if {[string match "*.cod4" "$c"]} {
set dest "#clanbase.cod4"
} else {
set dest "#clanbase.mw2"
}
putserv "MODE $dest -c"
putserv "PRIVMSG $dest :** NOTICE ** The gamecrew can only provide limited support for UAC2, if you are having problems please visit: http://uac2.com/forums/ and wait for a UAC2 admin to respond to your issue."
putserv "MODE $dest +c"
} elseif {([regexp -- {^(clanbase.crew.mw2|clanbase.crew.cod4)$} "$c"])&&([llength $text] > 0)} {
set targets [lrange [split $text] 0 end]
if {[string match "*.crew.cod4" "$c"]} {
set dest "#clanbase.cod4"
} else {
set dest "#clanbase.mw2"
}
putserv "MODE $dest -c"
putserv "PRIVMSG $dest :** NOTICE FOR $targets ** The gamecrew can only provide limited support for UAC2, if you are having problems please visit: http://uac2.com/forums/ and wait for a UAC2 admin to respond to your issue."
putserv "MODE $dest +c"
}
}
Last edited by TCL_no_TK on Sun Jan 17, 2010 2:51 pm, edited 3 times in total.
Sorry to sound so fussy however this is still going to send the message to the channel the user types the bind in as the pushmode and pushhelp and being sent to the $chan which as we all know is set to whatever channel the bind was originally posted in. Here is what I wanted to happen:
User Types "!uac" or "!uac NICK" in #clanbase.crew.cod4 or #clanbase.crew.mw2
If channel = #clanbase.crew.cod4 Then
Send PRIVMSG (*NOTICE* BLAH BLAH) to #clanbase.cod4
If bind "!uac" has a NICK Then Send PRIVMSG (*NOTICE FOR NICK* BLAH BLAH)
If channel = #clanbase.crew.mw2 Then
Send PRIVMSG to #clanbase.mw2
If bind "!uac" has a NICK Then Send PRIVMSG (*NOTICE FOR NICK* BLAH BLAH)
Hope that kind of made it a little clearer, sorry for any inconveinience!
Not at all, dont think my brain works as well with old age now i've edited my last post anyway, hopefully this should do the trick if not you can always post again