Author Topic: Error messages on specific word said?  (Read 2585 times)

project-4-12

  • Guest
Error messages on specific word said?
« on: June 05, 2009, 10:32:33 PM »
is there any way to get an error message to come up t if someone says a specific word?


What i want to do is have an error message come up with if someone says something like your nickname,  that could have information such as what channel it was said in.

is there any way to do that?

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Error messages on specific word said?
« Reply #1 on: June 06, 2009, 02:37:48 AM »
try this:

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If InStr(LCase(Message),LCase(GetIdentifier("$me",ServerNumber))) > 0 then
MesBox "Your nickname was mentioned by " & Nickname & " on channel " & Channel & " on " & GetIdentifier("$network",ServerNumber),"nickname mentioned",0
ElseIf InStr(Message,"someword") > 0 then
MesBox "prompt","title",0
End If
End Sub

the syntax for MesBox is:
Code: [Select]
MesBox propmt,title,buttons
and the buttons you can use are:
0 = vbOKOnly - OK button only
1 = vbOKCancel - OK and Cancel buttons
2 = vbAbortRetryIgnore - Abort, Retry, and Ignore buttons
3 = vbYesNoCancel - Yes, No, and Cancel buttons
4 = vbYesNo - Yes and No buttons
5 = vbRetryCancel - Retry and Cancel buttons
16 = vbCritical - Critical Message icon
32 = vbQuestion - Warning Query icon
48 = vbExclamation - Warning Message icon
64 = vbInformation - Information Message icon

and when the buttons are clicked, they return:
1 = vbOK - OK was clicked
2 = vbCancel - Cancel was clicked
3 = vbAbort - Abort was clicked
4 = vbRetry - Retry was clicked
5 = vbIgnore - Ignore was clicked
6 = vbYes - Yes was clicked
7 = vbNo - No was clicked
« Last Edit: June 06, 2009, 04:36:18 AM by Morio »
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

project-4-12

  • Guest
Re: Error messages on specific word said?
« Reply #2 on: June 06, 2009, 01:03:05 PM »
It works perfectly!   Thank you!   :-D