Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:LOAD: {
- echo -a 04Remember that all commands 2nd/3rd parameter are without the < > symbols.
- echo -a The list of commands are as follows:
- echo -a 14!quote <number> <- optional number. This command will display a completely random quote. If a number is supplied it will display the corresponding quote number.
- echo -a 14!addquote <your quote here> This command allows you to add a quote to the database.
- echo -a 14!delquote <number> number = the quote number
- echo -a 14!findquote intext <search paramaters here> . i.e !findquote intext fuck your face
- echo -a 14!quoteban <name here> (bans them from adding quotes only) (( 04Channel ops only ))
- echo -a 14!delquoteban <name here> (removes the ban on their add quote priviledges.) (( 04Channel ops only ))
- echo -a 14!randquote <search params here> (more or less the same as !findquote instead of giving you a list of quote numbers this will auto choose a quote matching your search parameters and display it)
- echo -a 04This script uses the /userip Oper Command. If you are not an IRCop on your network then the !quoteban will not function properly.
- if ($exists(quotes.txt) == $false) {
- write quotes.txt
- }
- }
- #Quotebot on
- raw 340:*: {
- set %nickcheck $gettok($1-,2,64)
- }
- on *:TEXT:*:#gigebox,#calmdown,#blaze.u,#staff,#lobby,#opers,#priv8,#Blame.Ezrie: {
- if ($chan != #torrentleech) {
- if (!%quoteflood) {
- if ($1 == !addquote) && (!$2) {
- set -u3 %quoteflood on
- msg $chan Add a quote idiot.
- }
- if ($1 == !addquote) && ($2) {
- userip $nick
- if (%nickcheck != $readini(quoteban.ini,$chan,$nick)) {
- if ($chr(191) !isin $2-) {
- set -u3 %quoteflood on
- write quotes.txt $2- ¿ Added: $adate ¿ By: $nick
- hadd -sm quotes $calc($hget(quotes,0).item + 1) $2-
- msg $chan 11(14Quote Added: $chr(35) $+ $lines(quotes.txt) $+ 11)
- }
- }
- elseif (%nickcheck == $readini(quoteban.ini,$chan,$nick)) {
- set -u3 %quoteflood on
- echo -a $readini(quoteban.ini,$chan,$nick)
- notice $nick Sorry $nick $+ , You have been banned from using this command.
- }
- else {
- set -u3 %quoteflood on
- msg $chan 04Error: Please try again without " $+ $chr(191) $+ ".
- }
- }
- if ($1 == !quote) && (!$2) {
- set -u3 %quoteflood on
- %rand = $rand(1, $hget(quotes,0).item)
- %item.num = $hget(quotes, %rand).item
- %quote.data = $hget(quotes, %item.num).data
- %quote.num = $hget(quotes,%item.num).item
- msg $chan 09Quote Number11:04 %quote.num $+ %quote.data 14-09 $+($gettok($gettok($read(quotes.txt,n,%quote.num),2,191),1,58),11:07,$gettok($gettok($read(quotes.txt,n,%quote.num),2,191),2,58)) 09 $+($gettok($gettok($read(quotes.txt,n,%quote.num),3,191),1,58),11:07,$gettok($gettok($read(quotes.txt,n,%quote.num),3,191),2,58))
- }
- if ($1 == !quote) && ($2 isnum) {
- set -u3 %quoteflood on
- set -u3 %quote $gettok($read(quotes.txt,n,$2),1,191)
- if (%quote != $null) {
- msg $chan 09Quote Number:04 $2 $+ $gettok($read(quotes.txt,n,$2),1,191) 14-09 $+($gettok($gettok($read(quotes.txt,n,$2),2,191),1,58),11:07,$gettok($gettok($read(quotes.txt,n,$2),2,191),2,58)) 09 $+($gettok($gettok($read(quotes.txt,n,$2),3,191),1,58),11:07,$gettok($gettok($read(quotes.txt,n,$2),3,191),2,58))
- }
- else {
- set -u3 %quoteflood on
- msg $chan 04Error: The quote you specified does not exist.
- }
- }
- if ($1 == !quote) && ($2 != $null) {
- if ($left($2,1) == $chr(35)) {
- var %2 = $remove($2,$chr(35))
- msg $chan 09Quote Number:04 %2 $+ $gettok($read(quotes.txt,n,%2),1,191) 14-09 $+($gettok($gettok($read(quotes.txt,n,%2),2,191),1,58),11:07,$gettok($gettok($read(quotes.txt,n,%2),2,191),2,58)) 09 $+($gettok($gettok($read(quotes.txt,n,%2),3,191),1,58),11:07,$gettok($gettok($read(quotes.txt,n,%2),3,191),2,58))
- }
- if ($2 !isnum) && ($left($2,1) != $chr(35)) {
- msg $chan 09Error11: 07Try 09!randquote $2 07or 09!findquote intext $2 $+ .07 This command only accepts quote numbers.
- }
- }
- if ($1 == !quotehelp) {
- set -u3 %quoteflood on
- .notice $nick 04Remember that all commands 2nd/3rd parameter are without the < > symbols.
- .notice $nick The list of commands are as follows:
- .notice $nick 14!quote <number> <- optional number. This command will display a completely random quote. If a number is supplied it will display the corresponding quote number.
- .notice $nick 14!addquote <your quote here> This command allows you to add a quote to the database.
- .notice $nick 14!delquote <number> number = the quote number
- .notice $nick 14!findquote intext <search paramaters here> . i.e !findquote intext fuck your face
- .notice $nick 14!quoteban <name here> (bans them from adding quotes only) (( 04Channel Owners or Admin only ))
- .notice $nick 14!delquoteban <name here> (removes the ban on their add quote priviledges.) (( 04Channel Owners or Admin only ))
- .notice $nick 14!randquote <search params here> (more or less the same as !findquote instead of giving you a list of quote numbers this will auto choose a quote matching your search parameters and display it)
- }
- if ($1 == !quotes) {
- set -u3 %quoteflood on
- msg $chan There's a total of $lines(quotes.txt) quotes.
- }
- if ($1 == !findquote) && ($2 == intext) && ($3) {
- set -u3 %quoteflood on
- set %chan $chan
- set -u5 %search $3-
- set -u5 %find on
- if ($hget(results,0).item > 0) {
- hfree results
- rsearch
- }
- else {
- rsearch
- }
- }
- if ($1 == !randquote) {
- if ($2) {
- set -u3 %quoteflood on
- unset %qnumber
- set %chan $chan
- set -u5 %search $2-
- if ($hget(results,0).item > 0) {
- hfree results
- rsearch
- }
- else {
- rsearch
- }
- }
- else {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 Please supply a 2nd parameter.
- }
- }
- if ($1 == !findquote) && ($2 == intext) && (!$3) {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 Please supply a 3rd parameter.
- }
- if ($left($nick($chan,$nick).pnick,1) == &) || ($left($nick($chan,$nick).pnick,1) == ~) {
- if ($1 == !delquote) && ($2 isnum) {
- set -u5 %delquote $read(quotes.txt,$2)
- if (%delquote != $null) {
- set -u3 %quoteflood on
- write -dl $2 quotes.txt
- hdel -s quotes $remove($2, $chr(35))
- msg $chan 11(14Quote: $chr(35) $+ $2 Deleted.11)
- }
- else {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 The quote you specified does not exist.
- }
- }
- if ($1 == !delquote) && ($2 !isnum) {
- msg $chan 09Error11:07 Syntax is !delquote 69 (69 = number of the quote)
- }
- if ($1 == !delquote) && (!$2) {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 Syntax is !delquote number
- }
- if ($1 == !quoteban) && (!$2) {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 Please supply a 2nd parameter.
- }
- if ($1 == !quoteban) && ($2) {
- if ($2 != $me) {
- userip $2
- if (%nickcheck != $null) {
- userip $2
- set -u3 %quoteflood on
- writeini quoteban.ini $chan $2 %nickcheck
- notice $nick 14" $+ $2 $+ 's" host was added to quote ban.
- }
- else {
- set -u3 %quoteflood on
- notice $nick Nick: $2 does not exist, please try again.
- }
- }
- if ($1 == !quoteban) && ($2 == $me) {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 You can not ban me from the add quote command.
- }
- }
- if ($1 == !delquoteban) && ($2) {
- userip $2
- if (%nickcheck == $readini(quoteban.ini,$chan,$2)) {
- set -u3 %quoteflood on
- remini quoteban.ini $chan $2
- notice $nick $2 was removed from the quote ban list.
- }
- else {
- set -u3 %quoteflood on
- notice $nick Nick: $2 does not exist, please try again.
- }
- }
- }
- if ($1 == !quoteban) || ($1 == !delquoteban) || ($1 == !delquote) && ($2) && ($nick !isop $chan) {
- set -u3 %quoteflood on
- notice $nick 09Error11:07 You do not have access to this command, $nick $+ .
- }
- }
- }
- unset %quotes
- }
- on *:START: { echo -a 09Loading Quote Data | hmake quotes 100 | %start.load = $ticks | hload -n quotes quotes.txt | quote.table }
- alias quote.table {
- %finish.load = $ticks
- echo -a 09Loaded: $hget(quotes,0).item quotes in $calc(%finish.load - %start.load) ms.
- unset %*.load
- }
- alias get.ids {
- if ($1 == results) && ($2) {
- var %search = $2-
- %ids = 0
- while (%ids <= $hget(results,0).item) {
- var %string = $hget(results,%ids).data
- if ($regex(%string, /(.* %search .*)/i)) {
- ;echo -a Matches: $regml(0) Data: $regml(1)
- echo -a 09Item11:09 ID11:07 %ids 09Quote Number11:04 $hget(results,%ids).item 09Quote11:07 $replace($hget(results,%ids).data, %search, 09 $+ %search $+ 07)
- inc %ids
- }
- inc %ids
- }
- }
- if ($1 == quotes) && ($2) {
- var %search = $2-
- %ids = 0
- while (%ids <= $hget(quotes,0).item) {
- var %string = $hget(quotes,%ids).data
- var %blah = $regex(%string, /(.* %search .*)/i)
- if (%blah > 0) {
- echo -a Matches: $regml(0) Data: $regml(1) 09Item11:09 ID11:07 %ids 09Quote Number11:04 $hget(quotes,%ids).item 09Quote11:07 $replace($hget(quotes,%ids).data, %search, 09 $+ %search $+ 07)
- inc %ids
- }
- inc %ids
- }
- }
- }
- ;echo -a 09Table Entry11: %x 09Quote Number11:04 $hget(quotes,%x).item
- ;echo -a 09Quote11:07 $hget(quotes,%x).data
- // !find quote intext "string" / !randquote "string" search function
- alias rsearch {
- var %x = 0
- ;--------------iterate through quotes table
- while (%x <= $hget(quotes,0).item) {
- ;--------------set string data(the quote text);;;;;;;;;;
- var %string = $hget(quotes,%x).data
- ;--------------perform a regular expression match on the search parameters
- if ($regex(%string, /(.* $+ %search $+ .*)/i)) {
- ;--------------found a match, add it to the results table
- hadd -m results $hget(quotes,%x).item $hget(quotes,%x).data
- ;--------------set quote number and it's item referral
- var %qnumber %qnumber $+($chr(35),$hget(quotes,%x).item,=,%x)
- inc %x
- }
- inc %x
- }
- var %results = 1
- ;--------------iterate through the results table
- while (%results <= $hget(results,0).item) {
- ;--------------set quote number with the # sign for the return values
- set -u3 %quotes %quotes $chr(35) $+ $hget(results, %results).item
- inc %results
- }
- ;--------------sets a random number between 1 and $numtok(%qnumber,32), this variable determines the quote number displayed
- var %rquote = $rand(1,$numtok(%qnumber,32))
- ;--------------this is the item number of the quote in the table
- var %item.no = $gettok($gettok(%qnumber,%rquote,32),2,61)
- ;--------------this is the quote number of the quote in the table
- var %quote.no = $remove($gettok($gettok(%qnumber,%rquote,32),1,61),$chr(35))
- ;--------------this is the quote text
- var %quote = $hget(quotes,%item.no).data
- ;--------------!%find represents the !randquote command used to trigger this script.
- if (!%find) {
- ;--------------found matches for our search parameters...
- if (%quote != $null) {
- ;--------------Display the number of matches found for the search parameters...
- msg $chan 09Found1107 $hget(results,0).item 09entries.
- ;--------------Display the quote details.
- msg $chan 09Quote Number11:04 %quote.no 09Quote11: $replace($gettok(%quote,1,191),%search,09 $+ %search $+ ) $&
- 14-09 $gettok($gettok($read(quotes.txt,%quote.no),2,191),1,58) $+ 11: $+ 07 $+ $gettok($gettok($read(quotes.txt,%quote.no),2,191),2,58) $+ 09 $&
- $gettok($gettok($read(quotes.txt,%quote.no),3,191),1,58) $+ 11:07 $+ $gettok($gettok($read(quotes.txt,%quote.no),3,191),2,58)
- ;--------------determines if more than 1 match was found, if so, notices the requesting nick the quote numbers for the remaining entries matched via the supplied search parameters.
- if ($calc($numtok(%quotes,32) - 1) > 0) {
- ;--------------notices the requesting nick the remaining matches
- .notice $nick 09 $+ $calc($numtok(%quotes,32) - 1) other related entries11:07 $remove(%quotes, $chr(35) $+ %quote.no)
- }
- }
- ;--------------no matches found, error.
- else {
- msg $chan 09Error11:07 There's no quotes containing what you specified.
- unset %quotes
- }
- }
- ;--------------!findquote intext searchparameters command was used.
- else {
- ;--------------found matches for our search parameters
- if (%quote != $null) {
- ;--------------Display result total
- msg $chan 09Found1107 $hget(results,0).item 09entries.
- ;--------------Send quote data
- msg $chan 09Entries11:07 $hget(results,0).item 09Quote Number:04 %quote.no $+ $replace($gettok(%quote,1,191),%search,09 $+ %search $+ ) $&
- 14-09 $gettok($gettok($read(quotes.txt,%quote.no),2,191),1,58) $+ : $+ 07 $+ $gettok($gettok($read(quotes.txt,%quote.no),2,191),2,58) $+ 09 $&
- $gettok($gettok($read(quotes.txt,%quote.no),3,191),1,58) $+ :07 $+ $gettok($gettok($read(quotes.txt,%quote.no),3,191),2,58)
- ;--------------checks if more than 1 result was found.
- if ($calc($numtok(%quotes,32) - 1) > 0) {
- ;--------------notices requesting nick the remaining quote numbers matching our search parameters
- notice $nick 09 $+ $calc($numtok(%quotes,32) - 1) other related entries11:07 $remove(%quotes, $chr(35) $+ %quote.no)
- unset %quotes
- }
- unset %quotes
- }
- ;--------------No matches found, error.
- else {
- ;--------------send error.
- msg $chan 09Error11:07 There's no quotes containing what you specified.
- unset %quotes
- }
- }
- }
- ;<--[ Input commands. Use these to add/delete/quote them yourself. ]-->;
- alias addquote {
- if (!$1) {
- set -u3 %quoteflood on
- echo -a Add a quote idiot.
- }
- if ($1) {
- if ($chr(191) !isin $2-) {
- set -u3 %quoteflood on
- write quotes.txt $1- ¿ Added: $adate ¿ By: $me
- echo -a 11(14Quote Added: $chr(35) $+ $lines(quotes.txt) $+ 11)
- }
- else {
- echo -a 04Error: Please try again without " $+ $chr(191) $+ ".
- }
- }
- }
- alias delquote {
- if ($1) {
- set -u5 %delquote $read(quotes.txt,$1)
- if (%delquote != $null) {
- set -u3 %quoteflood on
- write -dl $1 quotes.txt
- echo -a 11(14Quote: $chr(35) $+ $1 Deleted.11)
- }
- else {
- echo -a 04Error: The quote you specified does not exist.
- }
- }
- }
- /*
- alias quote {
- if (!$1) {
- set -u3 %quoteflood on
- set -u3 %quote $read(quotes.txt)
- %line = $readn
- msg $chan 14Quote Number:04 %line $+ $gettok(%quote,1,191) 14- $gettok(%quote,2,191) $gettok(%quote,3,191)
- unset %line
- }
- if ($1) {
- set -u3 %quoteflood on
- %quote = $gettok($read(quotes.txt,$1),1,191)
- if (%quote != $null) {
- msg $chan 14Quote Number:04 $1 $+ $gettok($read(quotes.txt,$1),1,191) 14- $gettok($read(quotes.txt,$1),2,191) $gettok($read(quotes.txt,$1),3,191)
- }
- else {
- msg $chan 04Error: The quote you specified does not exist.
- }
- }
- }
- */
- #Quotebot end
- on *:INPUT:*: {
- if ($1 == .reload) { timerload -m 1 1 msg $chan 09Loading Quote Data... | timerloaded -m 1 $calc(%finish.load - %start.load) msg $chan 09Loaded: $hget(quotes,0).item quotes in $calc(%finish.load - %start.load) ms. }
- if ($1 == !randquote) {
- if ($2) {
- set -u3 %quoteflood on
- unset %qnumber
- set %chan $chan
- set -u5 %search $2-
- if ($hget(results,0).item > 0) {
- hfree results
- rsearch
- }
- else {
- rsearch
- }
- }
- else {
- set -u3 %quoteflood on
- msg $chan 09Error11:07 Please supply a 2nd parameter.
- }
- }
- if ($1 == !addquote) {
- write quotes.txt $2- ¿ Added: $adate ¿ By: $me
- .timer.msg 1 1 msg $active 11(14Quote Added: $chr(35) $+ $lines(quotes.txt) $+ 11)
- }
- if ($1 == !delquote) {
- write -dl $2 quotes.txt
- .timer.msg 1 1 msg $active 11(14Quote: $chr(35) $+ $2 Deleted.11)
- }
- if ($1 == !quote) {
- if (!$2) {
- set -u3 %quoteflood on
- set -u3 %quote $read(quotes.txt)
- %line = $readn
- .timer.msg 1 1 msg $chan 09Quote Number:04 %line $+ $gettok(%quote,1,191) 14- $gettok(%quote,2,191) $gettok(%quote,3,191)
- unset %line
- }
- if ($2) {
- set -u3 %quoteflood on
- %quote = $gettok($read(quotes.txt,$2),1,191)
- if (%quote != $null) {
- .timer.msg 1 1 msg $chan 09Quote Number:04 $2 $+ $gettok($read(quotes.txt,n,$2),1,191) 14- $gettok($read(quotes.txt,n,$2),2,191) $gettok($read(quotes.txt,n,$2),3,191)
- }
- else {
- .timer.msg 1 1 msg $chan 04Error: The quote you specified does not exist.
- }
- }
- }
- }
- ;IP REGEX: $regex(192.168.0.3, /([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement