mIRC Home    About    Download    Register    News    Help

Print Thread
Some one help me fixed this autoconnect identify #267343 09/06/20 04:24 PM
Joined: May 2020
Posts: 18
K
Kendy Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: May 2020
Posts: 18
Hello all mirc members. I researched and made automatic code connecting to multiple servers and automatically identifying nicknames for each server. However, the code does not work as I want, so I post here asking you to be familiar with the mirc code to help me make this code work. Thank you very much and hope to receive the code soon.

This is my code:
Code
on *:connect: {
  if ($network == DaVang) || ($network == Rizon) { autoconnect }
}
alias autoconnect {
on *:notice:*:?: {
  if ($network == DaVang) && ($nick == NickServ) {
    if (*nickname is registered* iswm $1-) { /ns identify passnickhere | timer 1 10 /join #davang,#party,#help }
  }
    if (*Nickname is already in use* iswm $1-) { /ns ghost NickName passnickhere | timer 1 1 /nick NickName | timer 1 5 /ns identify passnickhere | timer 1 20 /join #davang,#party }
  }
  elseif ($network == Rizon) && ($nick == NickServ) {
   /nick NickChat | timer 1 5 /join #party,#davang
}
}

Re: Some one help me fixed this autoconnect identify [Re: Kendy] #267346 09/06/20 05:07 PM
Joined: Jan 2004
Posts: 1,328
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,328
You cannot put an ON EVENT handler inside an alias. Your ON NOTICE event already has code inside it which activates only at the 2 networks, so you don't need the ON CONNECT nor the alias.

Also, for future help, it often helps to include debug messages in your code, like
echo -s $script $scriptline event $event nick $nick (1-) $1-
which lets you see whether the problem is that the EVENT isn't being triggered, or the code is not branching inside an if() condition, etc.

Also, since both your events have "nickname is" within their magic string, you can make your event be triggered by fewer false positives by changing it to:
on *:notice:*nickname is*:?: {

You'd still keep the if() conditions the same.

Re: Some one help me fixed this autoconnect identify [Re: maroon] #267348 10/06/20 04:39 AM
Joined: May 2020
Posts: 18
K
Kendy Offline OP
Pikka bird
OP Offline
Pikka bird
K
Joined: May 2020
Posts: 18
Thank you for your help. But can you rewrite the complete code for me, maroon? Thank you so well

Last edited by Kendy; 10/06/20 04:40 AM.
Re: Some one help me fixed this autoconnect identify [Re: Kendy] #267351 10/06/20 02:41 PM
Joined: Jan 2004
Posts: 1,328
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,328
As I said, you can just eliminate the code that's not needed. You'd just delete the final line and lines 1-4. And optionally, replace the 5th line with my example, but do that only once the existing code works. The debug echo is just something you can sprinkle throughout your code as a tracer to see which lines aren't being executed but should be, or are being executed but shouldn't, or to inform of unexpected values in identifiers and variables.