Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;
- ;= TL Torrent Announce/Personal Relay Script v1.1 =;
- ;= By CastorTroy =;
- ;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;
- on *:LOAD: {
- if ((%_tfavs) || (%_tcats)) { echo -a TL Torrent Announce/Personal Relay Script Loaded... }
- else {
- if ($input(Would you like to set your Favorites now?,y)) {
- 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."
- $iif(%_tfavstemp == $null,unset %_tfavstemp)
- tfavsset %_tfavstemp
- }
- if ($input(Would you like to set your Favorite Categorys now?,y)) {
- 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."
- $iif(%_tcatstemp == $null,unset %_tcatstemp)
- tcatsset %_tcatstemp
- }
- echo -a TL Torrent Announce / Personal Relay Script Loaded...
- }
- }
- on *:UNLOAD: {
- if ((%_tfavs) || (%_tcats)) {
- if ($input(Would you like to Remove your stored Favorites & Favorite Categorys?,y)) {
- unset %_tfavs
- unset %_tcats
- }
- }
- $iif(%_twlog,unset %_twlog)
- $iif(%_fwlog,unset %_fwlog)
- echo -a TL Torrent Announce/Personal Relay Script Unloaded...
- }
- on *:TEXT:*:#torrentleech: {
- if ($nick == _AnnounceBot_) {
- var %_tlmsg = $strip($1-)
- if (New Torrent Announcement:* iswm %_tlmsg) {
- set %_tlname 3Name: $gettok($1-,2,39)
- set %_tlcat 3Category: $remove($4,<,>)
- set %_tladd 3URL: $strip($right($gettok($1-,5,39),-2))
- window -k[0] @Torrents
- echo @Torrents $timestamp [3TL] %_tlname %_tlcat %_tladd
- $iif(%_twlog,write $mircdirlogs\TorrentRelay\@torrents.log $timestamp [TL] $strip(%_tlname %_tlcat %_tladd))
- }
- if (%_tfavs) {
- var %a = 1
- var %b = $numtok(%_tfavs,44)
- while (%a <= %b) {
- if ($gettok(%_tfavs,%a,44) iswm %_tlname) { set %_tfavfound $gettok(%_tfavs,%a,44) }
- inc %a
- }
- if (%_tfavfound) {
- window -k[0] @FavTorrents
- echo @FavTorrents $timestamp [6FavS:3TL] %_tlname %_tlcat %_tladd [6Fav Found:] $+(06,$chr(40),,$remove(%_tfavfound,$chr(42)),06,$chr(41),)
- $iif(%_fwlog,write $mircdirlogs\TorrentRelay\@favorites.log $timestamp [FavS:TL] $strip(%_tlname %_tlcat %_tladd) [Fav Found:] $+($chr(40),$remove(%_tfavfound,$chr(42)),$chr(41)))
- unset %_tfavfound
- }
- }
- if (%_tcats) {
- var %c = 1
- var %d = $numtok(%_tcats,44)
- while (%c <= %d) {
- if ($gettok(%_tcats,%c,44) iswm %_tlcat) { set %_tcatfound $gettok(%_tcats,%c,44) }
- inc %c
- }
- if (%_tcatfound) {
- window -k[0] @FavTorrents
- echo @FavTorrents $timestamp [6FavS:3TL] %_tlname %_tlcat %_tladd [6Cat Found:] $+(06,$chr(40),,$remove(%_tcatfound,$chr(42)),06,$chr(41),)
- $iif(%_fwlog,write $mircdirlogs\TorrentRelay\@favorites.log $timestamp [FavS:TL] $strip(%_tlname %_tlcat %_tladd) [Cat Found:] $+($chr(40),$remove(%_tcatfound,$chr(42)),$chr(41)))
- unset %_tcatfound
- }
- }
- unset %_tlname , %_tlcat , %_tladd
- }
- }
- ;---Aliases---;
- alias -l tfavsset {
- var %_tfadd = $1-
- if (%_tfavs) {
- if ($1) {
- tfsetchk %_tfadd
- if (%_tfdupe) { unset %_tfdupe }
- else {
- set %_tfavs $+(%_tfavs,$chr(44),$chr(42),$replace(%_tfadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
- echo -a $+(",$replace(%_tfadd,$chr(44)," $+ $chr(32) $+ "),") has been added to your Favorites.
- }
- }
- else { echo -a All Favorites unchanged. }
- }
- else {
- if ($1) {
- set %_tfavs $+($chr(42),$replace(%_tfadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
- $iif(%_tfavstemp,unset %_tfavstemp)
- echo -a $+(",$replace(%_tfadd,$chr(44)," $+ $chr(32) $+ "),") has been set to your Favorites.
- }
- else { echo -a No Favorites were set. }
- }
- }
- alias -l tfsetchk {
- var %a = 1, %b = $numtok(%_tfavs,44), %c = $+($chr(42),$1,$chr(42))
- while (%a <= %b) {
- if (%c == $gettok(%_tfavs,%a,44)) {
- echo -a That Favorite is already set.
- set %_tfdupe 1
- }
- inc %a
- }
- }
- alias -l tfsetchk2 {
- if (%_tfavs) {
- tfavslist
- 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)"
- }
- 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)" }
- }
- alias -l tfavsdel {
- if (%_tfavs) {
- if ($1 == _delallfavs) {
- unset %_tfavs
- echo -a All your Favorites have been removed.
- }
- else {
- if ($1) {
- if ($1 isnum) {
- if ($1 <= $numtok(%_tfavs,44)) {
- var %_tfremove = $iif($1 == 1,$+($gettok(%_tfavs,$1,44),$chr(44)),$+($chr(44),$gettok(%_tfavs,$1,44)))
- set %_tfavs $remove(%_tfavs,%_tfremove)
- echo -a $+(",$remove(%_tfremove,$chr(44),$chr(42)),") has been removed from the Favorites.
- }
- else { echo -a $+($chr(35),$1) Favorite does not exists. }
- }
- else { echo -a You may only use numbers to remove a Favorite. }
- }
- else { echo -a All Favorites unchanged. }
- }
- }
- else { echo -a You have No Favorites to remove. }
- }
- alias -l tfdelchk {
- if (%_tfavs) {
- tfavslist
- tfavsdel $?="Enter the number of the Favorite you would like to remove."
- }
- else { echo -a You have No Favorites to remove. }
- }
- alias -l tfavsdelall {
- if ($input(Are you sure you want to Remove all your Favorites?,y)) { tfavsdel _delallfavs }
- else { echo -a All Favorites unchanged. }
- }
- alias -l tfavslist {
- if (%_tfavs) {
- echo -a [!] Your Current Favorites. [!]
- echo -a [1] $replace($gettok(%_tfavs,1,44),$chr(42),$chr(32))
- var %a = 2, %b = $numtok(%_tfavs,44)
- if (%b >= 2) {
- while (%a <= %b) {
- if ($gettok(%_tfavs,0,44) > 1) { echo -a $+($chr(91),%a,$chr(93)) $replace($gettok(%_tfavs,%a,44),$chr(42),$chr(32)) }
- inc %a
- }
- }
- }
- else { echo -a You have No Favorites to display. }
- }
- alias -l tcatsset {
- var %_tcatadd = $1-
- if (%_tcats) {
- if ($1) {
- tcatsetchk %_tcatadd
- if (%_tcatdupe) { unset %_tcatdupe }
- else {
- set %_tcats $+(%_tcats,$chr(44),$chr(42),$replace(%_tcatadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
- echo -a $+(",$replace(%_tcatadd,$chr(44)," $+ $chr(32) $+ "),") has been added to your Favorite Categorys.
- }
- }
- else { echo -a All Favorite Categorys unchanged. }
- }
- else {
- if ($1) {
- set %_tcats $+($chr(42),$replace(%_tcatadd,$chr(44),$chr(42) $+ $chr(44) $+ $chr(42),$chr(32),$chr(42)),$chr(42))
- $iif(%_tcatstemp,unset %_tcatstemp)
- echo -a $+(",$replace(%_tcatadd,$chr(44)," $+ $chr(32) $+ "),") has been set to your Favorite Categorys.
- }
- else { echo -a No Favorite Categorys were set. }
- }
- }
- alias -l tcatsetchk {
- var %a = 1, %b = $numtok(%_tcats,44), %c = $+($chr(42),$1,$chr(42))
- while (%a <= %b) {
- if (%c == $gettok(%_tcats,%a,44)) {
- echo -a That Favorite Category is already set.
- set %_tcatdupe 1
- }
- inc %a
- }
- }
- alias -l tcatsetchk2 {
- if (%_tcats) {
- tcatslist
- 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)"
- }
- 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)" }
- }
- alias -l tcatsdel {
- if (%_tcats) {
- if ($1 == _delallcats) {
- unset %_tcats
- echo -a All your Favorite Categorys have been removed.
- }
- else {
- if ($1) {
- if ($1 isnum) {
- if ($1 <= $numtok(%_tcats,44)) {
- var %_tcatremove = $iif($1 == 1,$+($gettok(%_tcats,$1,44),$chr(44)),$+($chr(44),$gettok(%_tcats,$1,44)))
- set %_tcats $remove(%_tcats,%_tcatremove)
- echo -a $+(",$remove(%_tcatremove,$chr(44),$chr(42)),") has been removed from the Favorite Categorys.
- }
- else { echo -a $+($chr(35),$1) Category does not exists. }
- }
- else { echo -a You may only use numbers to remove a Favorite Category. }
- }
- else { echo -a All Favorite Categorys unchanged. }
- }
- }
- else { echo -a You have No Favorite Categorys to remove. }
- }
- alias -l tcatdelchk {
- if (%_tcats) {
- tcatslist
- tcatsdel $?="Enter the number of the Favorite Category you would like to remove."
- }
- else { echo -a You have No Favorite Categorys to remove. }
- }
- alias -l tcatsdelall {
- if ($input(Are you sure you want to Remove all your Favorite Categorys?,y)) { tcatsdel _delallcats }
- else { echo -a All Favorite Categorys unchanged. }
- }
- alias -l tcatslist {
- if (%_tcats) {
- echo -a [!] Your Current Favorite Categorys. [!]
- echo -a [1] $replace($gettok(%_tcats,1,44),$chr(42),$chr(32))
- var %a = 2, %b = $numtok(%_tcats,44)
- if (%b >= 2) {
- while (%a <= %b) {
- if ($gettok(%_tcats,0,44) > 1) { echo -a $+($chr(91),%a,$chr(93)) $replace($gettok(%_tcats,%a,44),$chr(42),$chr(32)) }
- inc %a
- }
- }
- }
- else { echo -a You have No Favorite Categorys to display. }
- }
- alias -l twlog {
- if ($1 == enable) {
- if (%_twlog) { echo -a Torrent Window Logging is already Enabled. }
- else {
- $iif(!$exists($mircdirlogs\TorrentRelay),mkdir $mircdirlogs\TorrentRelay)
- set %_twlog on
- echo -a Torrent Window Logging is now Enabled.
- }
- }
- if ($1 == disable) {
- if (%_twlog) {
- unset %_twlog
- echo -a Torrent Window Logging is now Disabled.
- }
- else { echo -a Torrent Window Logging is already Disabled. }
- }
- if ($1 == show) {
- if (%_twlog) {
- if ($exists($mircdirlogs\TorrentRelay\@torrents.log)) { run $mircdirlogs\TorrentRelay\@torrents.log }
- else { echo -a There is No log to display.
- }
- }
- else { echo -a Torrent Window Logging is currently Disabled. }
- }
- if ($1 == delete) {
- if (%_twlog) {
- if ($exists($mircdirlogs\TorrentRelay\@torrents.log)) {
- if ($input(Are you sure you want to Delete this log?,y)) {
- .remove -b $mircdirlogs\TorrentRelay\@torrents.log
- echo -a Torrent Window Log Deleted.
- }
- else { echo -a Torrent Window Log unchanged. }
- }
- else { echo -a There is No log to delete. }
- }
- else { echo -a Torrent Window Logging is currently Disabled. }
- }
- }
- alias -l fwlog {
- if ($1 == enable) {
- if (%_fwlog) { echo -a Favorites Window Logging is already Enabled. }
- else {
- $iif(!$exists($mircdirlogs\TorrentRelay),mkdir $mircdirlogs\TorrentRelay)
- set %_fwlog on
- echo -a Favorites Window Logging is now Enabled.
- }
- }
- if ($1 == disable) {
- if (%_fwlog) {
- unset %_fwlog
- echo -a Favorites Window Logging is now Disabled.
- }
- else { echo -a Favorites Window Logging is already Disabled. }
- }
- if ($1 == show) {
- if (%_fwlog) {
- if ($exists($mircdirlogs\TorrentRelay\@favorites.log)) { run $mircdirlogs\TorrentRelay\@favorites.log }
- else { echo -a There is No log to display. }
- }
- else { echo -a Favorites Window Logging is currently Disabled. }
- }
- if ($1 == delete) {
- if (%_fwlog) {
- if ($exists($mircdirlogs\TorrentRelay\@favorites.log)) {
- if ($input(Are you sure you want to Delete this log?,y)) {
- .remove -b $mircdirlogs\TorrentRelay\@favorites.log
- echo -a Favorites Window Log Deleted.
- }
- else { echo -a Favorites Window Log unchanged. }
- }
- else { echo -a There is No log to delete. }
- }
- else { echo -a Favorites Window Logging is currently Disabled. }
- }
- }
- ;---Aliases-End---;
- ;---Menu---;
- menu channel,menubar {
- -
- TL Personal Relay
- .Favorites
- ..Add a Favorite:tfsetchk2
- ..Remove a Favotite:tfdelchk
- ..Remove all Favorites:tfavsdelall
- ..Show Favorites:tfavslist
- .Categorys
- ..Add a Category:tcatsetchk2
- ..Remove a Category:tcatdelchk
- ..Remove all Categorys:tcatsdelall
- ..Show Categorys:tcatslist
- .Logging
- ..Torrent Window Logging $+($chr(91),$iif(%_twlog,On,Off),$chr(93))
- ...Enable Logging:twlog enable
- ...Disable Logging:twlog disable
- ...Show Log:twlog show
- ...Delete Log:twlog delete
- ..Favorites Window Logging $+($chr(91),$iif(%_fwlog,On,Off),$chr(93))
- ...Enable Logging:fwlog enable
- ...Disable Logging:fwlog disable
- ...Show Log:fwlog show
- ...Delete Log:fwlog delete
- -
- }
- ;---Menu-End---;
- ;---End-Of-Script---;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement