mIRC Home    About    Download    Register    News    Help

Topic Options
#251678 - 27/02/15 03:24 AM Delayed Join
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
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)

Top
#251679 - 27/02/15 05:35 AM Re: Delayed Join [Re: Gargantuan]
Sakana Offline
Fjord artisan

Registered: 19/09/14
Posts: 259
Code:
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
  }
}

Top
#251689 - 28/02/15 02:31 AM Re: Delayed Join [Re: Sakana]
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
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.


Edited by Gargantuan (28/02/15 02:33 AM)

Top
#251690 - 28/02/15 04:50 AM Re: Delayed Join [Re: Gargantuan]
Sakana Offline
Fjord artisan

Registered: 19/09/14
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


Code:
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
  }
}


Edited by Sakana (28/02/15 09:40 AM)

Top
#251696 - 28/02/15 03:18 PM Re: Delayed Join [Re: Sakana]
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
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?





Edited by Gargantuan (28/02/15 03:37 PM)

Top
#251697 - 28/02/15 03:35 PM Re: Delayed Join [Re: Gargantuan]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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.



Edited by Nillen (28/02/15 03:37 PM)
_________________________
Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Top
#251698 - 28/02/15 03:49 PM Re: Delayed Join [Re: Nillen]
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
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.


Edited by Gargantuan (28/02/15 03:52 PM)

Top
#251699 - 28/02/15 03:59 PM Re: Delayed Join [Re: Gargantuan]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
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

Top
#251700 - 28/02/15 04:02 PM Re: Delayed Join [Re: Nillen]
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
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.

Top
#251701 - 28/02/15 04:13 PM Re: Delayed Join [Re: Gargantuan]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
I see.

Code:
on *:disconnect: { 
var %chans $chan(0)
while (%chans) {
var %chan $chan(%chans)
part %chan
dec %chans
}
}
_________________________
Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net

Top
#251702 - 28/02/15 04:23 PM Re: Delayed Join [Re: Nillen]
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
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
Code:
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.

Top
#251703 - 28/02/15 04:40 PM Re: Delayed Join [Re: Gargantuan]
Nillen Offline
Hoopy frood

Registered: 24/12/13
Posts: 779
Loc: Sweden
/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

Top
#251704 - 28/02/15 04:54 PM Re: Delayed Join [Re: Nillen]
Gargantuan Offline
Ameglian cow

Registered: 18/04/14
Posts: 31
Loc: Sweden
Okay, gonna try it out for the rest of the evening. Thank you for two for the amazing help!

Top