mIRC Home    About    Download    Register    News    Help

Print Thread
Sending a command to my socket #158916 11/09/06 01:25 AM
Joined: Jul 2006
Posts: 53
O
oblivious Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
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.

Re: Sending a command to my socket #158917 11/09/06 01:46 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Compare the contents of $nick with your nick. If it's you, then do the commands

Re: Sending a command to my socket #158918 11/09/06 02:39 AM
Joined: Jul 2006
Posts: 53
O
oblivious Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
I have already tried a few things and I can't find the right syntax.

Re: Sending a command to my socket #158919 11/09/06 03:15 AM
Joined: Dec 2002
Posts: 1,245
M
MikeChat Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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 }

Re: Sending a command to my socket #158920 11/09/06 02:12 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Re: Sending a command to my socket #158921 16/09/06 12:13 AM
Joined: Jul 2006
Posts: 53
O
oblivious Offline OP
Babel fish
OP Offline
Babel fish
O
Joined: Jul 2006
Posts: 53
thank you very much