mIRC Homepage
Posted By: Canadian Text identifier - 05/07/03 08:02 AM
Hello!
I'm a n00b at this scripting stuff but I one a few things already, I was just woundering where the hell is the text identifier for the text someone just typed in (not me, but someone else)?

(btw, I'm not talking about the "on TEXT" event neither.....)

Thankew
Posted By: SladeKraven Re: Text identifier - 05/07/03 08:09 AM
Remote identifiers.
$0 : Returns the number of space-delimited tokens in the $1- line
$1 : Returns the first word in a line
$2 : Rertuns the second
$3 : Third word
$1- : Returns the whole line
$2- : Returns the whole line after the second word.
/help $1-
Posted By: Canadian Re: Text identifier - 05/07/03 08:25 AM
heh, I knew you were gonna say that. crazy

What I meant was, let's say I got an "on *:TEXT:hello*" in my remote scripts, mkay? Now when that event triggers I want to be able to take the text of the guy who typed, kinda like $nick....comprende?

Thanks again!
Posted By: SladeKraven Re: Text identifier - 05/07/03 08:30 AM
The only thing I can think of is;
Code:
on *:TEXT:hello*:#: { echo -a $nick said: $1- | halt }

confused
Edited as code stretched the page..
Posted By: pheonix Re: Text identifier - 05/07/03 08:31 AM
sladecraven beat me to it grin
Posted By: SladeKraven Re: Text identifier - 05/07/03 08:35 AM
Pheonix dude you kind of spelt my nick wrong again. mad
Edited: Made a word italic to stress a point. grin
Posted By: pheonix Re: Text identifier - 05/07/03 08:35 AM
i edited fast smile
Posted By: Canadian Re: Text identifier - 05/07/03 08:43 AM
Bummer, so there's no way to grab that text eh? That sux. crazy

Anyways, just curious, what does the "halt" do at the end of the coding?... I checked the helpfile but I still don't get it... o_O
Posted By: pheonix Re: Text identifier - 05/07/03 08:45 AM
on *:TEXT:*:#:{
//echo -a $nick said: $1-
}
but sladecraven already said it :tongue:
edit: got it right this time cool
Posted By: SladeKraven Re: Text identifier - 05/07/03 08:47 AM
The /halt command halts a script and stops any further processing.
/help /halt
Posted By: Canadian Re: Text identifier - 05/07/03 08:49 AM
yeh yeh yeh :tongue:

Well I meant so that I can put it in a variable or something to work on it (change it or take a part of it) to form my automatic reply... there must be a way since I see some bots do it often... confused
Posted By: pheonix Re: Text identifier - 05/07/03 08:50 AM
on *:TEXT:*:#:{
.set %text $1-
}
Posted By: Canadian Re: Text identifier - 05/07/03 08:52 AM
not my text!!! the other dude's text into a variable!!!!! shocked
Posted By: pheonix Re: Text identifier - 05/07/03 08:54 AM
that is his text :\
Posted By: SladeKraven Re: Text identifier - 05/07/03 08:55 AM
We just told you how to get the text.
Code:
on *:TEXT:*:#: {
.raw privmsg $me $nick said: $1- in $chr(3) $+ 12 $+ $chan $+ . 
}

That gets the text from a channel you're in. Private messages yourself what someone has said. For example.
(09:52) <Synthet|c> SladeKraven said: Hello in #Infinite-Darkness.
Posted By: Canadian Re: Text identifier - 05/07/03 08:57 AM
oh........ uh....... I knew dat! crazy

Ok good, thanks a bunch. wink
Posted By: pheonix Re: Text identifier - 05/07/03 08:58 AM
np smile
note: if you wanted your text in a variable you use:
on *:INPUT:#:{
.set %text $1-
}
Posted By: SladeKraven Re: Text identifier - 05/07/03 08:59 AM
Your text would be:
Code:
on *:INPUT:#: {
  set %msg $1-
}


The users text would be:
Code:
on *:TEXT:*:#: {
 set %msg $1-
}


/help on TEXT
/help on INPUT
© mIRC Discussion Forums