mIRC Home    About    Download    Register    News    Help

Print Thread
M
MoneyGamer
MoneyGamer
M
Is there any way to make a script work only when a certain person triggers it, and ONLY for that person?

Joined: Jan 2004
Posts: 1,330
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,330
/help Access Levels
/help User List
/help if then else
/help $nick
/help /return

Joined: Mar 2014
Posts: 214
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 214
Code:
on *:text:!command:#: {
  if ($nick == yourusername) { msg $chan message here }
}

J
jaystew
jaystew
J
Originally Posted By: judge2020
Code:
on *:text:!command:#: {
  if ($nick == yourusername) { msg $chan message here }
}


Although using the above could allow others to use it. So if I set it to ($nick == JayStew) Then log off, someone else could join the server using my nickname and then use the command without any problems (That's if they know the commands of course)

So maybe something like this that reads the address of the person, If the address matches it will work and if it doesn't match it wont work for the person.Clearly this wont work if you have a hostmask that constantly changes though.

Code:
on *:TEXT:!hi:#: { 
  if (($readini(access.ini, $nick, Hostmask) == $address($nick,2),2)) { .msg # hello | halt }  
  else { 
    .msg # Sorry nick that Hostmask does that have permission to use this command. 
  }
}



If you want to use the code ive provided you will then need to make a ini file called access in you mIRC (or bots mIRC) with the following info in

[Your_Nickname]
Hostmask=*!*@My.Host.Here.co.uk




Joined: Mar 2014
Posts: 214
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 214
set a password for that account? :P


Link Copied to Clipboard