mIRC Home    About    Download    Register    News    Help

Print Thread
Notice and variables #68700
21/01/04 03:16 AM
21/01/04 03:16 AM
Joined: Jan 2004
Posts: 16
S
SuperMappy Offline OP
Pikka bird
SuperMappy  Offline OP
Pikka bird
S

Joined: Jan 2004
Posts: 16
Hello All

Is there anyway to get a received notice into a variable so you can check it for words or strings?

Thank You

Re: Notice and variables #68701
21/01/04 03:20 AM
21/01/04 03:20 AM
Joined: Dec 2002
Posts: 332
Louisiana, USA
C
Cheech Offline
Fjord artisan
Cheech  Offline
Fjord artisan
C

Joined: Dec 2002
Posts: 332
Louisiana, USA
/help on notice

on 1:NOTICE:*:?:/msg $nick I'm AFK, back in a moment!

This listens for any private notice and responds with the message that you're away from the keyboard.

For more flexibility, you can also use Variables in place of both the matchtext and the channel parameters.


Re: Notice and variables #68702
21/01/04 03:30 AM
21/01/04 03:30 AM
Joined: Jan 2004
Posts: 16
S
SuperMappy Offline OP
Pikka bird
SuperMappy  Offline OP
Pikka bird
S

Joined: Jan 2004
Posts: 16
that's not quite what I meant smile

let's say I receive a notice that says "Hello are you there" for example.

Is there a way I can get this string into a variable so I can check it for specific words or text

Re: Notice and variables #68703
21/01/04 03:34 AM
21/01/04 03:34 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Iori  Offline
Hoopy frood
I

Joined: Aug 2003
Posts: 1,831
Code:
on *:notice:*matchtext*:*:{
  ; commands
}
on *:notice:*:*{
  if Hello * there iswm $1- {
    ; commands
  }
}
on *:notice:*:*{
  if Hello == $1 {
    ; commands
  }
}
For more info type /help if then else

Re: Notice and variables #68704
21/01/04 04:31 AM
21/01/04 04:31 AM
Joined: Jan 2004
Posts: 16
S
SuperMappy Offline OP
Pikka bird
SuperMappy  Offline OP
Pikka bird
S

Joined: Jan 2004
Posts: 16
Thank you that worked beautifully.

One more little thing though smile

Here's my setup.

I'm using another computer for serving and this computer for chatting.

this line of code is in Popups on this computer:

bot speak:/notice (bot's name) $?="Enter bot speak for $chan "

this line of code is on the bot's computer:

on 1:notice:*:?:/msg $chan $1-

the obvious problem here is the bot has no idea what channel to message to from the $chan identifier. Is there a way I can send that identifier to the bot's computer?

I do plan on adding a $nick check for obvious reasons also smile

Re: Notice and variables #68705
21/01/04 04:43 AM
21/01/04 04:43 AM
Joined: Dec 2002
Posts: 332
Louisiana, USA
C
Cheech Offline
Fjord artisan
Cheech  Offline
Fjord artisan
C

Joined: Dec 2002
Posts: 332
Louisiana, USA
perhaps send 2 seperate notices
on 1:notice:*:?:{
if ($1 == channel) { set %chan $2 }
else {
msg %chan $1-
}
}

then notice the bot with /notice botname channel #channelname this isnt tested you might need to add a halt to the if line

Last edited by Cheech; 21/01/04 04:45 AM.
Re: Notice and variables #68706
21/01/04 10:43 AM
21/01/04 10:43 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Iori  Offline
Hoopy frood
I

Joined: Aug 2003
Posts: 1,831
Assuming this is the nicklist popups:
bot speak:.notice (bot's name) $chan $$input(Enter bot speak for $chan,eq,Bot Speak)
(The dot in front of .notice makes it "quiet" so you don't see "-> -botname- mu moo mu")

Here we check nick and if the bot is on the channel
on *:notice:*:?:if $nick == Yournick && $1 ischan { msg $1 $$2- }

You can make a more secure check than nick with $address, $site, $wildsite or with userlevels/protect.

Re: Notice and variables #68707
21/01/04 03:18 PM
21/01/04 03:18 PM
Joined: Jan 2004
Posts: 16
S
SuperMappy Offline OP
Pikka bird
SuperMappy  Offline OP
Pikka bird
S

Joined: Jan 2004
Posts: 16
Thank you lori, that works perfectly. laugh

Thanks to all