mIRC Home    About    Download    Register    News    Help

Print Thread
Answering a word typed in a channel!! #195699 29/02/08 04:29 AM
Joined: Jun 2004
Posts: 13
S
Skrubz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2004
Posts: 13
OK People...I have one more request for help and I promise you will not hear from me again!! *choke*

Would someone be kind enough to write an addon script line that will send a message into the channel...from me...whenever the word 'help' is typed!?!...(I am on UnderNet)

Thanx


Re: Answering a word typed in a channel!! [Re: Skrubz] #195702 29/02/08 05:18 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You could just read this and it basically gives you everything you need and an example to boot...
/help on text

But, here:
Code:
on *:text:*help*:#: {
  msg $chan Someone typed help.
}


Note that you can remove one or both *'s around "help" if you don't want to respond when help is anywhere in the line. If you only want to respond when help is written by itself, remove both *'s. If you want to only respond if it's the first thing on the line, just remove the last *. Leave both if you want to respond no matter where it is written in a line of text.


Invision Support
#Invision on irc.irchighway.net
Re: Answering a word typed in a channel!! [Re: Skrubz] #195706 29/02/08 10:28 AM
Joined: Jul 2007
Posts: 32
S
Sh4d0w191 Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Jul 2007
Posts: 32
Or...

Code:
;If the word [b]help[/b] is anywhere is in the sentence say "Someone Typed Help"

on *:text:*help*:#: msg # Someone Typed help

;If something like blahblah[b]help[/b] was typed it would say "Someone Typed Help"

on *:text:*help:#: msg # Someone Typed Help

;If something like [b]help[/b]blahblah was typed it would say "Someone Typed Help"

on *:text:help*:#: msg # Someone typed help

;If the word [b]help[/b] is typed on its own it would say "Someone Typed Help"

on *:text:help:#: msg # Someone typed help


So like Riamus said, the "*" symble will acts like the word "anything" e.g *help* = if someone typed "anything"help"anything" it will pick out the word help and send the message.

Hope I explained it well :S, if not look at /help on text and maybe Khaled can explain it better wink

-Shadow

Re: Answering a word typed in a channel!! [Re: Riamus2] #195727 29/02/08 05:03 PM
Joined: Jun 2004
Posts: 13
S
Skrubz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2004
Posts: 13
I did check out the mIRC help files and had a problem finding anything...but in the future I will do what u suggest...now that I know what to look for.

I really appreciate your assistance!

Thanx

Re: Answering a word typed in a channel!! [Re: Sh4d0w191] #195728 29/02/08 05:08 PM
Joined: Jun 2004
Posts: 13
S
Skrubz Offline OP
Pikka bird
OP Offline
Pikka bird
S
Joined: Jun 2004
Posts: 13
You have also been very helpfull...thanx smile

Re: Answering a word typed in a channel!! [Re: Skrubz] #196200 12/03/08 07:40 PM
Joined: Feb 2008
Posts: 7
M
moocifer Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2008
Posts: 7
What if you wanted an ON TEXT script that responded to a list of keywords ??

Could someone tell me how I go about creating a variable and using $istok if that's the right way to go about it ..

Re: Answering a word typed in a channel!! [Re: moocifer] #196209 12/03/08 10:31 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
/help $istok
Originally Posted By: Help File

$istok(text,token,C)


Note that you should consider reading the entire "page" that opens when using that /help command as it's all related and the other things on that page will help you understand this.

Code:
if ($istok(this is a list of words separated by chr32,%somevar,32)) { do this }



%somevar is what you're looking for. You can also use a var for the first part (the list of words). And you can use something other than $chr(32) [space] for separating the words ... just change the 32 at the end to the correct $chr() for the separating character.


Invision Support
#Invision on irc.irchighway.net
Re: Answering a word typed in a channel!! [Re: Riamus2] #196213 12/03/08 10:59 PM
Joined: Feb 2008
Posts: 7
M
moocifer Offline
Nutrimatic drinks dispenser
Offline
Nutrimatic drinks dispenser
M
Joined: Feb 2008
Posts: 7
Yeah thanks for that but I was already using $istok and something similar however the On TEXT didn't activate if any of the keywords were present in part of a string of text typed by the individual but only if they typed the single keyword.

Re: Answering a word typed in a channel!! [Re: moocifer] #196229 13/03/08 03:44 AM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
You will have to loop through all words in the sentence.


Invision Support
#Invision on irc.irchighway.net