mIRC Home    About    Download    Register    News    Help

Print Thread
#137999 23/12/05 01:00 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
Don't know why I can't figure this out. HOw do you get a On *:text to work when you type something. I have the script on my computer and want it to record everything that is on the line when truguce is said. For some reason I cant get it to run when i type it. This is what I have
Code:
on *:text:truguce*:#help: {
  write -ai truguce.txt $1- - Added $date 
  msg $chan Added $1-
}
  

#138000 23/12/05 01:02 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Your own text is not captured with the on text event, but with the on input event.

/help on input


Gone.
#138001 23/12/05 01:18 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
I know the answer is right there, but for some reason i can't figure it out this is what i did
Code:
on *:input:#help: {
  if (<truguce* isin input) write -ai truguce.txt $1- - Added $date 
}
  

I only want it to record when the begging on the line is the same. Can this be done?

#138002 23/12/05 01:24 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
isin doesn't accept wildcards, and I think you typoed the < part.

if (truguce * iswm $1-) ...

$1- are the parameters you typed, just like $1- are the parameters that $nick typed in the on text event.

Even simpler would be:

if (truguce == $1) ...

Both if-comparisons will be $true, when you typed a sentence with the first word being "truguce"

Note that "truguce*" is not the same as "truguce *". The former will match "truguceeeeeee", whilst the latter will not.


Gone.
#138003 23/12/05 01:29 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
With on input, the text entered is in $1-, which is what you need to check for any comparisons.
Code:
 on *:input:#help: {  if (&lt;truguce* iswm $1-) write -ai truguce.txt $1- - Added $date } 


I'm not sure why you have the -ai switch in the write command, as the -a switch appends the text, and the -i switch inserts the text, both (to my understanding) require a line identification of some kind, which is missing in your write statement.

If you're just wanting to write the information to the file when there's a match, you can remove the -ai switch. Noting as how you're using an * in the match, I'm presuming that you're actually wanting a wildcard match, rather than matching the * as a specific character.

#138004 23/12/05 01:38 AM
Joined: Oct 2005
Posts: 91
T
truguce Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Oct 2005
Posts: 91
Thank you. it works great!


Link Copied to Clipboard