I stumbled on the lmgtfy.com Smart As* link the other day, so I decided to script it for cases when people are Obviously just to lazy to use their own Google.
Syntax is !Obvious search words here.
The trigger is on by default. You can turn it off from the Status or Channel window.
Halfops or higher to use the trigger.
To see what it does click HERE
;Mr Obvious Google Search Script by Ford_Lawnmower -- irc.mindforge.org #USA-Chat
menu Channel,Status {
.$iif($group(#Obvious) == On,$style(1)) Mr. Obvious Trigger
..$iif($group(#Obvious) == On,$style(2)) On: .enable #Obvious
..$iif($group(#Obvious) == Off,$style(2)) Off: .disable #Obvious
}
#Obvious on
On *:Text:!Obvious *:#: {
if ($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/)) {
if (!$timer($+(Obvious,$network,$nick))) {
.timer $+ $+(Obvious,$network,$nick) 1 4 noop
.msg $chan You will find the answer here: $+(,http://lmgtfy.com/?q=,$replace($2-,$chr(32),+))
}
}
}
#Obvious end
I have chatzilla as my accoung (lamb-chop) and then an mIRC account with my bot (lambchopisawesome) Now I think the thing is: I don't know how to load them, what I do is make a .txt file that's .mcr.txt then save it with the script. Then go on lambchopisawesome and say /load -rs (script).mcr.txt. Is this the wrong way of doing it?
Thanks GrimReaper & Ghost-writer :)
Thanks WorldDMT :) Good to see you back.
I like the timer method that I use, although I would consider changing it if there were a convincing resource usage argument. I don't know that there is much difference in memory usage for a timer v/s a timed variable.
Mine does execute the noop command but a timed variable has to unset itself, so I think that is a wash.
I also don't think there is a difference between "if (!%var)" and "if ($timer(timername))".
I could be wrong though. I don't really know quite as much as I should about the inner workings of mIRC's Scripting engine.
After looking at this the last few minutes, I did realize that there was no reason for the { return } crap. So I changed it to if (!$timer(timername)) { }