Advertisement
severen1999

Landail FoodScript

Aug 5th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.57 KB | None | 0 0
  1. ;disabled for the time being as mirc is performing events when they aren't supposed to be called currently.
  2. on 1:LOAD: {
  3.  
  4. ;--------------------------------------------------------------------
  5. ; -
  6. ; set the foodquotes file here and the channel to listen/reply in -
  7. ; -
  8. ;--------------------------------------------------------------------
  9. set %FoodScriptFile landailfoodquotes.txt
  10. set %foodchannel #landail
  11.  
  12.  
  13.  
  14. ;echo using %FoodScriptFile and %foodchannel
  15. ;echo Running the Food Script $Script
  16. }
  17.  
  18. alias -l up return $+($upper($left($1,1)),$mid($1,2))
  19.  
  20. on 1:text:*:%foodchannel: {
  21. echo using %FoodScriptFile and channel %foodchannel
  22. var %file %FoodScriptFile, %x $lines(%file), %y $read(%file, n, $2), %rx $r(1,$lines(%file)), %ry $read(%file, n, %rx)
  23.  
  24. if (!%x && $regex($1,/^!q(del|uote|otd|search|lines|open)$/Si)) {
  25. echo in line 21
  26. msg # There does not appear to be any quotes added yet. | halt
  27. }
  28.  
  29. ;--------------------------------------------------------------------------------------------;
  30. ; !ADDING, DELETING, Quotes. !qadd requires ulevel access 5+ !qdel requires ulevel 10+ ;
  31. ;--------------------------------------------------------------------------------------------;
  32. if ($1 = !foodadd || $1 = !addfood) {
  33. if ($ulevel < 5) {
  34. msg %foodchannel Sorry $nick you need to be a regular to add a quote. | halt
  35. }
  36. if (!$2) {
  37. msg %foodchannel Syntax: $1 Whatever was said. - UserNameHere
  38. echo something called | halt
  39. }
  40. 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 ^_^
  41. set %foodQuoteTotal $lines(%file)
  42. echo food quote total variable count is %foodQuoteTotal . The log read file variable is $lines(%file)
  43. }
  44.  
  45. if ($1 = !fooddel) {
  46. if ($nick !isin %owner) { msg %foodchannel $v1 Only an admin may delete quotes. | halt }
  47. if (!$2) { msg %foodchannel Syntax: $1 [1 - %x $+ ] | halt }
  48. var %i $numtok($2-, 32)
  49. while (%i) { var %list $sorttok($addtok(%list,$gettok($sorttok($2-, 32, n),%i,32),32),32,n) | dec %i }
  50. var %j $numtok(%list, 32)
  51. while (%j) {
  52. if (!$read(%file, n, $gettok(%list,%j,32))) {
  53. msg %foodchannel Quote # $+ $gettok(%list,%j,32) Does not exist. You can select 1 to %x
  54. }
  55. else {
  56. msg %foodchannel Quote $gettok(%list,%j,32) has been removed.
  57. write -dl $gettok(%list,%j,32) %file
  58. }
  59. dec %j
  60. }
  61. }
  62.  
  63. ;------------------------------------------------------------------;
  64. ;MAIN !QUOTE function calls random quote and also specific quotes ;
  65. ;------------------------------------------------------------------;
  66.  
  67. if ($1 = !food) {
  68. echo was food
  69. if ($2 && $2 !isnum) {
  70. msg %foodchannel Syntax: $1 [1 - %x $+ ] | halt
  71. }
  72.  
  73. if ($2 && !%y || $2 < 0) {
  74. msg %foodchannel BibleThump $chr(160) Quote $chr(160) $+ $2 Does not exist. You can select 1 to %x | halt
  75. }
  76.  
  77. if (!$2) {
  78. msg %foodchannel Quote %rx $lower(-) %ry | halt
  79. }
  80. msg %foodchannel Quote $chr(160) $+ $2 - %y | halt
  81. }
  82. }
  83.  
  84.  
  85.  
  86. /*
  87. if ($1 = !food) {
  88. if ($2 && !%y || $2 < 0) msg # BibleThump $chr(160) Quote $chr(160) $+ $2 Does not exist. You can select 1 to %x
  89. ;if ($2 isnum) msg # Quote %rx $lower(-) %ry | halt
  90. if ($2 isnum) msg # Quote %rx $lower(-) %ry | halt
  91. msg # Quote $chr(160) $+ $2 - %y
  92. }
  93. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement