mIRC Home    About    Download    Register    News    Help

Print Thread
Joining a channel on text and auto connect. #258853 04/09/16 07:21 PM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
Code:
on *:TEXT:!joinxd*:#:{ 
  if ((%floodjoinxd) || ($($+(%,floodjoinxd.,$nick),2))) { return }
  set -u10 %floodjoinxd On
  set -u30 %floodjoinxd. $+ $nick On
  /j $nick
  msg $chan I joined your channel $nick
}


That works but the next time I quit mIRC and then starts it hasnt saved the channels that it joined is there a way for it to auto reconnect previously joined channels?

Thanks.

Re: Joining a channel on text and auto connect. [Re: TUSK3N] #258864 05/09/16 08:52 PM
Joined: Sep 2016
Posts: 15
T
Tulga Offline
Pikka bird
Offline
Pikka bird
T
Joined: Sep 2016
Posts: 15
you can use write and read then use while to join all the channels

Code:
ON *:CONNECT: {
  var %i 1
  ; Joining all the channels that writing in the txt file
  while (%i <= $lines(JoinChannels.txt)) {
      $read(JoinChannels,%i)
      inc %i
  }
}

on *:TEXT:!joinxd*:#:{ 
  if ((%floodjoinxd) || ($($+(%,floodjoinxd.,$nick),2))) { return }
  set -u10 %floodjoinxd On
  set -u30 %floodjoinxd. $+ $nick On
  
  var %jchannel /j $nick
  if ($read(JoinChannels.txt,w,%jchannel)) { msg # Your channel already on the list $nick ! | return }
  else {
    write JoinChannels.txt %jchannel ; writing to the txt file
    msg $chan I joined your channel $nick
  }
}


Hope that will help smile

Re: Joining a channel on text and auto connect. [Re: Tulga] #258883 07/09/16 04:31 PM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
Yes that is exactly what I wanted thank you!

But now if someone wants my bot to leave his chat like this command !leavexd

then it had to /part $nick and delete the line in the text file but I dont know how to do it smirk

Re: Joining a channel on text and auto connect. [Re: TUSK3N] #258884 07/09/16 05:53 PM
Joined: Sep 2016
Posts: 15
T
Tulga Offline
Pikka bird
Offline
Pikka bird
T
Joined: Sep 2016
Posts: 15


Code:
on *:TEXT:!joinxd*:#:{ 
  if ((%floodjoinxd) || ($($+(%,floodjoinxd.,$nick),2))) { return }
  set -u10 %floodjoinxd On
  set -u30 %floodjoinxd. $+ $nick On

  var %jchannel /j $nick
  if ($read(JoinChannels.txt,w,%jchannel)) { msg # Your channel already on the list $nick ! | return }
  else {
    /j $nick
    write JoinChannels.txt %jchannel
    msg $chan I joined your channel $nick
  }
}

on *:TEXT:!leavexd*:#:{
  var %jchannel /j $nick
  if (!$read(JoinChannels.txt,w,%jchannel)) { msg # You're not on the list! | return }
  else {
    var %leftChan $+($chr(35),$read(JoinChannels.txt,w,* $+ $nick))
    write -dl $+ $readn JoinChannels.txt
    /part %leftChan
    msg # I left your channel $nick
  }
}


there you go smile

Last edited by Tulga; 07/09/16 05:53 PM.
Re: Joining a channel on text and auto connect. [Re: Tulga] #258928 14/09/16 06:06 PM
Joined: Mar 2016
Posts: 50
T
TUSK3N Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Mar 2016
Posts: 50
Thank you so much for taking your time to make this!

But I have a problem I dont join channels when I start up mIRC all the names are in the text file but it looks like it doesnt fire the event or maybe too early?

This code doesnt work

Code:
ON *:CONNECT: {
  var %i 1
  ; Joining all the channels that writing in the txt file
  while (%i <= $lines(JoinChannels.txt)) {
      $read(JoinChannels,%i)
      inc %i
  }
}


Oh nvm you missed the .txt here
$read(JoinChannels,%i)

:P

Last edited by TUSK3N; 14/09/16 08:42 PM.