mIRC Homepage
Posted By: oblivious Sending a command to my socket - 11/09/06 01:25 AM
I have a socket connected and commands setup for my socket bot , but everyone in the channel can type them as well and I don't want that. How do I stop this ?

Code:
   if ($2 == PRIVMSG) && ($remove($4,:) == .hop) {
    sockwrite -n $sockname PART $3
    sockwrite -n $sockname JOIN $3
  }  


so whenever someone types ".hop" my bot cycles the channel, I don't want that.
Posted By: RusselB Re: Sending a command to my socket - 11/09/06 01:46 AM
Compare the contents of $nick with your nick. If it's you, then do the commands
Posted By: oblivious Re: Sending a command to my socket - 11/09/06 02:39 AM
I have already tried a few things and I can't find the right syntax.
Posted By: MikeChat Re: Sending a command to my socket - 11/09/06 03:15 AM
the easiest way to do it is to give yourself a higher level
/help /guser

you add yourself to level 1000

then your on text event might would like

on 1000:text:*:*:{ code }
Posted By: genius_at_work Re: Sending a command to my socket - 11/09/06 02:12 PM
Quote:
I have a socket connected...


Regular mIRC value-carrying event identifiers don't work in sockets (except $N and $rawmsg). You have to actually get the value of the nickname yourself using scripting.

Nickname!ident@host.mask.com PRIVMSG #channel :.hop

Code:
%nick = $gettok($1,1,33)
if ((%nick == you) && ($2 == PRIVMSG) && ($remove($4,:) == .hop)) hop $3


-genius_at_work
Posted By: oblivious Re: Sending a command to my socket - 16/09/06 12:13 AM
thank you very much
© mIRC Discussion Forums