Advertisement
Guest User

Untitled

a guest
May 8th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.13 KB | None | 0 0
  1. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;
  2. ;= TL Torrent Announce/Personal Relay Script v1.1 =;
  3. ;= By CastorTroy =;
  4. ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;
  5.  
  6. on *:LOAD: {
  7. if ((%_tfavs) || (%_tcats)) { echo -a TL Torrent Announce/Personal Relay Script Loaded... }
  8. else {
  9. if ($input(Would you like to set your Favorites now?,y)) {
  10. set %_tfavstemp $?="Enter your Favorite Torrents here. Make sure to seperate each Favorite with a (,). Only use spaces in a Fav's name, not between them. (Example: The.Big.Bang.Theory,Chuck 720p HDTV,Family.Guy) This can also be added later with the menu."
  11. $iif(%_tfavstemp == $null,unset %_tfavstemp)
  12. tfavsset %_tfavstemp
  13. }
  14. if ($input(Would you like to set your Favorite Categorys now?,y)) {
  15. set %_tcatstemp $?="Enter your Favorite Categorys here. Make sure to seperate each Category with a (,). Do not use spaces between the Categorys. (Example: Music/Videos,Movies/XViD) This can also be added later with the menu."
  16. $iif(%_tcatstemp == $null,unset %_tcatstemp)
  17. tcatsset %_tcatstemp
  18. }
  19. echo -a TL Torrent Announce / Personal Relay Script Loaded...
  20. }
  21. }
  22.  
  23. on *:UNLOAD: {
  24. if ((%_tfavs) || (%_tcats)) {
  25. if ($input(Would you like to Remove your stored Favorites & Favorite Categorys?,y)) {
  26. unset %_tfavs
  27. unset %_tcats
  28. }
  29. }
  30. $iif(%_twlog,unset %_twlog)
  31. $iif(%_fwlog,unset %_fwlog)
  32. echo -a TL Torrent Announce/Personal Relay Script Unloaded...
  33. }
  34.  
  35.  
  36. on *:TEXT:*:#torrentleech: {
  37. if ($nick == _AnnounceBot_) {
  38. var %_tlmsg = $strip($1-)
  39. if (New Torrent Announcement:* iswm %_tlmsg) {
  40. set %_tlname 3Name: $gettok($1-,2,39)
  41. set %_tlcat 3Category: $remove($4,<,>)
  42. set %_tladd 3URL: $strip($right($gettok($1-,5,39),-2))
  43. window -k[0] @Torrents
  44. echo @Torrents $timestamp [3TL] %_tlname %_tlcat %_tladd
  45. $iif(%_twlog,write $mircdirlogs\TorrentRelay\@torrents.log $timestamp [TL] $strip(%_tlname %_tlcat %_tladd))
  46. }
  47. if (%_tfavs) {
  48. var %a = 1
  49. var %b = $numtok(%_tfavs,44)
  50. while (%a <= %b) {
  51. if ($gettok(%_tfavs,%a,44) iswm %_tlname) { set %_tfavfound $gettok(%_tfavs,%a,44) }
  52. inc %a
  53. }
  54. if (%_tfavfound) {
  55. window -k[0] @FavTorrents
  56. echo @FavTorrents $timestamp [6FavS:3TL] %_tlname %_tlcat %_tladd [6Fav Found:] $+(06,$chr(40),,$remove(%_tfavfound,$chr(42)),06,$chr(41),)
  57. $iif(%_fwlog,write $mircdirlogs\TorrentRelay\@favorites.log $timestamp [FavS:TL] $strip(%_tlname %_tlcat %_tladd) [Fav Found:] $+($chr(40),$remove(%_tfavfound,$chr(42)),$chr(41)))
  58. unset %_tfavfound
  59. }
  60. }
  61. if (%_tcats) {
  62. var %c = 1
  63. var %d = $numtok(%_tcats,44)
  64. while (%c <= %d) {
  65. if ($gettok(%_tcats,%c,44) iswm %_tlcat) { set %_tcatfound $gettok(%_tcats,%c,44) }
  66. inc %c
  67. }
  68. if (%_tcatfound) {
  69. window -k[0] @FavTorrents
  70. echo @FavTorrents $timestamp [6FavS:3TL] %_tlname %_tlcat %_tladd [6Cat Found:] $+(06,$chr(40),,$remove(%_tcatfound,$chr(42)),06,$chr(41),)
  71. $iif(%_fwlog,write $mircdirlogs\TorrentRelay\@favorites.log $timestamp [FavS:TL] $strip(%_tlname %_tlcat %_tladd) [Cat Found:] $+($chr(40),$remove(%_tcatfound,$chr(42)),$chr(41)))
  72. unset %_tcatfound
  73. }
  74. }
  75. unset %_tlname , %_tlcat , %_tladd
  76. }
  77. }
  78.  
  79. ;---Aliases---;
  80.  
  81. alias -l tfavsset {
  82. var %_tfadd = $1-
  83. if (%_tfavs) {
  84. if ($1) {
  85. tfsetchk %_tfadd
  86. if (%_tfdupe) { unset %_tfdupe }
  87. else {
  88. set %_tfavs $+(%_tfavs,$chr(44),$chr(42),$replace(%_tfadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
  89. echo -a $+(",$replace(%_tfadd,$chr(44)," $+ $chr(32) $+ "),") has been added to your Favorites.
  90. }
  91. }
  92. else { echo -a All Favorites unchanged. }
  93. }
  94. else {
  95. if ($1) {
  96. set %_tfavs $+($chr(42),$replace(%_tfadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
  97. $iif(%_tfavstemp,unset %_tfavstemp)
  98. echo -a $+(",$replace(%_tfadd,$chr(44)," $+ $chr(32) $+ "),") has been set to your Favorites.
  99. }
  100. else { echo -a No Favorites were set. }
  101. }
  102. }
  103.  
  104. alias -l tfsetchk {
  105. var %a = 1, %b = $numtok(%_tfavs,44), %c = $+($chr(42),$1,$chr(42))
  106. while (%a <= %b) {
  107. if (%c == $gettok(%_tfavs,%a,44)) {
  108. echo -a That Favorite is already set.
  109. set %_tfdupe 1
  110. }
  111. inc %a
  112. }
  113. }
  114.  
  115. alias -l tfsetchk2 {
  116. if (%_tfavs) {
  117. tfavslist
  118. tfavsset $?="Enter your favorite Torrents here. Make sure to seperate each Fav with a (,). Only use spaces in a Fav's name, not between them. (Example: The.Big.Bang.Theory,Chuck 720p HDTV,Family.Guy)"
  119. }
  120. else { tfavsset $?="Enter your favorite Torrents here. Make sure to seperate each Fav with a (,). Only use spaces in a Fav's name, not between them. (Example: The.Big.Bang.Theory,Chuck 720p HDTV,Family.Guy)" }
  121. }
  122.  
  123. alias -l tfavsdel {
  124. if (%_tfavs) {
  125. if ($1 == _delallfavs) {
  126. unset %_tfavs
  127. echo -a All your Favorites have been removed.
  128. }
  129. else {
  130. if ($1) {
  131. if ($1 isnum) {
  132. if ($1 <= $numtok(%_tfavs,44)) {
  133. var %_tfremove = $iif($1 == 1,$+($gettok(%_tfavs,$1,44),$chr(44)),$+($chr(44),$gettok(%_tfavs,$1,44)))
  134. set %_tfavs $remove(%_tfavs,%_tfremove)
  135. echo -a $+(",$remove(%_tfremove,$chr(44),$chr(42)),") has been removed from the Favorites.
  136. }
  137. else { echo -a $+($chr(35),$1) Favorite does not exists. }
  138. }
  139. else { echo -a You may only use numbers to remove a Favorite. }
  140. }
  141. else { echo -a All Favorites unchanged. }
  142. }
  143. }
  144. else { echo -a You have No Favorites to remove. }
  145. }
  146.  
  147. alias -l tfdelchk {
  148. if (%_tfavs) {
  149. tfavslist
  150. tfavsdel $?="Enter the number of the Favorite you would like to remove."
  151. }
  152. else { echo -a You have No Favorites to remove. }
  153. }
  154.  
  155. alias -l tfavsdelall {
  156. if ($input(Are you sure you want to Remove all your Favorites?,y)) { tfavsdel _delallfavs }
  157. else { echo -a All Favorites unchanged. }
  158. }
  159.  
  160. alias -l tfavslist {
  161. if (%_tfavs) {
  162. echo -a [!] Your Current Favorites. [!]
  163. echo -a [1] $replace($gettok(%_tfavs,1,44),$chr(42),$chr(32))
  164. var %a = 2, %b = $numtok(%_tfavs,44)
  165. if (%b >= 2) {
  166. while (%a <= %b) {
  167. if ($gettok(%_tfavs,0,44) > 1) { echo -a $+($chr(91),%a,$chr(93)) $replace($gettok(%_tfavs,%a,44),$chr(42),$chr(32)) }
  168. inc %a
  169. }
  170. }
  171. }
  172. else { echo -a You have No Favorites to display. }
  173. }
  174.  
  175. alias -l tcatsset {
  176. var %_tcatadd = $1-
  177. if (%_tcats) {
  178. if ($1) {
  179. tcatsetchk %_tcatadd
  180. if (%_tcatdupe) { unset %_tcatdupe }
  181. else {
  182. set %_tcats $+(%_tcats,$chr(44),$chr(42),$replace(%_tcatadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
  183. echo -a $+(",$replace(%_tcatadd,$chr(44)," $+ $chr(32) $+ "),") has been added to your Favorite Categorys.
  184. }
  185. }
  186. else { echo -a All Favorite Categorys unchanged. }
  187. }
  188. else {
  189. if ($1) {
  190. set %_tcats $+($chr(42),$replace(%_tcatadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
  191. $iif(%_tcatstemp,unset %_tcatstemp)
  192. echo -a $+(",$replace(%_tcatadd,$chr(44)," $+ $chr(32) $+ "),") has been set to your Favorite Categorys.
  193. }
  194. else { echo -a No Favorite Categorys were set. }
  195. }
  196. }
  197.  
  198. alias -l tcatsetchk {
  199. var %a = 1, %b = $numtok(%_tcats,44), %c = $+($chr(42),$1,$chr(42))
  200. while (%a <= %b) {
  201. if (%c == $gettok(%_tcats,%a,44)) {
  202. echo -a That Favorite Category is already set.
  203. set %_tcatdupe 1
  204. }
  205. inc %a
  206. }
  207. }
  208.  
  209. alias -l tcatsetchk2 {
  210. if (%_tcats) {
  211. tcatslist
  212. tcatsset $?="Enter your Favorite Categorys here. Make sure to seperate each Category with a (,). Do not use spaces between the Categorys. (Example: Music/Videos,Movies/XViD)"
  213. }
  214. else { tcatsset $?="Enter your Favorite Categorys here. Make sure to seperate each Category with a (,). Do not use spaces between the Categorys. (Example: Music/Videos,Movies/XViD)" }
  215. }
  216.  
  217. alias -l tcatsdel {
  218. if (%_tcats) {
  219. if ($1 == _delallcats) {
  220. unset %_tcats
  221. echo -a All your Favorite Categorys have been removed.
  222. }
  223. else {
  224. if ($1) {
  225. if ($1 isnum) {
  226. if ($1 <= $numtok(%_tcats,44)) {
  227. var %_tcatremove = $iif($1 == 1,$+($gettok(%_tcats,$1,44),$chr(44)),$+($chr(44),$gettok(%_tcats,$1,44)))
  228. set %_tcats $remove(%_tcats,%_tcatremove)
  229. echo -a $+(",$remove(%_tcatremove,$chr(44),$chr(42)),") has been removed from the Favorite Categorys.
  230. }
  231. else { echo -a $+($chr(35),$1) Category does not exists. }
  232. }
  233. else { echo -a You may only use numbers to remove a Favorite Category. }
  234. }
  235. else { echo -a All Favorite Categorys unchanged. }
  236. }
  237. }
  238. else { echo -a You have No Favorite Categorys to remove. }
  239. }
  240.  
  241. alias -l tcatdelchk {
  242. if (%_tcats) {
  243. tcatslist
  244. tcatsdel $?="Enter the number of the Favorite Category you would like to remove."
  245. }
  246. else { echo -a You have No Favorite Categorys to remove. }
  247. }
  248.  
  249. alias -l tcatsdelall {
  250. if ($input(Are you sure you want to Remove all your Favorite Categorys?,y)) { tcatsdel _delallcats }
  251. else { echo -a All Favorite Categorys unchanged. }
  252. }
  253.  
  254. alias -l tcatslist {
  255. if (%_tcats) {
  256. echo -a [!] Your Current Favorite Categorys. [!]
  257. echo -a [1] $replace($gettok(%_tcats,1,44),$chr(42),$chr(32))
  258. var %a = 2, %b = $numtok(%_tcats,44)
  259. if (%b >= 2) {
  260. while (%a <= %b) {
  261. if ($gettok(%_tcats,0,44) > 1) { echo -a $+($chr(91),%a,$chr(93)) $replace($gettok(%_tcats,%a,44),$chr(42),$chr(32)) }
  262. inc %a
  263. }
  264. }
  265. }
  266. else { echo -a You have No Favorite Categorys to display. }
  267. }
  268.  
  269. alias -l twlog {
  270. if ($1 == enable) {
  271. if (%_twlog) { echo -a Torrent Window Logging is already Enabled. }
  272. else {
  273. $iif(!$exists($mircdirlogs\TorrentRelay),mkdir $mircdirlogs\TorrentRelay)
  274. set %_twlog on
  275. echo -a Torrent Window Logging is now Enabled.
  276. }
  277. }
  278. if ($1 == disable) {
  279. if (%_twlog) {
  280. unset %_twlog
  281. echo -a Torrent Window Logging is now Disabled.
  282. }
  283. else { echo -a Torrent Window Logging is already Disabled. }
  284. }
  285. if ($1 == show) {
  286. if (%_twlog) {
  287. if ($exists($mircdirlogs\TorrentRelay\@torrents.log)) { run $mircdirlogs\TorrentRelay\@torrents.log }
  288. else { echo -a There is No log to display.
  289. }
  290. }
  291. else { echo -a Torrent Window Logging is currently Disabled. }
  292. }
  293. if ($1 == delete) {
  294. if (%_twlog) {
  295. if ($exists($mircdirlogs\TorrentRelay\@torrents.log)) {
  296. if ($input(Are you sure you want to Delete this log?,y)) {
  297. .remove -b $mircdirlogs\TorrentRelay\@torrents.log
  298. echo -a Torrent Window Log Deleted.
  299. }
  300. else { echo -a Torrent Window Log unchanged. }
  301. }
  302. else { echo -a There is No log to delete. }
  303. }
  304. else { echo -a Torrent Window Logging is currently Disabled. }
  305. }
  306. }
  307.  
  308. alias -l fwlog {
  309. if ($1 == enable) {
  310. if (%_fwlog) { echo -a Favorites Window Logging is already Enabled. }
  311. else {
  312. $iif(!$exists($mircdirlogs\TorrentRelay),mkdir $mircdirlogs\TorrentRelay)
  313. set %_fwlog on
  314. echo -a Favorites Window Logging is now Enabled.
  315. }
  316. }
  317. if ($1 == disable) {
  318. if (%_fwlog) {
  319. unset %_fwlog
  320. echo -a Favorites Window Logging is now Disabled.
  321. }
  322. else { echo -a Favorites Window Logging is already Disabled. }
  323. }
  324. if ($1 == show) {
  325. if (%_fwlog) {
  326. if ($exists($mircdirlogs\TorrentRelay\@favorites.log)) { run $mircdirlogs\TorrentRelay\@favorites.log }
  327. else { echo -a There is No log to display. }
  328. }
  329. else { echo -a Favorites Window Logging is currently Disabled. }
  330. }
  331. if ($1 == delete) {
  332. if (%_fwlog) {
  333. if ($exists($mircdirlogs\TorrentRelay\@favorites.log)) {
  334. if ($input(Are you sure you want to Delete this log?,y)) {
  335. .remove -b $mircdirlogs\TorrentRelay\@favorites.log
  336. echo -a Favorites Window Log Deleted.
  337. }
  338. else { echo -a Favorites Window Log unchanged. }
  339. }
  340. else { echo -a There is No log to delete. }
  341. }
  342. else { echo -a Favorites Window Logging is currently Disabled. }
  343. }
  344. }
  345.  
  346. ;---Aliases-End---;
  347.  
  348. ;---Menu---;
  349.  
  350. menu channel,menubar {
  351. -
  352. TL Personal Relay
  353. .Favorites
  354. ..Add a Favorite:tfsetchk2
  355. ..Remove a Favotite:tfdelchk
  356. ..Remove all Favorites:tfavsdelall
  357. ..Show Favorites:tfavslist
  358. .Categorys
  359. ..Add a Category:tcatsetchk2
  360. ..Remove a Category:tcatdelchk
  361. ..Remove all Categorys:tcatsdelall
  362. ..Show Categorys:tcatslist
  363. .Logging
  364. ..Torrent Window Logging $+($chr(91),$iif(%_twlog,On,Off),$chr(93))
  365. ...Enable Logging:twlog enable
  366. ...Disable Logging:twlog disable
  367. ...Show Log:twlog show
  368. ...Delete Log:twlog delete
  369. ..Favorites Window Logging $+($chr(91),$iif(%_fwlog,On,Off),$chr(93))
  370. ...Enable Logging:fwlog enable
  371. ...Disable Logging:fwlog disable
  372. ...Show Log:fwlog show
  373. ...Delete Log:fwlog delete
  374. -
  375. }
  376.  
  377. ;---Menu-End---;
  378.  
  379. ;---End-Of-Script---;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement