mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2014
Posts: 35
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Oct 2014
Posts: 35
Hey, i'm looking for a script where my bot can either message all the channels i'm currently in(/amsg doesn't work) or from a list/file. I didn't find anything on the forums/google.

Also is it possible to automatically add channels to join on startup? :P

And I do know I can create scripts manually for it but i'm wanting it to do it automatic.

Thanks smile


Matti
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Definitely.

In the scripting language, all you need to type is /join #channel to join said channel.

For instance, let's take this step by step.
1. Start mIRC.
2. You connect to the network/server you wish for
3. You join the channels.

Ideally, we would like to work with the first two events here. On Start and On Connect. Ideally, the first triggering the second.

This would look something like this in the scripting language.
This would connect you to the network Rizon and join #channel and #channel2, while also allowing you to automatically connect to different channels on Twitch, but not start the twitch connect at startup. You can use the -m addition to /server and use it to open in a new status window, that way you can open more than one connection on startup.
Code:
on 1:start: { 
server irc.rizon.net 
} 
on 1:connect: { 
if ($network == Rizon) {
nick RandomNickname
join #channel
join #channel2
}
elseif ($server == tmi.twitch.tv) {
nick RandomNickname
join #channel
join #channel2
}
}
But here's the catch, this list of channels to join is static and hardcoded, which is what you don't want. Correct?
So how about we add a dynamic list to the fray?
The code would then look something like this. Assuming that channels.ini would look like this:
[Rizon]
#Channel=1
#Channel2=1

[Twitch]
#Channel=1
#Channel2=1
Code:
on 1:start: { 
server irc.rizon.net 
} 
on 1:connect: { 
var %file channels.ini
if ($network == Rizon) { nick RandomNick | var %section Rizon }
elseif ($server == tmi.twitch.tv) { nick RandomNick | var %section Twitch }
var %channels $ini(%file,%section,0)
var %i 1 
while (%i <= %channels) { 
var %chan $ini(%file,%section,%i)
join %chan
inc %i
}
}
This list is easily manipulated now by using $readini, /writeini and /remini. You can add, remove and check what channels are currently on the list by using these 3 things.

I suggest reading the help files to learn more about them and how to use them.


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Oct 2014
Posts: 35
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Oct 2014
Posts: 35
Thanks Nillen, got something working smile


Link Copied to Clipboard