mIRC Home    About    Download    Register    News    Help

Print Thread
Need Help with Nick Detecting #245587 28/04/14 07:49 PM
Joined: Apr 2014
Posts: 1
M
MoneyGamer Offline OP
Mostly harmless
OP Offline
Mostly harmless
M
Joined: Apr 2014
Posts: 1
Is there any way to make a script work only when a certain person triggers it, and ONLY for that person?

Re: Need Help with Nick Detecting [Re: MoneyGamer] #245588 28/04/14 08:05 PM
Joined: Jan 2004
Posts: 1,286
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,286
/help Access Levels
/help User List
/help if then else
/help $nick
/help /return

Re: Need Help with Nick Detecting [Re: MoneyGamer] #245603 29/04/14 11:25 AM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
Code:
on *:text:!command:#: {
  if ($nick == yourusername) { msg $chan message here }
}


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Re: Need Help with Nick Detecting [Re: judge2020] #245606 29/04/14 07:25 PM
Joined: Jan 2014
Posts: 55
J
jaystew Offline
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
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





Regards

JayStew
Re: Need Help with Nick Detecting [Re: jaystew] #245609 30/04/14 12:07 AM
Joined: Mar 2014
Posts: 215
J
judge2020 Offline
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
set a password for that account? :P


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball