Requested by yna.
Basically a mIRC version of the TCL script I posted.
Triggers are:
!Quote - Will notice the user.
@Quote - Will message the channel if the user has HalfOps or higher.
/EchoQuote - Must be typed from the client that has the script loaded and will echo back to the active screen.
To use this script: Load into Remotes,Right click Channel or Status Window and turn the Quote Trigger On.
Example Output:
13:30:26 <RiverChigger> Searching for your Quote. Please wait........
13:30:29 <RiverChigger> If I ever get real rich I hope I`m not real mean to poor people like I am now. y Jack Handey
;Random Quote Bot Script by Ford_Lawnmower irc.Geekshed.net #Script-Help
menu Channel,Status {
.$iif($group(#Quote) == On,$style(1)) Quote Trigger
..$iif($group(#Quote) == On,$style(2)) On: .enable #Quote
..$iif($group(#Quote) == Off,$style(2)) Off: .disable #Quote
}
#Quote on
On $*:Text:/^(!|@)Quote/Si:#: {
if ($timer($+(Quote,$network,$nick))) { return }
.timer $+ $+(Quote,$network,$nick) 1 6 noop
var %method $iif($regml(1) == !,.notice $nick,$iif($regex($nick($chan,$nick).pnick,/(!|~|&|@|%)/),.msg $chan,.notice $nick))
Quote %method $2-
}
#Quote end
alias EchoQuote { Quote echo -a $1- }
alias -l Quote {
$1-2 Searching for your Quote. Please wait........
var %sockname $+(Quote,$network,$2,$ticks)
sockopen %sockname www.quotedb.com 80
sockmark %sockname $1-2 /quote/quote.php?action=random_quote&=&=&
}
On *:sockopen:Quote*: {
if (!$sockerr) {
sockwrite -nt $sockname GET $gettok($sock($sockname).mark,3,32) HTTP/1.0
sockwrite -n $sockname Host: www.quotedb.com
sockwrite -n $sockname $crlf
}
else { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
}
On *:sockread:Quote*: {
if ($sockerr) { echo -st Socket Error $nopath($script) | sockclose $sockname | return }
else {
var %Quote | sockread %Quote
if ($regex(%Quote,/document\.write\('(.*)<br>/i))) { sockmark $sockname $addtok($sock($sockname).mark,$regml(1),32) }
if ($regex(%Quote,/<a\shref="http.*">(.*)<\/a>/i)) {
put $gettok($sock($sockname).mark,1-2,32) $+(07,$gettok($sock($sockname).mark,4-,32)) by04 $regml(1)
sockclose $sockname
return
}
}
}
alias -l Put {
if (!$regex($1,/(\.|^)(msg|notice|echo)$/Si)) || (!$3) { echo -st **Put error** Syntax /Put msg #channel text - or - /Put notice nickname text | return }
tokenize 32 $regsubex($1-,/([$\|%\[\]\}\{][^\s]*)/g,$+($chr(2),$chr(2),\t))
var %tokens $0, %Tstart 3, %Dtimer 1500
if ($timer($+(Put,$2,$network)).secs) { %Dtimer = $calc($v1 * 1000) }
while ($len($($+($,%Tstart,-,%tokens),2)) > 430) {
dec %tokens
if ($len($($+($,%Tstart,-,%tokens),2)) <= 430) {
.timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
inc %Dtimer 1500
%Tstart = $calc(%tokens + 1)
%tokens = $0
}
}
.timer -m 1 %Dtimer $1-2 $($+($,%Tstart,-,%tokens),2))
.timer $+ $+(Put,$2,$network) -m 1 $calc(%Dtimer + 1500) noop
}
It's not going to work from here ;/
The site is removing the
tag from the code.
It will work if you get the code from here: http://pastebin.com/1JursB8e
Thanks <3
and if you have the time then you can remove these
/ thingies in the results:
@Quote
(Jun-Wed-27)(1:10:32:pm) <05&Pyro> Trouble shared is trouble halved.
'); More quotes from Dorothy Sayers'); by04 Dorothy Sayers
I had to upgrade my mIRC anyways, so I took the drastic step to upgrade it to the latest... 7.22
I now use FordLawnmowers Pandora bot script, and it works perfectly, without any problems
However... I might go test-drive this script anyway and drop the Pandora one, simply because those bots are a bit too 'present' and too 'loud' to my liking...
@FordLawnmower... Thanks man, for your efforts to provide us simple 'users' the possibility of using those handy and nifty scripts! Even just reading the comment section on your Pandora script is worth the time! Soooo funny! ;)
@blackvenomm666... Thanks for the help! ...and kind offer!
Loaded the code in my bots remotes, turned it on in the channel richt-click menu.
Triggered it in the channel, using ' !quote ' and just like expected it returned a notice:
Searching for your Quote. Please wait........
but the second line, the quote itself did not come!
In the bots statuswindow it said:
* /timer: timer 1 not active
-
NOOP Unknown command
-
NOOP Unknown command
-
I wonder what it could be!
Did i do something wrong, or does this script need updating?
Can anyone help me with this?
Thanks for all the kind comments everyone.
I'm very happy to be a part of the Hawkee community.
I totally understand that it is the same freedom that gives someone the right to rate scripts with a 1 that makes this site such a wonderful place.
There is no way that I would trade that freedom for a higher score :)
That's very, very ignorant of them to engage in such behavior. But don't sweat over it, Fordlawnmower, the score is only a number; what really matters is you make a GREAT, respectable script, and that's what counts! You will always have my support. Keep up the good work. Let those rascals play with the "rate" tab and see how boring they can get.
But why would ppl do that? Sorry to seem naive, but if I see a good, well executed script I love to give it props. Let's face it, the differences between a quality script and a crappy script is very obvious.
Anyway, man, don't worry about it. You know you do good work and the people that matter know also.