mIRC Home    About    Download    Register    News    Help

Print Thread
A
atticusrex
atticusrex
A
I know there are plenty of these out there right now, but I'm trying to get back into mIRC scripting. Haven't touched it since 1999, lol

Anyway the basic idea of this script is to run on a bot, and users can add quotes to the quote.txt file. Search for keywords to quote a specific user or topic, or randomly quote a line if no search term is given.

There are probably tons of mistakes, but like I said, trying to re-learn. Any help would be greatly appreciated.

on 1:TEXT:*:#: {
if ($1== @quote) {
if ($2 == $null) {
msg $chan $read(quote.txt, $2)
}
if ( $2 isin $read(quote.txt, $2)) {
msg $chan $read(quote.txt, $2)
)
}
}

on 1:TEXT:*:#: {
if ($1 == @addquote) {
/write quote.txt $2
msg $chan [Quote Added]
)
)

on 1:TEXT:*:#: {
if ($1 == @quotenum) {
msg $chan There are $lines(quote.txt) stored
}

Joined: Feb 2011
Posts: 469
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 469
I made it more readable/fixed your syntax issues (you had a few missing { }'s and stuff), I didn't work on anything else.

Code:
on 1:TEXT:*:#: {
  if ($1== @quote) {
    if ($2 == $null) { msg $chan $read(quote.txt, $2) }
    if ($2 isin $read(quote.txt, $2)) { msg $chan $read(quote.txt, $2) }
  }
  if ($1 == @addquote) { write quote.txt $2 | msg $chan [Quote Added] }
  if ($1 == @quotenum) { msg $chan There are $lines(quote.txt) stored }
}


ALWAYS use the n switch with $readini() and $read() !!! Bad things will happen without it.
/help $read

http://www.zigwap.com/mirc/clueless

http://www.msldev.com/

A
atticusrex
atticusrex
A
Ah I figured I was missing something.

Thanks for your time.


Link Copied to Clipboard