dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: mIRC event registration

  1. #1
    Join Date
    Feb 2009
    Posts
    10

    mIRC event registration

    So I'm trying to make a event registration for some events right now but it's not validating correctly. Here is the code.

    Code:
    on *:TEXT:!register *-*-* *:#secretply-test: {
      if (($len($2) != 4) && ($2 !isnum) && ($len($3) != 4) && ($3 !isnum) && ($len($4) != 4) && ($4 !isnum)) {
        /query $nick The friend code is invalid. Please only use numbers and twelve (12) numbers with a hyphen after the first four (4) numbers and before the last four (4) numbers followed by your name that appears in the game. Example: !register 0000-0000-0000 gameusername
        /closemsg $nick
      }
      else if (($2-4 == $read(text.txt,w,* $+ $2-4 $+ *)) || ($5 == $read(text.txt,w,* $+ $5 $+ *))) {
        /query $nick You have already registered for this event.
        /closemsg $nick
      }
      else {
        /write text.txt Friend Code: $2-4 ... Game Username: $5
        /msg $chan [Register] $nick has registered.
        /query $nick Rules.
        /closemsg $nick
      }
    }
    So here's the plan, whenever someone types !register, they need to input parameters in the same line. !register friendcode gameusername

    Where friendcode is in the format xxxx-xxxx-xxxx where the x's are only 4 characters before the separator, a total of 12 characters in total without the separators, and that the x's are only numbers. gameusername is just regular text, any letters and numbers.

    After they input !register, it'll check if they followed the format I mentioned above. If the format is correct then it'll check if they have already registered based on friendcode or gameusername in a text file. If the person has not registered and there is no record in the text file, then it'll register the user with their friendcode and gameusername in a text file.

    Any help would be greatly appreciated.

  2. #2
    Join Date
    Feb 2009
    Posts
    10
    I got it to work, I was supposed to use or operators, not and operators.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles