Doopian

Guitar Hero Song Request Bot REMOTE TAB CODE

Jan 25th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.21 KB | None | 0 0
  1. /*
  2. Created by Doopian
  3. Version 1.0
  4. Date Updated: January 25th, 2016
  5. */
  6.  
  7.  
  8. on *:TEXT:!songs:#: {
  9. if (%songstimer == 0) {
  10. if (%SongsLink == $null) {
  11. msg $chan I don't have a link to a list of songs $nick
  12. }
  13. else {
  14. msg $chan The songs you can request are found here %SongsLink
  15. }
  16.  
  17. %songstimer = 1
  18. .timer 1 10 set %songstimer 0
  19. }
  20. }
  21.  
  22.  
  23. on *:TEXT:!currentsong:#: {
  24. if (%currenttimer == 0) {
  25. var %songname $readini(SongRequests.ini, n, Songs, 0)
  26. var %user $readini(UserRequests.ini, n, Users, 0)
  27.  
  28. if (%songname != $null) {
  29. msg $chan " %songname " requested by %user is the current song.
  30. }
  31. else {
  32. msg $chan there are no songs left on the list. Type !request to request a song.
  33. }
  34.  
  35. %currenttimer = 1
  36. .timer 1 10 set %currenttimer 0
  37. }
  38. }
  39.  
  40.  
  41. on *:TEXT:!nextsong:#: {
  42. if (%nexttimer == 0) {
  43. var %songname $readini(SongRequests.ini, n, Songs, 1)
  44. var %user $readini(UserRequests.ini, n, Users, 1)
  45.  
  46. if (%songname != $null) {
  47. msg $chan " %songname " requested by %user is the next song.
  48. }
  49. else {
  50. msg $chan there is no next song. type !request to get your song on the list.
  51. }
  52.  
  53. %nexttimer = 1
  54. .timer 1 10 set %nexttimer 0
  55. }
  56. }
  57.  
  58.  
  59. on 3:TEXT:!resetsongs:#: {
  60. /remini SongRequests.ini Songs
  61. /remini UserRequests.ini Users
  62. %totalsongs = 0
  63. msg $chan songs have been reset.
  64. }
  65.  
  66.  
  67. on *:TEXT:!request*:#: {
  68. if ($2- == $null) {
  69. msg $chan please add a song name $nick
  70. }
  71. elseif ($2- isnum) {
  72. msg $chan you can not request numbers $nick
  73. }
  74. elseif (%totalsongs >= %TotalSongLimit) {
  75. msg $chan the song list is currently full $nick
  76. }
  77. elseif ($len($2-) > %SongLengthLimit) {
  78. msg $chan that song name too long $nick
  79. }
  80. elseif ($countRequest(SongRequests.ini, Songs, $2-) >= %SongRequestLimit) {
  81. msg $chan that song is already on the list $nick
  82. }
  83. elseif ($countRequest(UserRequests.ini, Users, $nick) >= %UserRequestLimit) {
  84. msg $chan you already have a song on the list $nick
  85. }
  86. else {
  87. var %song $2-
  88. writeini -n SongRequests.ini Songs %totalsongs %song
  89. writeini -n UserRequests.ini Users %totalsongs $nick
  90. %totalsongs = $calc(%totalsongs + 1)
  91. msg $chan The song " %song " has been added to the list $nick
  92. }
  93. }
  94.  
  95.  
  96. /*
  97. Removes the first song on the list (song currently being played)
  98. */
  99. on 3:TEXT:!pop:#: {
  100. $removeRequest(SongRequests.ini, Songs, 0)
  101. $removeRequest(UserRequests.ini, Users, 0)
  102.  
  103. %totalsongs = $calc(%totalsongs - 1)
  104.  
  105. var %next $readini(SongRequests.ini, n, Songs, 0)
  106. var %user $readini(UserRequests.ini, n, Users, 0)
  107.  
  108. if (%next == $null) {
  109. msg $chan there are no songs left on the list. Type !request to request a song.
  110. }
  111. else {
  112. msg $chan the next song is " %next " requested by %user
  113. }
  114. }
  115.  
  116.  
  117. /*
  118. Removes a target song from the list (takes numbers starting at 1 or takes the song title)
  119. */
  120. on *:TEXT:!remove*:#: {
  121. if ($nick isop #) {
  122. if ($2- isnum) {
  123. var %index $2-
  124. if (%index < 1 || %index > %totalsongs) {
  125. msg $chan that is not a song's spot on the list $nick
  126. }
  127. elseif (. isin %index) {
  128. msg $chan don't use decimals $nick
  129. }
  130. else {
  131. var %actualIndex $calc(%index - 1)
  132. var %songname $readini(SongRequests.ini, n, Songs, %actualIndex)
  133. $removeRequest(UserRequests.ini, Users, %actualIndex)
  134. $removeRequest(SongRequests.ini, Songs, %actualIndex)
  135. %totalsongs = $calc(%totalsongs - 1)
  136.  
  137. msg $chan " %songname " has been removed from the list $nick
  138. }
  139. }
  140. elseif ($2- == $null) {
  141. msg $chan please use a song number or song title to remove $nick
  142. }
  143. else {
  144. var %index $findNum($2-)
  145.  
  146. if (%index == -1) {
  147. msg $chan Couldn't find that song $nick
  148. }
  149. else {
  150. $removeRequest(UserRequests.ini, Users, %actualIndex)
  151. $removeRequest(SongRequests.ini, Songs, %index)
  152. %totalsongs = $calc(%totalsongs - 1)
  153. msg $chan " $2- " has been removed from the list $nick
  154. }
  155. }
  156. }
  157. }
  158.  
  159.  
  160. on *:TEXT:!change*:#: {
  161. if ($nick isop #) {
  162. if ($2 isnum) {
  163. var %index $2
  164. if (%index < 1 || %index > %totalsongs) {
  165. msg $chan that is not a song's spot on the list $nick
  166. }
  167. elseif (. isin %index) {
  168. msg $chan don't use decimals $nick
  169. }
  170. else {
  171. var %actualIndex $calc(%index - 1)
  172. var %songname $readini(SongRequests.ini, n, Songs, %actualIndex)
  173. writeini -n SongRequests.ini Songs %actualindex $3-
  174.  
  175. msg $chan $nick has changed " %songname " has been changed to " $3- "
  176. }
  177. }
  178. }
  179. }
  180.  
  181.  
  182. on *:TEXT:!list:#: {
  183. if (%listtimer == 0) {
  184. var %count 0
  185. var %output The song list is
  186. %output = %output $+ $chr(32) $+ $chr(32)
  187.  
  188. while (%count < %totalsongs) {
  189. var %song $readini(SongRequests.ini, Songs, %count)
  190.  
  191. if (%count == $calc(%totalsongs - 1)) {
  192. %output = %output $+ %song $+ $chr(46) $+ $chr(32) $+ $chr(32)
  193. }
  194. else {
  195. %output = %output $+ %song $+ $chr(44) $+ $chr(32) $+ $chr(32)
  196. }
  197.  
  198. %count = $calc(%count + 1)
  199. }
  200.  
  201. msg $chan %output
  202.  
  203. %listtimer = 1
  204. .timer 1 10 set %listtimer 0
  205. }
  206. }
  207.  
  208.  
  209. alias findNum {
  210. var %count 0
  211. var %target $1
  212.  
  213. while (%count < %totalsongs) {
  214. var %tempSong $readini(SongRequests.ini, n, Songs, %count)
  215.  
  216. if (%tempSong == %target) {
  217. return %count
  218. }
  219.  
  220. %count = $calc(%count + 1)
  221. }
  222.  
  223. return -1
  224. }
  225.  
  226.  
  227. alias countRequest {
  228. var %count 0
  229. var %repeats 0
  230.  
  231. while (%count < %totalsongs) {
  232. if ($readini($1, n, $2, %count) == $3) {
  233. inc %repeats
  234. }
  235. %count = $calc(%count + 1)
  236. }
  237. return %repeats
  238. }
  239.  
  240.  
  241. alias removeRequest {
  242. var %count 0
  243. var %found 0
  244. var %target $3
  245.  
  246. while (%count < %totalsongs) {
  247. if (%found == 1) {
  248. var %beforeCount $calc(%count - 1)
  249. var %tempsong $readini($1, n, $2, %count)
  250. writeini -n $1 $2 %beforeCount %tempsong
  251. }
  252.  
  253. if (%count == %target) {
  254. /remini $1 $2 %count
  255. %found = 1
  256. }
  257.  
  258. %count = $calc(%count + 1)
  259. }
  260.  
  261. /remini $1 $2 $calc(%count - 1)
  262. }
Advertisement
Add Comment
Please, Sign In to add comment