EDIT: No more trouble with spaces and [] in playernames *facepalm*
- {l Code}: {l Select All Code}
// tell scipt by Bonifarz:
// Creates aliases with tab-completion
// for chat messages starting with a playername.
chatcolour = (concatword "^f[" $playercolour "]")
tellnames = ""
tellupdate = [
echo "executing /tellupdate, current player aliases:"
looplist tt $tellnames [
setcomplete $tt 0
]
tellnames = ""
loop i $serverclients [
if (! (isai $i)) [
t = (getclientname $i)
if (strlen $t) [
tt = (concatword "tell_" $t)
tt = (strreplace $tt "[" "_")
tt = (strreplace $tt "]" "_")
tt = (strreplace $tt " " "_")
$tt = [ saycommand $chatcolour @t," "]
append tellnames $tt
setcomplete $tt 1
echo $tt
]
]
]
]
setcomplete "tellupdate" 1
tellupdate