mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2014
Posts: 1
M
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?

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

Joined: Mar 2014
Posts: 215
J
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
Joined: Jan 2014
Posts: 55
J
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
Joined: Mar 2014
Posts: 215
J
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

Link Copied to Clipboard