Seite 1 von 1

broadcast script

Verfasst: 13.01.2005, 21:32
von pandorra
hi,
hab neulich mal zeit gefunden, meinen windrop neu zu machen...
hab ein broadcast script eingebaut, allerdings funzt es nicht so wie es soll, bzw. es funzt so wie es soll, ich will es aber anders ;)
mein problem ist, dass bei broadcasts immer der nick von dem user vorrangesetzt wird, der den befehl ausgelöst hat...
bsp
(l-casei-yuckfou) [|glp|paNdorrA] -rehash-
sollte aber so aussehen
(l-casei-yuckfou) (broadcast) -rehash-

Code: Alles auswählen

proc pub_lol_broadcast {nick host hand chan arg} {
	set arg [charfilter $arg]
	global lol botnick
	if {![check $hand $nick $host]} {
		if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
                puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
		return 0
	}
	if {[llength $arg] < 1} {
		puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]broadcast <text>"
		return 0
	}
	foreach c [channels] {
		if {[matchattr $hand o|o $c] && [strlwr $c] != [strlwr $chan]} {
			if {$lol(color) == 1} {
				puthelp "PRIVMSG $c :\00314\[\003\002$nick\002\00314\]\003 $arg"
			} {
				puthelp "PRIVMSG $c :\[\002$nick\002\] $arg"
			}
		}
	}
}
ich find aber nichts, was meinen nick vorransetzt, bzw ich finde in dem code erst gar nichts, was überhaupt einen broadcast auslöst...
vlt bin ich blind, aber seh da nur if abfragen O_o

Verfasst: 14.01.2005, 11:35
von Haekelschwester
versuch ggf. mal das hier



bind pub n|n !broadcast pub:broadcast


proc pub:broadcast {nick uhost hand chan text} {
if {[string length $text] > 0} {
set text [string trim $text "{}"]
foreach n [channels] { puthelp "PRIVMSG $n :$text" }
} else { puthelp "NOTICE $nick :!broadcast <message> - sends message to all channels that the bot is" }
}

Verfasst: 14.01.2005, 18:42
von pandorra
jo, oder so, thx....
muss ich im anderen halt bissel auskommentieren....