Zmodem commented on a Page, Mynick!  -  Sep 03, 2008

First, let me tell you that this is a mess of a code structure, with numerous bracket errors that destroy the code from executing right from the start. You've also used $nick in the ON CONNECT event in order to figure out if your own nickname is %n. The correct identifier, and the most proper, is $me; however, since the connect event triggers the $nick identifier, for one reason or another, to default to $me in this case, I will overlook that small logic-error.

Second, this timer, for the ON CONNECT event, is hardly necessary. For one, if a user doesn't have the IdentD either port-forwarded or enabled, it will take more than some 2 seconds to rectify a connection establishment. Your best bet, in this case, would be to get rid of the ON CONNECT event altogether and go with a less reprehensible event, such as the RAW numeric pertaining to the MOTD. It is more reliable than a timer, but bear in mind, also, that not all servers have the MOTD, either. In any case, you can replace your ON CONNECT event with this:

raw 322:*:if ($nick == %n) { msg nickserv identify %p }

Voila, you are done! By the way, the raw numeric 322 pertains to the end of the /MOTD display, usually sent by most servers once a full connection has been established. This will allow you to forgo your timer.

Next up, I've no idea what to say about your ON LOAD event, nor your ON NICK event. Both are a bit sloppy and both have serious issues. Let's address all of this by cleaning up the code:

ON *:LOAD:{
  if (!%n) { set %n $$?="Nick" }
  if (!%p) { set %p $$?*="Password" }
}
raw 322:*:if ($nick == %n) { msg nickserv identify %p }
on *:nick:if (($newnick == $me) && ($me == %n)) { msg nickserv identify %n p }

Later on, you might consider adding the ON LOAD event as an alias, so the user can change the auto-id on the fly when they want. For instance, here is another variant of code:

ON *:LOAD:if (!%n) { new.autoid }
alias new.autoid {
  set %n $$?="Nick"
  set %p $$?*="Password"
}
raw 322:*:if ($nick == %n) { msg nickserv identify %p }
on *:nick:if (($newnick == $me) && ($me == %n)) { msg nickserv identify %n p }

You wouldn't need to check the (!%p) event, because if there is no %n then %p is useless. On top of all of this, there are more suggestions:

  1. Try asking if a user is sure they want to overwrite their old user/pass entries.

  2. Check and make sure valid data is entered when the new.autoid command is done.

  3. Let people know that they can use /new.autoid whenever they want, to establish a new auto-id user/pass.

Well, sorry to go ballistic on it all, but I hope this helps point you in a better direction. Good luck!

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.