mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2003
Posts: 19
O
Pikka bird
OP Offline
Pikka bird
O
Joined: Jan 2003
Posts: 19
My nick on IRC is OverDrive (obviously) and some people call me OD. I have various away modes i go into, all starting out with OD-Is-*busy*Away*Working* etc

I currently have this

On 1:TEXT:*:#: {
if ($findtok($remove($strip($1-),$chr(33),$chr(44),$chr(46),$chr(63),$chr(58),$chr(39),$chr(34),$chr(40),$chr(41),$chr(60),$chr(62)),$me,1,32) isnum) {
if ($active != $chan) {
echo -a 01,08NICKNAME ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
echo $chan 01,08NICKNAME ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
else {
echo $active 01,08IN-CHANNEL ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
}
if (OverDrive isin $1-) {
if ($active != $chan) {
echo -a 01,08OverDrive-ALERT $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
echo $chan 01,08OverDrive-ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
else {
echo $active 01,08OverDrive-ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
}

if (OD isin $1-) {
;echo -a word $matchtok($1-,OD,1,32)
;echo -a lenght of word $len($matchtok($1-,OD,1,32))
echo -a $matchtok($1-,od,32)
if ($active != $chan) {
echo -a 01,00OD-ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
echo $chan 01,00OD-ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
else {
echo $active 01,00OD-ALERT $chr(91) $+ $atime $+ $chr(93) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
}
}


It works perfectly for the OverDrive and Nickname alert, but I'm having a bit of trouble figuring out how to fix the OD alert. OD is used in a lot of words, such as god and good, and a few others. What I'd like it to do is find the first word in the line that has OD in it, and if either an ' or s is right after.

I am not too good with $gettok and those commands and im trying to understand them and how to use them but i cant figure it out... that and the $right and $left and $mid.

Can someone help me please?

Joined: Aug 2003
Posts: 3
R
Self-satisified door
Offline
Self-satisified door
R
Joined: Aug 2003
Posts: 3
You should just use the same format...

if ($findtok($remove($strip($1-),[all your punctuation here]),OD,1,32) isnum)

$findtok() does not return any match for something like:
$findtok(god is good,od,1,32)
because "od" is not a token in "god is good." To be a token, "od" has to have the delimeter (or either the end or beginning of the string) on both sides of it...
" od "
That's why it's a good idea to remove punctuation. :-)

Joined: Jan 2003
Posts: 19
O
Pikka bird
OP Offline
Pikka bird
O
Joined: Jan 2003
Posts: 19
That catches OD now, thanks
Now the problem is that some users use the possessive of OD (OD's and the lazy way of ODs)

ODs i can just repeat the same proessess you did with another if statement, but what about OD's?

Can i get some help with that?

Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67


while (demi == nub) {
inc %skill
}
Joined: Jan 2003
Posts: 19
O
Pikka bird
OP Offline
Pikka bird
O
Joined: Jan 2003
Posts: 19
Thank you, i guess i'll have to parse your script to figure it out, but thanks

Joined: Aug 2003
Posts: 2
S
Bowl of petunias
Offline
Bowl of petunias
S
Joined: Aug 2003
Posts: 2
isn't it be much easier to use:

on 1:text:*:#:if ($me isin $1-) { echo -a *** Your Name Being Called By $nick at $chan } smirk


SiLVeR sCoRpIo iNc. RepReSenT
Joined: Jan 2003
Posts: 28
H
Ameglian cow
Offline
Ameglian cow
H
Joined: Jan 2003
Posts: 28
Something along those lines..

on *:TEXT:*:#:{
if ($me isin $1-) && ($active != $target) {
splay $mircdirscript/ssounds/nickiscalled.wav
echo -a 12Your nick 4( $+ $me $+ ) has been mentioned by $nick on 6>> $chan <<
}
if ($me isin $1-) && ($active = $target) {
splay $mircdirscript/ssounds/nickiscalled.wav
}
}


===================================
Live my life for a day.. I'll show you where I've been.
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
If you had read, they say OD too.

Joined: Jun 2003
Posts: 67
D
Babel fish
Offline
Babel fish
D
Joined: Jun 2003
Posts: 67
my scripts uses a tokeninzed string to hold any words u want highlighted. also has ignore work (so taht jimbob isnt highlighted cause of bob etc) and ignore channels. plus it logs, timestmaps, beeps


while (demi == nub) {
inc %skill
}
Joined: May 2003
Posts: 215
Fjord artisan
Offline
Fjord artisan
Joined: May 2003
Posts: 215
Wouldn't it be even easier to use mIRC's internal highlighting function?


- Jason

Link Copied to Clipboard