Page 1 of 1

Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 5:49 pm
by Will
New to this.
Here is the script I am having trouble with:


on 1:text:test:#mychat: { /notice $nick My Message
}

-------------------
My question is,

When somone in the channel types the word test the notice is sent to that person. How do I make this so that if the person types the word test in a sentence it will send the notice as well?

Thanks in advance for any help

Re: Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 6:19 pm
by GrimReaper
Will, There are two way's of doing this.. You can either do
Code: Select all
on 1:TEXT:*test*:#channelname: { notice $nick Your message }


or

Code: Select all
on 1:TEXT:*:#channelname: { if (test isin $1-) { notice $nick Your message } }


I hope this helps you out. :)

Re: Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 6:51 pm
by Will
Thanks so much for the fast reply GrimReaper. That works great and is just what I was looking for. One thing I forgot to ask though, do I have to enter that line of script each time I want to add an additional word to be triggered?

Re: Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 7:22 pm
by GrimReaper
with the second one I posted,
Code: Select all
on 1:TEXT:*:#channelname: { if (test isin $1-) { notice $nick Your message } }

You could space it out more and add more words under it.

Code: Select all
on 1:TEXT:*:#channelname: {
  if (test isin $1-) {
    .notice $nick Your message
  }
  elseif (word2 isin $1-) {
    .notice $nick blah blah
  }
}


But most people prefer to use !triggers. and changing
Code: Select all
if (test isin $1-) {
to
Code: Select all
if ($1 == !test) {
Will make thing's easier.

Re: Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 7:30 pm
by Will
Thanks again for the help GrimReaper. I look forward to learning from everyone here at GeekShed.

Re: Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 7:35 pm
by GrimReaper
Well.. If you even would like to talk to me, I'm usually in #bots under the nick Danneh, Peer or GrimReaper. Depending on what nick I decide :)

Re: Can somone help with this script please?

PostPosted: Tue Sep 07, 2010 9:04 pm
by Will
Right on, I will keep that in mind because I am sure I will be seeking more help in the furture. :)