Hexchat Lua question reddit / irc ---------------------------------------------------------------------- Drachenwulf · 2022-02-22 14:58 a while back I asked a question about a script option to set a channel of mine to mode +s in hexchat. the script seems to work but only sometimes. does anyone know why the script would not work every time I connect? hexchat.register("onJOIN.lua", "1.0", "Run commands automatically after joining channels") hexchat.hook\_server("JOIN", function (word, word\_eol) local channel channel = hexchat.get\_info("channel") if channel == "#ProgramableDolls" then hexchat.command("mode +s") end return hexchat.EAT\_NONE end) ---------------------------------------------------------------------- ProgVal · 2022-02-23 21:54 I don't know for sure, but here is my guess. You need to be a channel op to change modes. If you are opped by a bot, the bot probably ops you just after you join the channel, and this script tries to set a mode at the same time. If your script is faster, it fails. If it is slower than the bot, then it succeeds. Or maybe you don't have a bot to op you, so the script only succeeds when you join an empty channel (because you are always opped automatically when doing so) ---------------------------------------------------------------------- Drachenwulf · 2022-02-23 23:14 So what can I try to do to fix this? ---------------------------------------------------------------------- ProgVal · 2022-02-24 08:15 In the first case, either add a timer (a couple of seconds should be enough) or trigger it on `MODE` events when someone ops you. In the second case, you need to find a way to be auto-opped when joining the channel. You'll need to have a bot on the channel to do it. Most networks offer such a bot service, usually called ChanServ.