mIRC Home    About    Download    Register    News    Help

Print Thread
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.

Joined: Sep 2016
Posts: 15
T
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

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

Joined: Sep 2016
Posts: 15
T
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.
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.

Link Copied to Clipboard