Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;disabled for the time being as mirc is performing events when they aren't supposed to be called currently.
- on 1:LOAD: {
- ;--------------------------------------------------------------------
- ; -
- ; set the foodquotes file here and the channel to listen/reply in -
- ; -
- ;--------------------------------------------------------------------
- set %FoodScriptFile landailfoodquotes.txt
- set %foodchannel #landail
- ;echo using %FoodScriptFile and %foodchannel
- ;echo Running the Food Script $Script
- }
- alias -l up return $+($upper($left($1,1)),$mid($1,2))
- on 1:text:*:%foodchannel: {
- echo using %FoodScriptFile and channel %foodchannel
- var %file %FoodScriptFile, %x $lines(%file), %y $read(%file, n, $2), %rx $r(1,$lines(%file)), %ry $read(%file, n, %rx)
- if (!%x && $regex($1,/^!q(del|uote|otd|search|lines|open)$/Si)) {
- echo in line 21
- msg # There does not appear to be any quotes added yet. | halt
- }
- ;--------------------------------------------------------------------------------------------;
- ; !ADDING, DELETING, Quotes. !qadd requires ulevel access 5+ !qdel requires ulevel 10+ ;
- ;--------------------------------------------------------------------------------------------;
- if ($1 = !foodadd || $1 = !addfood) {
- if ($ulevel < 5) {
- msg %foodchannel Sorry $nick you need to be a regular to add a quote. | halt
- }
- if (!$2) {
- msg %foodchannel Syntax: $1 Whatever was said. - UserNameHere
- echo something called | halt
- }
- tokenize 59 $2- | write %file $+($up($1),) $asctime(mmmm $+(dd,$chr(44)) yyyy) | var %x $lines(%file) | msg %foodchannel thanks for the mmmmmm mmmmmm quote number %x ^_^
- set %foodQuoteTotal $lines(%file)
- echo food quote total variable count is %foodQuoteTotal . The log read file variable is $lines(%file)
- }
- if ($1 = !fooddel) {
- if ($nick !isin %owner) { msg %foodchannel $v1 Only an admin may delete quotes. | halt }
- if (!$2) { msg %foodchannel Syntax: $1 [1 - %x $+ ] | halt }
- var %i $numtok($2-, 32)
- while (%i) { var %list $sorttok($addtok(%list,$gettok($sorttok($2-, 32, n),%i,32),32),32,n) | dec %i }
- var %j $numtok(%list, 32)
- while (%j) {
- if (!$read(%file, n, $gettok(%list,%j,32))) {
- msg %foodchannel Quote # $+ $gettok(%list,%j,32) Does not exist. You can select 1 to %x
- }
- else {
- msg %foodchannel Quote $gettok(%list,%j,32) has been removed.
- write -dl $gettok(%list,%j,32) %file
- }
- dec %j
- }
- }
- ;------------------------------------------------------------------;
- ;MAIN !QUOTE function calls random quote and also specific quotes ;
- ;------------------------------------------------------------------;
- if ($1 = !food) {
- echo was food
- if ($2 && $2 !isnum) {
- msg %foodchannel Syntax: $1 [1 - %x $+ ] | halt
- }
- if ($2 && !%y || $2 < 0) {
- msg %foodchannel BibleThump $chr(160) Quote $chr(160) $+ $2 Does not exist. You can select 1 to %x | halt
- }
- if (!$2) {
- msg %foodchannel Quote %rx $lower(-) %ry | halt
- }
- msg %foodchannel Quote $chr(160) $+ $2 - %y | halt
- }
- }
- /*
- if ($1 = !food) {
- if ($2 && !%y || $2 < 0) msg # BibleThump $chr(160) Quote $chr(160) $+ $2 Does not exist. You can select 1 to %x
- ;if ($2 isnum) msg # Quote %rx $lower(-) %ry | halt
- if ($2 isnum) msg # Quote %rx $lower(-) %ry | halt
- msg # Quote $chr(160) $+ $2 - %y
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement