Advertisement
Bradmasta

New code Kappa

Nov 2nd, 2015
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.58 KB | None | 0 0
  1. ------------------------Queue's up the list----------------------
  2.  
  3.  
  4.  
  5. on *:text:!qs:#: {
  6. window -h @. | var %i 1
  7. while $ini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%i) {
  8. var %n $v1
  9. aline @. $gettok($remove(%n,[,]),2,46) $readini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%i)
  10. inc %i
  11. }
  12. var %i 1 | while %i <= 15 {
  13. var %list $addtok(%list,$line(@.,%i),44)
  14. inc %i
  15. }
  16. msg $chan The queue is: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
  17. window -c @.
  18. }
  19.  
  20.  
  21.  
  22. -----------------my index feature------------------------------
  23. on *:text:!find*:#: {
  24.  
  25.  
  26. var %read_text = $read(%file_search, nr, $2-)
  27. var %file_search = C:\Users\Brad\Desktop\Songlist\index.txt
  28. var %read_text2 = $read(%file_search)
  29. var %command = !find
  30. var %read_text3 = $read(%file_search, nr, $2-)
  31. if ($1 == %command) && (%read_text3) {
  32. msg $chan The index for %read_text3 is $readn
  33. }
  34. elseif ($1 == %command) && (%read_text3 == $null) {
  35. msg $chan Unfortunately that doesn't exist on my list :( Also, make sure you're search with all lowercase letters!
  36. }
  37. elseif ($1 != %command) {
  38. msg $chan That isn't the correct format! Make sure to type in the command in the correct format of !as [x] where [x] is the number.
  39. }
  40. else {
  41. msg $chan test
  42. }
  43. }
  44.  
  45.  
  46. ---------------------my change song feature---------------------------
  47. on 2:text:!e*:#: {
  48.  
  49. var %song $3
  50. %song = $readini(%songfile, $3, name)
  51. var %songID = $readini(%songfile, $3, name)
  52. var %Ident = $readini(%songfile, $3, Identifier)
  53. var %file_search = C:\Users\Brad\Desktop\Songlist\Songs.txt
  54. var %file_search4 = C:\Users\Brad\Desktop\Songlist\Instantqueue2.txt
  55. var %artistID = $readini(%songfile, $3, artist)
  56. var %songstring = %ident %songID %artistID
  57. var %songstring2 = %ident %songID
  58. var %command = !e
  59. var %songchange = $read(%file_Search,r,%songstring)
  60. var %songchange2 = $2
  61. var %songchange3 = $calc($2 - 1)
  62. var %isqueue = $readini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%songchange2)
  63. var %read_text2 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,1)
  64. var %read_text5 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,2)
  65. var %read_text6 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,%songchange)
  66. var %read_text3 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,1)
  67. var %read_text7 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,%songchange3)
  68. var %read_text8 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,%songchange2)
  69. var %read_text9 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,w,%songstring)
  70. var %file_search3 = C:\Users\Brad\Desktop\Songlist\Songqueue.ini
  71. var %read_text4 $read(%file_Search,r,%songstring)
  72.  
  73. if ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) = 0) && ($lines(%instantqueue2) = 0) {
  74. msg $chan There are no songs to change.
  75. }
  76. elseif ($1 == %command) && ($2 > 15) {
  77. msg $chan There are only at most 15 songs to change! The format is "!c [x] [z]" Where [x] is the line being changed and [z] is the song you're changing to
  78. }
  79. elseif ($1 == %command) && (%songID == $null) {
  80. msg $chan This song doesn't exist!
  81. }
  82. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text7) && (%read_text9 != $null) {
  83. if ($2 > 4) {
  84.  
  85. msg $chan There can only be 3 instant queued songs total, and trying to change a non-instant queued song to an instant queue song past spot 4 (in this instance) messes up the system!
  86.  
  87. }
  88.  
  89. elseif ($2 == 1) {
  90. msg $chan In this instance you can't change the first song! only the 2nd, 3rd, and 4th spot can be changed!
  91. }
  92. else {
  93. var %i 1
  94. while (%i <= $lines(C:\Users\Brad\Desktop\Songlist\Songs.txt)) {
  95. if ($read(C:\Users\Brad\Desktop\Songlist\Songs.txt,%i) == %songstring) { /write -dl $+ %i C:\Users\Brad\Desktop\Songlist\Songs.txt }
  96. inc %i
  97. }
  98. var %q 1
  99. while $ini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%q) {
  100. if ($readini(%file_search3,Songs,%q) == %songstring2) {
  101. remini -n %file_search3 Songs %q
  102. }
  103. inc %q
  104. }
  105. msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
  106. writeini -n %file_search3 Songs $2 %songstring2
  107. write -dl $+ $calc($2 - 1) %file_search4
  108. write -il $+ $calc($2 - 1) %file_search4 %ident %songID
  109. write -dl $+ $2 %file_search
  110. write -il $+ $2 %file_search %songstring
  111. dec %newsongsID 1
  112.  
  113. }
  114.  
  115.  
  116. }
  117. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text7) {
  118.  
  119. if ($2 > 4) {
  120.  
  121. msg $chan There can only be 3 instant queued songs total, and trying to change a non-instant queued song to an instant queue song past spot 4 (in this instance) messes up the system!
  122.  
  123. }
  124.  
  125. elseif ($2 == 1) {
  126. msg $chan In this instance you can't change the first song! only the 2nd, 3rd, and 4th spot can be changed!
  127. }
  128. else {
  129.  
  130. msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
  131. writeini -n %file_search3 Songs $2 %songstring2
  132. write -dl $+ $calc($2 - 1) %file_search4
  133. write -il $+ $calc($2 - 1) %file_search4 %ident %songID
  134. write -dl $+ $2 %file_search
  135. write -il $+ $2 %file_search %songstring
  136.  
  137. }
  138.  
  139. }
  140.  
  141. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text8) && (read_text9 != $null) {
  142.  
  143. if ($2 > 3) {
  144.  
  145. msg $chan There can only be 3 instant queued songs total, and trying to change a non-instant queued song to an instant queue song past spot 3 (in this instance) messes up the system!
  146.  
  147. }
  148. else {
  149. var %i 1
  150. while (%i <= $lines(C:\Users\Brad\Desktop\Songlist\Songs.txt)) {
  151. if ($read(C:\Users\Brad\Desktop\Songlist\Songs.txt,%i) == %songstring) { /write -dl $+ %i C:\Users\Brad\Desktop\Songlist\Songs.txt }
  152. inc %i
  153. }
  154. var %q 1
  155. while $ini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%q) {
  156. if ($readini(%file_search3,Songs,%q) == %songstring2) {
  157. remini -n %file_search3 Songs %q
  158. }
  159. inc %q
  160. }
  161.  
  162. msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
  163. writeini -n %file_search3 Songs $2 %songstring2
  164. write -dl $+ $2 %file_search4
  165. write -il $+ $2 %file_search4 %ident %songID
  166. write -dl $+ $2 %file_search
  167. write -il $+ $2 %file_search %songstring
  168. dec %newsongsID 1
  169.  
  170. }
  171.  
  172. }
  173.  
  174. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text8) {
  175.  
  176. if ($2 > 3) {
  177.  
  178. msg $chan There can only be 3 instant queued songs total, and trying to change a non-instant queued song to an instant queue song past spot 3 (in this instance) messes up the system!
  179.  
  180. }
  181. else {
  182. msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
  183. writeini -n %file_search3 Songs $2 %songstring2
  184. write -dl $+ $2 %file_search4
  185. write -il $+ $2 %file_search4 %ident %songID
  186. write -dl $+ $2 %file_search
  187. write -il $+ $2 %file_search %songstring
  188.  
  189. }
  190.  
  191. }
  192. elseif ($1 == %command) && (%songchange) {
  193. msg $chan you can't change to a song that's already on the list!
  194. }
  195.  
  196. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) >= 1) {
  197.  
  198. msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
  199. writeini -n %file_search3 Songs $2 %songstring2
  200. write -dl $+ $2 %file_search
  201. write -il $+ $2 %file_search %songstring
  202.  
  203. }
  204.  
  205. else {
  206.  
  207. msg $chan Something went wrong! Check the formatting and try again :)
  208.  
  209.  
  210.  
  211. }
  212.  
  213. }
  214.  
  215. ----------------my new removal system-------------------------
  216.  
  217. on 2:text:!r*:#: {
  218. var %song $2
  219. %song = $readini(%songfile, $2, name)
  220. var %songID = $readini(%songfile, $2, name)
  221. var %Ident = $readini(%songfile, $2, Identifier)
  222. var %file_search = C:\Users\Brad\Desktop\Songlist\Songs.txt
  223. var %points = $readini(%pointsfile, $findIDID($1), name)
  224. var %command = !r
  225. var %artistID = $readini(%songfile, $2, artist)
  226. var %songstring = %ident %songID %artistID
  227. var %songstring2 = %songID
  228. var %isqueue = $readini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,1)
  229. %symbols = ,
  230. var %read_text $read(C:\Users\Brad\Desktop\Songlist\Songqueue.txt)
  231. var %read_text2 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,1)
  232. var %read_text5 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,2)
  233. var %read_text3 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,1)
  234. var %file_search3 = C:\Users\Brad\Desktop\Songlist\Songqueue.ini
  235. var %read_text4 $read(%file_Search,r,%songstring)
  236. var %delete $remove(%read_text, %song, %ident, %symbols )
  237.  
  238. if ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) = 0) && ($lines(%instantqueue2) = 0) {
  239. msg $chan There are no songs on the queue.
  240. }
  241. elseif ($2 > 15) {
  242. msg $chan There are only at most 15 songs on the queue! The number after "r" represents the place in the queue the song is. Example, the song being played currently is first, so to remove it, you would use "!r 1"
  243. }
  244. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text3) {
  245.  
  246. var %fixini 1
  247. write -dl $+ $2 C:\Users\Brad\Desktop\Songlist\Songs.txt
  248. write -dl $+ $2 C:\Users\Brad\Desktop\Songlist\instantqueue2.txt
  249. remini -n %file_search3 songs $2
  250. window -h @fixini
  251. loadbuf -rt @fixini %file_Search3
  252. savebuf @fixini C:\Users\Brad\Desktop\Songlist\fixini.txt
  253. remini %file_search3 Songs
  254. write -dl1 C:\Users\Brad\Desktop\Songlist\fixini.txt
  255. while (%fixini <= $lines(C:\Users\Brad\Desktop\Songlist\fixini.txt)) {
  256. writeini -n %file_search3 Songs %fixini $gettok($read(C:\Users\Brad\Desktop\Songlist\fixini.txt,n,%fixini),2,61)
  257. inc %fixini
  258. }
  259. .remove C:\Users\Brad\Desktop\Songlist\fixini.txt
  260. dec %newsongsID 1
  261. window -c @fixini
  262. msg $chan removing the song off the queue. The current song now is $read(C:\Users\Brad\Desktop\Songlist\songs.txt,n,1)
  263. }
  264.  
  265.  
  266. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) {
  267.  
  268. var %fixini 1
  269. write -dl $+ $2 C:\Users\Brad\Desktop\Songlist\Songs.txt
  270. remini -n %file_search3 songs $2
  271. window -a @fixini
  272. loadbuf -rt @fixini %file_Search3
  273. savebuf @fixini C:\Users\Brad\Desktop\Songlist\fixini.txt
  274. remini %file_search3 Songs
  275. write -dl1 C:\Users\Brad\Desktop\Songlist\fixini.txt
  276. while (%fixini <= $lines(C:\Users\Brad\Desktop\Songlist\fixini.txt)) {
  277. writeini -n %file_search3 Songs %fixini $gettok($read(C:\Users\Brad\Desktop\Songlist\fixini.txt,n,%fixini),2,61)
  278. inc %fixini
  279. }
  280. .remove C:\Users\Brad\Desktop\Songlist\fixini.txt
  281. dec %newsongsID 1
  282. window -c @fixini
  283. msg $chan removing the song off the queue. The current song is $read(C:\Users\Brad\Desktop\Songlist\songs.txt,n,1)
  284. }
  285.  
  286.  
  287. elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) == 1) {
  288. write -dl1 C:\Users\Brad\Desktop\Songlist\Songs.txt
  289. remini %file_search3 Songs 1
  290. dec %newsongsID 1
  291. msg $chan removing the top song off the queue. There are no more songs on the queue!
  292.  
  293. }
  294.  
  295. elseif ($1 != %command) {
  296. msg $chan That isn't formatted correctly! Make sure to type in the command in the correct format of !r [x] where [x] is the number.
  297. }
  298. else {
  299. msg $chan Something went wrong! Check the formatting and try again :)
  300. }
  301. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement