mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2014
Posts: 12
T
tristan Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Feb 2014
Posts: 12
hey everyone. i was wondering if anyone knows how to setup bot commands so they interact with another nick such as

instead of what i have right now:

on 1:text:!hug:#tristansroom : { describe $chan hugs $nick tightly }

which is:
gary:!hugs
bot hugs gary

it can do this:

gary:!hugs tristan
gary goes and hugs tristan tight

really grateful for any help :-) thanks. tristan

Joined: Jan 2014
Posts: 55
J
Babel fish
Offline
Babel fish
J
Joined: Jan 2014
Posts: 55
Something like this?

Code:
on *:text:*:#tristansroom: {
  if ($1 == !hug) {
    if ($2 == $null) { .notice $nick Command incomplete. Syntax: !hug <Username>.  | halt }
    if ($2 !== $null) {
      if ($2 !ison $chan) { .notice $nick Sorry but user $2 is not in $chan  | halt }
      else { .msg $chan $nick goes and hugs $2 tight! | halt }
    }
  }
}


Last edited by jaystew; 14/02/14 06:57 PM. Reason: Cleaned it up a little

Regards

JayStew
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You dont need two = in this one. !==

one = is enough. !=

And if $2 is null, then it will halt the rest of the code, so no need for != $null since it will never go there as long as $2 is $null.
Code:
on *:text:*:#tristansroom: {
  if ($1 == !hug) && ($2 != $null){ 
  .notice $nick Command incomplete. Syntax: !hug <Username>.
  if ($2 !== $null) {
    if ($2 !ison $chan) { .notice $nick Sorry but user $2 is not in $chan }
    else { .msg $chan $nick goes and hugs $2 tight! }
  }
}

Untested, but i think it will work.

Last edited by sparta; 14/02/14 07:07 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2014
Posts: 12
T
tristan Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Feb 2014
Posts: 12
when i tried it every single word said it would respond by every user. it went crazy lol

so i tried lot of words like
:text:!hug:
:text:!h:

etc and nothing worked then. didnt react to anything

am i doing it wrong or missing something?

thanks for your help its really appreciated :-)
-------------
on *:text:!hug:#tristansroom : {
if ($1 == !hug) && ($2 ison $chan) { .msg $chan $nick goes and hugs $2 tight! | halt }
if ($2 == $null) { .msg $chan $nick you must select a nickname to hug E.g. !hug $me | halt }
if ($2 !ison $chan) { .msg $chan Sorry $nick but $2 is not in this channel | halt }
}

-----------

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
if ($1 == !hug) && ($2 != $null)

$1 is the trigger. $2 is the nick, if you dont give a nick, then it will not work.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2014
Posts: 12
T
tristan Offline OP
Pikka bird
OP Offline
Pikka bird
T
Joined: Feb 2014
Posts: 12
im typing

!hug greg

and nothing happens. nothing shows up. idk why. thanks for your help, must be me doing it wrong or something. tristan

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You type? You dont type true the bot? If you do you need on input and not on text, and this greg need to be on the channel #tristansroom ..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }

Link Copied to Clipboard