WeChall - 2021 Christmas Gifts

Challenge

题目要求提交一段 KVIrc script,向当前加入的所有 IRC channels 发送一条消息。

Solution

KVIrc 把每个 IRC channel 表示为一个 window。$window.list(channel,all) 可以枚举所有 IRC contexts 中的 channel windows;foreach 依次取出每个 window ID。say-r=<window_id> 参数把命令 rebind 到指定窗口,于是同一条消息会在每个 channel 中发送一次。

foreach (%x,$window.list(channel,all)) say -r=%x Merry Christmas!