mIRC Home    About    Download    Register    News    Help

Print Thread
O
OverDrive
OverDrive
O
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?

R
realillusion
realillusion
R
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. :-)

O
OverDrive
OverDrive
O
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?

D
demitrix
demitrix
D

O
OverDrive
OverDrive
O
Thank you, i guess i'll have to parse your script to figure it out, but thanks

S
shidi
shidi
S
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

H
Hendon
Hendon
H
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
}
}

Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
If you had read, they say OD too.

D
demitrix
demitrix
D
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

Joined: May 2003
Posts: 215
L
Fjord artisan
Offline
Fjord artisan
L
Joined: May 2003
Posts: 215
Wouldn't it be even easier to use mIRC's internal highlighting function?


Link Copied to Clipboard