Jethro commented on a Page, Pokemon Catching Snippet  -  Apr 05, 2010

This is exactly why it's better to use socket when dealing with a randomized script like this:

on $*:text:/^[!.]pokemon$/iS:#: {
  if !%PKTimer. [ $+ [ $nick ] ] { set -u3 %c #
    set -z [ %PKTimer. [ $+ [ $nick ] ] ] $r(60,300) | pokemon
  }
  else { 
    notice $nick You may use the command $1 again in $&
      $duration( %PKTimer. [ $+ [ $nick ] ] ) $+ .
  }
}
alias pokemon sock $+ $iif($sock(p),close p,open p www.pokemonzone.com 80)
on *:sockopen:p: { 
  var %pokemon sockwrite -nt p | %pokemon get /fullpokedex.html http/1.1
  %pokemon host: www.pokemonzone.com $str($crlf,2) | sockmark p msg %c
}
on *:sockread:p: {
  var %p $r(001,493), %r /( $+ %p $+ )\s(.+?)\s/, %s | sockread %s
  if ($regex(%s,%r)) { $sock(p).mark $nick has caught a Pokémon named: $&
      $regml(2) $+ ! Congratz! | sockclose p 
  }
}

GuitarMasterx7, you don't place a OR pipe inside the regex [] bracket. [!@] will either match ! or @ as is. By placing it in the [] bracket, you will match for > |pokemon If you choose to use the pipe, then this is another way:

/^(!|@)pokemon$/

The dollar sign $ will ensure that the command ends with the letter n and nothing more. For mirc though, those two symbols don't need to be escaped...and will work.

 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.