|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
My ISP recently added a botnet protection. This would be just great except that it kicks me out from the IRC if I connect too many channels simultaneously. I've not been able to figure out how to make it connect to channels slowly. Therefore I need help to create a script that does this: Load a text file, the text file will have each and every channel in it. It connects to the first channel and then adds a 1-2 second delay before joining the next one. Upon disconnection it should automatically close all open channels so there's no chance of duplicates. If it disconnects while going through the join process, abort and close all channels. Wait 10 seconds and try again. (Preferably not a ini file)
|
|
|
|
Joined: Sep 2014
Posts: 259
Fjord artisan
|
Fjord artisan
Joined: Sep 2014
Posts: 259 |
alias kanaler {
var %list = #test111 #test222 #test333 #test444 #test555
var %i = 1
while (%i <= $numtok(%list,32)) {
var %sec = $calc(%i * 5)
.timer 1 %sec join $gettok(%list,%i,32)
inc %i
}
}
|
|
|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
Don't understand much of that script so I don't think I'll be able to use it, won't be able to add/remove/change things in it, I do really appreciate the response though. What I specifically need is something that does this:
1: Triggers on a successful connection to the TMI network. 2: Closes all active/previous channels. 3: Begins the joining process (reads a text file for the channels) 3.1: Needs a 2 second delay between each join. 4: Before each join, it checks that there is no current channel with the same name. 5: Upon disconnect, waits 30 seconds then triggers a connection to the TMI network.
Last edited by Gargantuan; 28/02/15 02:33 AM.
|
|
|
|
Joined: Sep 2014
Posts: 259
Fjord artisan
|
Fjord artisan
Joined: Sep 2014
Posts: 259 |
Well, you can just try and use it by typing /kanaler and then you will understand what it does ;P. I don't understand the point of keeping the channels in a txt file. I'm not sure I understand why you need to part all channels before joining, but this should do that anyways.. This has a 10 sec delay on joining chans, I don't know if parting channels too fast is something you can get banned for.. probably is =D
ON *:CONNECT: if ($network == NameOfNetwork) kanaler
alias kanaler {
var %y = 1
while ($chan(%y)) {
part $chan(%y)
inc %y
}
var %list = #test111 #test222 #test333 #test444 #test555
var %i = 1
while (%i <= $numtok(%list,32)) {
var %sec = $calc(%i * 10)
if ($me !ison $gettok(%list,%i,32)) { .timer 1 %sec join $gettok(%list,%i,32) }
inc %i
}
}
Last edited by Sakana; 28/02/15 09:40 AM.
|
|
|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
I'd like to have it in a text file so I can make a simple script to add/remove channels, without actually accessing the server. It's not that I get banned or anything, the ISP just does a swift disconnect. Short enough to disconnect me from the TMI network, but not enough to disconnect me from games etc. I appreciate the reply and I'll try the script =D
Edit: Script not working. ($network == NameOfNetwork) Attempted several names, and tried checking the current one once connected. Message: "You are not on a channel" Am I screwing something up or isn't it working?
Last edited by Gargantuan; 28/02/15 03:37 PM.
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
Doesn't matter where you store it. You can set a %variable You can add to an ini file You can add to a txt file You can add to a hash table
Saw your edit. For debugging errors, you can try using " //Echo -a Network: $network " in the server you provided. It happens to be the case that Twitch returns $null for $network. Use $server instead.
Last edited by Nillen; 28/02/15 03:37 PM.
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
That debug fixed it, thank you. It helped a lot. Tested a few things though.
After I killed the Internet connection, mIRC lost connection and disconnected but the channels weren't removed from the channels list. Therefore once I turned on my Internet connection again and mIRC reconnected (Reconnect on Disconnect setting) it tried to automatically rejoin all channels that were previously active. So it's essential that the script clears the channel list. Preferably instantly, any ideas?
P.S: As far I know, there's not an option to disable the channel reconnect in mIRC.
Last edited by Gargantuan; 28/02/15 03:52 PM.
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
Rejoining a channel that's already active is literally the same as joining a channel, isn't it?
What's the scenario, what happens that you don't want it to happen?
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
When mIRC connects to the network, and the network already have 100 channels loaded (loaded, not connected) then it tries to connect all those 100 channels all at once, which triggers my ISP's disconnect. If mIRC connects to the network, and the network has no channels loaded. It launches the script and begins connecting slowly to prevent me from being disconnected.
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
I see. on *:disconnect: {
var %chans $chan(0)
while (%chans) {
var %chan $chan(%chans)
part %chan
dec %chans
}
}
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
Thank you, worked great. Cleared out the channels and connected properly, will have to see if it clears them fast enough when it comes to the random disconnects I have in mIRC once a day. Only lasts for a second or less, P.S: Is it possible to speed up the clearing process? and var %list = #test111 #test222 #test333 #test444 #test555 Do you have any suggestions on how to add / remove channels with a !command ? I only know how to write and remove to a text file. Not quite sure how it would work now when the channels are located inside the script itself.
|
|
|
|
Joined: Dec 2013
Posts: 779
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
/set %list %list TOKEN or /help $addtok But like I mentioned previously, it doesn't matter what type of storage you use.
/help /writeini /help /write /help variables /help $addtok /help hash tables
As for speeding up the process, I'd imagine you could use the same %list and pull info from that instead, should be quicker than pulling values from $chan(), by how much I can't tell you though.
Nillens @ irc.twitch.tv Nillen @ irc.rizon.net
|
|
|
|
Joined: Apr 2014
Posts: 31
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2014
Posts: 31 |
Okay, gonna try it out for the rest of the evening. Thank you for two for the amazing help!
|
|
|
|
|
|