Note: you edited your post but it was originally saying that the script only worked when specifying a nickname

Yes, that was intended because you didn't state you wanted both and I didn't assume so. You have to use an if statement and to use $nick in one case and $2 for the other:
Code:
on *:text:!view *:#ChanName:{
  ;the code will use the variable %nick for the profile, either set to $2 or to $nick
  if ($2 != $null) {
    if ($ini(info.ini,$2) != $null) var %nick $2
    else {
     msg $chan Error: no profile for the nickname $2
     ;after an error, you don't want to keep going with the profile so you /return, using /halt is not necessary and can have consequences on the rest of the loaded scripts
     return
    }
  }
  elseif ($ini(info.ini,$nick) != $null) var %nick $nick
  else {
   msg $chan Error: no profile for the your nickname $nick
   return
  }
  /notice $nick * * * Profile for %nick * * *
  /notice $nick *
  /notice $nick Age: $readini(info.ini,n,%nick,Age) - - - Gender: $readini(info.ini,n,%nick,Gender) - - - Location: $readini(info.ini,n,%nick,Location) - - - Role: $readini(info.ini,n,%nick,Role) | /notice $nick *
  /notice $nick Description: $readini(info.ini,n,%nick,Description) 
  /notice $nick * 
  /notice $nick * * * End of profile * * *
  }
}
The 'n' switch on $readini is there, switches go after the filename in $readini

Last edited by Wims; 22/06/14 09:55 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel