Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------Queue's up the list----------------------
- on *:text:!qs:#: {
- window -h @. | var %i 1
- while $ini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%i) {
- var %n $v1
- aline @. $gettok($remove(%n,[,]),2,46) $readini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%i)
- inc %i
- }
- var %i 1 | while %i <= 15 {
- var %list $addtok(%list,$line(@.,%i),44)
- inc %i
- }
- msg $chan The queue is: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
- window -c @.
- }
- -----------------my index feature------------------------------
- on *:text:!find*:#: {
- var %read_text = $read(%file_search, nr, $2-)
- var %file_search = C:\Users\Brad\Desktop\Songlist\index.txt
- var %read_text2 = $read(%file_search)
- var %command = !find
- var %read_text3 = $read(%file_search, nr, $2-)
- if ($1 == %command) && (%read_text3) {
- msg $chan The index for %read_text3 is $readn
- }
- elseif ($1 == %command) && (%read_text3 == $null) {
- msg $chan Unfortunately that doesn't exist on my list :( Also, make sure you're search with all lowercase letters!
- }
- elseif ($1 != %command) {
- 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.
- }
- else {
- msg $chan test
- }
- }
- ---------------------my change song feature---------------------------
- on 2:text:!e*:#: {
- var %song $3
- %song = $readini(%songfile, $3, name)
- var %songID = $readini(%songfile, $3, name)
- var %Ident = $readini(%songfile, $3, Identifier)
- var %file_search = C:\Users\Brad\Desktop\Songlist\Songs.txt
- var %file_search4 = C:\Users\Brad\Desktop\Songlist\Instantqueue2.txt
- var %artistID = $readini(%songfile, $3, artist)
- var %songstring = %ident %songID %artistID
- var %songstring2 = %ident %songID
- var %command = !e
- var %songchange = $read(%file_Search,r,%songstring)
- var %songchange2 = $2
- var %songchange3 = $calc($2 - 1)
- var %isqueue = $readini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%songchange2)
- var %read_text2 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,1)
- var %read_text5 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,2)
- var %read_text6 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,%songchange)
- var %read_text3 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,1)
- var %read_text7 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,%songchange3)
- var %read_text8 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,%songchange2)
- var %read_text9 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,w,%songstring)
- var %file_search3 = C:\Users\Brad\Desktop\Songlist\Songqueue.ini
- var %read_text4 $read(%file_Search,r,%songstring)
- if ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) = 0) && ($lines(%instantqueue2) = 0) {
- msg $chan There are no songs to change.
- }
- elseif ($1 == %command) && ($2 > 15) {
- 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
- }
- elseif ($1 == %command) && (%songID == $null) {
- msg $chan This song doesn't exist!
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text7) && (%read_text9 != $null) {
- if ($2 > 4) {
- 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!
- }
- elseif ($2 == 1) {
- msg $chan In this instance you can't change the first song! only the 2nd, 3rd, and 4th spot can be changed!
- }
- else {
- var %i 1
- while (%i <= $lines(C:\Users\Brad\Desktop\Songlist\Songs.txt)) {
- if ($read(C:\Users\Brad\Desktop\Songlist\Songs.txt,%i) == %songstring) { /write -dl $+ %i C:\Users\Brad\Desktop\Songlist\Songs.txt }
- inc %i
- }
- var %q 1
- while $ini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%q) {
- if ($readini(%file_search3,Songs,%q) == %songstring2) {
- remini -n %file_search3 Songs %q
- }
- inc %q
- }
- msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
- writeini -n %file_search3 Songs $2 %songstring2
- write -dl $+ $calc($2 - 1) %file_search4
- write -il $+ $calc($2 - 1) %file_search4 %ident %songID
- write -dl $+ $2 %file_search
- write -il $+ $2 %file_search %songstring
- dec %newsongsID 1
- }
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text7) {
- if ($2 > 4) {
- 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!
- }
- elseif ($2 == 1) {
- msg $chan In this instance you can't change the first song! only the 2nd, 3rd, and 4th spot can be changed!
- }
- else {
- msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
- writeini -n %file_search3 Songs $2 %songstring2
- write -dl $+ $calc($2 - 1) %file_search4
- write -il $+ $calc($2 - 1) %file_search4 %ident %songID
- write -dl $+ $2 %file_search
- write -il $+ $2 %file_search %songstring
- }
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text8) && (read_text9 != $null) {
- if ($2 > 3) {
- 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!
- }
- else {
- var %i 1
- while (%i <= $lines(C:\Users\Brad\Desktop\Songlist\Songs.txt)) {
- if ($read(C:\Users\Brad\Desktop\Songlist\Songs.txt,%i) == %songstring) { /write -dl $+ %i C:\Users\Brad\Desktop\Songlist\Songs.txt }
- inc %i
- }
- var %q 1
- while $ini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,%q) {
- if ($readini(%file_search3,Songs,%q) == %songstring2) {
- remini -n %file_search3 Songs %q
- }
- inc %q
- }
- msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
- writeini -n %file_search3 Songs $2 %songstring2
- write -dl $+ $2 %file_search4
- write -il $+ $2 %file_search4 %ident %songID
- write -dl $+ $2 %file_search
- write -il $+ $2 %file_search %songstring
- dec %newsongsID 1
- }
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text8) {
- if ($2 > 3) {
- 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!
- }
- else {
- msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
- writeini -n %file_search3 Songs $2 %songstring2
- write -dl $+ $2 %file_search4
- write -il $+ $2 %file_search4 %ident %songID
- write -dl $+ $2 %file_search
- write -il $+ $2 %file_search %songstring
- }
- }
- elseif ($1 == %command) && (%songchange) {
- msg $chan you can't change to a song that's already on the list!
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) >= 1) {
- msg $chan $readini(%file_search3, Songs, $2) has been changed to %songstring2
- writeini -n %file_search3 Songs $2 %songstring2
- write -dl $+ $2 %file_search
- write -il $+ $2 %file_search %songstring
- }
- else {
- msg $chan Something went wrong! Check the formatting and try again :)
- }
- }
- ----------------my new removal system-------------------------
- on 2:text:!r*:#: {
- var %song $2
- %song = $readini(%songfile, $2, name)
- var %songID = $readini(%songfile, $2, name)
- var %Ident = $readini(%songfile, $2, Identifier)
- var %file_search = C:\Users\Brad\Desktop\Songlist\Songs.txt
- var %points = $readini(%pointsfile, $findIDID($1), name)
- var %command = !r
- var %artistID = $readini(%songfile, $2, artist)
- var %songstring = %ident %songID %artistID
- var %songstring2 = %songID
- var %isqueue = $readini(C:\Users\Brad\Desktop\Songlist\Songqueue.ini,Songs,1)
- %symbols = ,
- var %read_text $read(C:\Users\Brad\Desktop\Songlist\Songqueue.txt)
- var %read_text2 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,1)
- var %read_text5 $read(C:\Users\Brad\Desktop\Songlist\Songs.txt,n,2)
- var %read_text3 $read(C:\Users\Brad\Desktop\Songlist\instantqueue2.txt,n,1)
- var %file_search3 = C:\Users\Brad\Desktop\Songlist\Songqueue.ini
- var %read_text4 $read(%file_Search,r,%songstring)
- var %delete $remove(%read_text, %song, %ident, %symbols )
- if ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) = 0) && ($lines(%instantqueue2) = 0) {
- msg $chan There are no songs on the queue.
- }
- elseif ($2 > 15) {
- 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"
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) && (%isqueue == %read_text3) {
- var %fixini 1
- write -dl $+ $2 C:\Users\Brad\Desktop\Songlist\Songs.txt
- write -dl $+ $2 C:\Users\Brad\Desktop\Songlist\instantqueue2.txt
- remini -n %file_search3 songs $2
- window -h @fixini
- loadbuf -rt @fixini %file_Search3
- savebuf @fixini C:\Users\Brad\Desktop\Songlist\fixini.txt
- remini %file_search3 Songs
- write -dl1 C:\Users\Brad\Desktop\Songlist\fixini.txt
- while (%fixini <= $lines(C:\Users\Brad\Desktop\Songlist\fixini.txt)) {
- writeini -n %file_search3 Songs %fixini $gettok($read(C:\Users\Brad\Desktop\Songlist\fixini.txt,n,%fixini),2,61)
- inc %fixini
- }
- .remove C:\Users\Brad\Desktop\Songlist\fixini.txt
- dec %newsongsID 1
- window -c @fixini
- msg $chan removing the song off the queue. The current song now is $read(C:\Users\Brad\Desktop\Songlist\songs.txt,n,1)
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) > 1) {
- var %fixini 1
- write -dl $+ $2 C:\Users\Brad\Desktop\Songlist\Songs.txt
- remini -n %file_search3 songs $2
- window -a @fixini
- loadbuf -rt @fixini %file_Search3
- savebuf @fixini C:\Users\Brad\Desktop\Songlist\fixini.txt
- remini %file_search3 Songs
- write -dl1 C:\Users\Brad\Desktop\Songlist\fixini.txt
- while (%fixini <= $lines(C:\Users\Brad\Desktop\Songlist\fixini.txt)) {
- writeini -n %file_search3 Songs %fixini $gettok($read(C:\Users\Brad\Desktop\Songlist\fixini.txt,n,%fixini),2,61)
- inc %fixini
- }
- .remove C:\Users\Brad\Desktop\Songlist\fixini.txt
- dec %newsongsID 1
- window -c @fixini
- msg $chan removing the song off the queue. The current song is $read(C:\Users\Brad\Desktop\Songlist\songs.txt,n,1)
- }
- elseif ($1 == %command) && ($lines(C:\Users\Brad\Desktop\Songlist\Songs.txt) == 1) {
- write -dl1 C:\Users\Brad\Desktop\Songlist\Songs.txt
- remini %file_search3 Songs 1
- dec %newsongsID 1
- msg $chan removing the top song off the queue. There are no more songs on the queue!
- }
- elseif ($1 != %command) {
- 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.
- }
- else {
- msg $chan Something went wrong! Check the formatting and try again :)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement