Advertisement
westor

Mixcloud module

Dec 2nd, 2016
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 28.83 KB | None | 0 0
  1. /*
  2.  
  3. #########################################
  4.  
  5.      #    Mixcloud-Search    #
  6.       # v1.6 - (02/12/2016) #
  7.        # Thanks Supporters #
  8.  
  9. #########################################
  10.  
  11. */
  12.  
  13. ; --- Start of dialogs ---
  14.  
  15. dialog -l wms_sets {
  16.   title ""
  17.   icon $scriptdir $+ wms_main.ico, 0
  18.   size -1 -1 329 154
  19.   option dbu disable
  20.   button "Close this window", 1, 77 136 193 17, default ok
  21.   tab "Settings 1", 2, 2 2 324 122
  22.   text "Ignore channel(s):", 3, 4 20 75 8, tab 2 center
  23.   list 4, 4 30 78 92, disable tab 2 size hsbar vsbar
  24.   button "Add", 6, 84 30 43 10, tab 2
  25.   button "Del", 7, 84 40 43 10, disable tab 2
  26.   button "Clear", 8, 84 111 43 12, disable tab 2
  27.   button "Add", 16, 200 30 43 10, tab 2
  28.   text "Ignore user(s):", 14, 248 20 76 8, tab 2 center
  29.   button "Del", 17, 200 40 43 10, disable tab 2
  30.   list 15, 245 30 78 92, disable tab 2 size hsbar vsbar
  31.   button "Clear", 18, 200 111 43 12, disable tab 2
  32.   tab "Settings 2", 13
  33.   text "Private Notice Command:", 9, 4 20 125 8, tab 13
  34.   edit "", 5, 130 19 18 9, tab 13 limit 1
  35.   text "Channel Message Command:", 11, 4 30 125 8, tab 13
  36.   edit "", 10, 130 29 18 9, tab 13 limit 1
  37.   combo 19, 4 65 63 57, tab 13 size drop
  38.   text "Language:", 20, 4 55 63 8, tab 13 center
  39.   text "Max Search Results:", 27, 4 40 126 8, tab 13
  40.   edit "", 28, 130 39 18 9, tab 13 limit 1
  41.   check "Enable", 12, 2 141 54 10
  42.   text "", 21, 306 144 22 8, center disable
  43.   check "Show the 'Title' information", 29, 160 18 164 10, tab 13
  44.   check "Show the 'Length' information", 30, 160 28 164 10, tab 13
  45.   check "Show the 'Views' information", 31, 160 38 164 10, tab 13
  46.   check "Show the 'Favorites' information", 32, 160 48 164 10, tab 13
  47.   check "Show the 'Comments' information", 33, 160 58 164 10, tab 13
  48.   check "Show the 'Listeners' information", 34, 160 68 164 10, tab 13
  49.   check "Show the 'Reposts' information", 35, 160 78 164 10, tab 13
  50.   check "Show the 'Uploaded on' information", 36, 160 88 164 10, tab 13
  51.   check "Show the 'Uploaded by' information", 37, 160 98 164 10, tab 13
  52.   check "Show the 'Link' information", 38, 160 108 164 10, tab 13
  53.   check "Allow all output links to be shorten", 520, 4 80 154 10, tab 13
  54.   tab "Settings 3", 45
  55.   check "Show empty search informations", 44, 4 40 250 10, tab 45
  56.   check "Show color/bold/underline in informations", 52, 4 50 250 10, tab 45
  57.   text "Max 'Title' information characters", 46, 4 20 155 8, tab 45
  58.   edit "", 47, 160 19 18 9, tab 45 limit 3
  59.   text "Date/Time format 'Uploaded on' information", 50, 4 30 155 8, tab 45
  60.   edit "", 51, 160 29 90 9, tab 45 autohs
  61.   check "Display the 'menubar' module menu", 54, 4 70 200 10, tab 45
  62.   check "Display the 'status' module menu", 55, 4 80 200 10, tab 45
  63.   check "Display the 'channel' module menu", 56, 4 90 200 10, tab 45
  64.   check "Display the 'query' module menu", 57, 4 100 200 10, tab 45
  65.   check "Display the 'nicklist' module menu", 58, 4 110 200 10, tab 45
  66.   menu "Menu", 22
  67.   item "Help", 23, 22
  68.   item break, 501
  69.   item "About", 24, 22
  70.   item break, 502
  71.   item "Restart", 25, 22
  72.   item break, 503
  73.   item "Exit", 26, 22
  74. }
  75.  
  76. ; --- End of dialogs ---
  77.  
  78. ; --- Start of events ---
  79.  
  80. ON *:DIALOG:wms_sets:*:*: {
  81.   if ($devent == init) {
  82.     dialog -t $dname $addon v $+ $wms_ver $lang(4) $iif($isalias(wmm_bel),$wmm_bel,->) (/wms_sets)
  83.     did -ra $dname 1 $lang(3)
  84.     did -ra $dname 2 $lang(4) 1
  85.     did -ra $dname 3 $lang(5)
  86.     did -ra $dname 6 $lang(6)
  87.     did -ra $dname 7 $lang(7)
  88.     did -ra $dname 8 $lang(8)
  89.     did -ra $dname 16 $lang(6)
  90.     did -ra $dname 14 $lang(9)
  91.     did -ra $dname 17 $lang(7)
  92.     did -ra $dname 18 $lang(8)
  93.     did -ra $dname 13 $lang(4) 2
  94.     did -ra $dname 9 $lang(10)
  95.     did -ra $dname 11 $lang(11)
  96.     did -ra $dname 20 $lang(12)
  97.     did -ra $dname 27 $lang(19)
  98.     did -ra $dname 12 $lang(13)
  99.     did -ra $dname 21 v $+ $wms_ver
  100.     did -o $dname 22 $lang(14)
  101.     did -o $dname 23 $lang(15)
  102.     did -o $dname 24 $lang(16)
  103.     did -o $dname 25 $lang(17)
  104.     did -o $dname 26 $lang(18)
  105.     did -ra $dname 520 $lang(61)
  106.  
  107.     did -ra $dname 29 $lang(47) $qt($lang(49)) $lang(48)
  108.     did -ra $dname 30 $lang(47) $qt($lang(50)) $lang(48)
  109.     did -ra $dname 31 $lang(47) $qt($lang(51)) $lang(48)
  110.     did -ra $dname 32 $lang(47) $qt($lang(54)) $lang(48)
  111.     did -ra $dname 33 $lang(47) $qt($lang(55)) $lang(48)
  112.     did -ra $dname 34 $lang(47) $qt($lang(52)) $lang(48)
  113.     did -ra $dname 35 $lang(47) $qt($lang(53)) $lang(48)
  114.     did -ra $dname 36 $lang(47) $qt($lang(56)) $lang(48)
  115.     did -ra $dname 37 $lang(47) $qt($lang(57)) $lang(48)
  116.     did -ra $dname 38 $lang(47) $qt($lang(58)) $lang(48)
  117.  
  118.     did -ra $dname 45 $lang(4) 3
  119.     did -ra $dname 44 $lang(62)
  120.     did -ra $dname 52 $lang(66)
  121.     did -ra $dname 50 $lang(65) $qt($lang(56)) $lang(48)
  122.     did -ra $dname 46 $lang(63) $qt($lang(49)) $lang(64)
  123.  
  124.     did -ra $dname 54 $lang(68) $qt(menubar) $lang(69)
  125.     did -ra $dname 55 $lang(68) $qt(status) $lang(69)
  126.     did -ra $dname 56 $lang(68) $qt(channel) $lang(69)
  127.     did -ra $dname 57 $lang(68) $qt(query) $lang(69)
  128.     did -ra $dname 58 $lang(68) $qt(nicklist) $lang(69)
  129.  
  130.     if ($istok(%wms_menu,menubar,32)) { did -c $dname 54 }
  131.     if ($istok(%wms_menu,status,32)) { did -c $dname 55 }
  132.     if ($istok(%wms_menu,channel,32)) { did -c $dname 56 }
  133.     if ($istok(%wms_menu,query,32)) { did -c $dname 57 }
  134.     if ($istok(%wms_menu,nicklist,32)) { did -c $dname 58 }
  135.  
  136.     if ($istok(%wms_show,title,32)) { did -c $dname 29 }
  137.     if ($istok(%wms_show,length,32)) { did -c $dname 30 }
  138.     if ($istok(%wms_show,views,32)) { did -c $dname 31 }
  139.     if ($istok(%wms_show,favorites,32)) { did -c $dname 32 }
  140.     if ($istok(%wms_show,comments,32)) { did -c $dname 33 }
  141.     if ($istok(%wms_show,listeners,32)) { did -c $dname 34 }
  142.     if ($istok(%wms_show,reposts,32)) { did -c $dname 35 }
  143.     if ($istok(%wms_show,uploaded_on,32)) { did -c $dname 36 }
  144.     if ($istok(%wms_show,uploaded_by,32)) { did -c $dname 37 }
  145.     if ($istok(%wms_show,link,32)) { did -c $dname 38 }
  146.  
  147.     if (%wms_tiny) { did -c $dname 520 }
  148.     if (%wms_status) { did -c $dname 12 }
  149.     if (%wms_show_empty) { did -c $dname 44 }
  150.     if (%wms_strip) { did -c $dname 52 }
  151.     if (%wms_prefix_chan) { did -ra $dname 10 %wms_prefix_chan }
  152.     if (%wms_prefix_nick) { did -ra $dname 5 %wms_prefix_nick }
  153.     if (%wms_max_results) { did -ra $dname 28 %wms_max_results }
  154.     if (%wms_title_chars_max) { did -ra $dname 47 %wms_title_chars_max }
  155.     if (%wms_uploaded_on_format) { did -ra $dname 51 %wms_uploaded_on_format }
  156.  
  157.     var %f = $scriptdir $+ wms_lang.ini
  158.     if ($ini(%f,0)) {
  159.       var %t = $v1
  160.       var %i = 1
  161.       while (%i <= %t) {
  162.         var %l = $ini(%f,%i)
  163.         if (%l) && (%l !== %wms_lang) { did -a $dname 19 %l }
  164.         inc %i
  165.       }
  166.       if (%wms_lang) { did -ca $dname 19 %wms_lang }
  167.     }
  168.     else { did -b $dname 19 }
  169.     wms_ignore_chans_list
  170.     wms_ignore_nicks_list
  171.   }
  172.   if ($devent == menu) {
  173.     if ($did == 23) { url $help_url }
  174.     if ($did == 24) { _input ok 60 v $+ $wms_ver $lang(36) $wms_crdate $lang(26) $wms_owner }
  175.     if ($did == 25) { dialog -k $dname | .timer -mo 1 500 wms_sets }
  176.     if ($did == 26) { dialog -k $dname }
  177.   }
  178.   if ($devent == close) {
  179.     if (!%wms_show) { set %wms_show title link  }
  180.     if (!$did(5)) || ($did(5) isalnum) { set %wms_prefix_chan @ }
  181.     if (!$did(10)) || ($did(10) isalnum) { set %wms_prefix_nick ! }
  182.     if (!$did(28)) || (!$wmm_isdigit($did(28))) || ($did(28) > 9) { set %wms_max_results 3 }
  183.     if (!$did(47)) || (!$wmm_isdigit($did(47))) || ($did(47) > 300) { set %wms_title_chars_max 100 }
  184.     if (!$did(51)) { set %wms_uploaded_on_format $wmm_d_format }
  185.     if ($did(51)) && (!$wmm_cdate($did(51))) { set %wms_uploaded_on_format $wmm_d_format }
  186.     if ($did(19)) { set %wms_lang $did(19) }
  187.   }
  188.   if ($devent == edit) {
  189.     if ($did == 5) {
  190.       if ($did($did).text) { set %wms_prefix_nick $v1 }
  191.       else { unset %wms_prefix_nick }
  192.     }
  193.     if ($did == 10) {
  194.       if ($did($did).text) { set %wms_prefix_chan $v1 }
  195.       else { unset %wms_prefix_chan }
  196.     }
  197.     if ($did == 28) {
  198.       if ($did($did).text) { set %wms_max_results $v1 }
  199.       else { unset %wms_max_results }
  200.     }
  201.     if ($did == 47) {
  202.       if ($did($did).text) { set %wms_title_chars_max $v1 }
  203.       else { unset %wms_title_chars_max }
  204.     }
  205.     if ($did == 51) {
  206.       if ($did($did).text) { set %wms_uploaded_on_format $v1 }
  207.       else { unset %wms_uploaded_on_format }
  208.     }
  209.   }
  210.   if ($devent == sclick) {
  211.     if ($did == 29) {
  212.       var %v = title
  213.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  214.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  215.     }
  216.     if ($did == 30) {
  217.       var %v = length
  218.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  219.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  220.     }
  221.     if ($did == 31) {
  222.       var %v = views
  223.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  224.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  225.     }
  226.     if ($did == 32) {
  227.       var %v = favorites
  228.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  229.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  230.     }
  231.     if ($did == 33) {
  232.       var %v = comments
  233.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  234.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  235.     }
  236.     if ($did == 34) {
  237.       var %v = listeners
  238.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  239.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  240.     }
  241.     if ($did == 35) {
  242.       var %v = reposts
  243.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  244.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  245.     }
  246.     if ($did == 36) {
  247.       var %v = uploaded_on
  248.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  249.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  250.     }
  251.     if ($did == 37) {
  252.       var %v = uploaded_by
  253.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  254.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  255.     }
  256.     if ($did == 38) {
  257.       var %v = link
  258.       if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
  259.       else { set %wms_show $remtok(%wms_show,%v,1,32) }
  260.     }
  261.     if ($did == 520) {
  262.       if (!%wms_tiny) { set %wms_tiny 1 }
  263.       else { set %wms_tiny 0 }
  264.     }
  265.     if ($did == 12) {
  266.       if (!%wms_status) { set %wms_status 1 }
  267.       else { set %wms_status 0 }
  268.     }
  269.     if ($did == 44) {
  270.       if (!%wms_show_empty) { set %wms_show_empty 1 }
  271.       else { set %wms_show_empty 0 }
  272.     }
  273.     if ($did == 52) {
  274.       if (!%wms_strip) { set %wms_strip 1 }
  275.       else { set %wms_strip 0 }
  276.     }
  277.     if ($did == 54) {
  278.       if (!$istok(%wms_menu,menubar,32)) { set %wms_menu $addtok(%wms_menu,menubar,32) }
  279.       else { set %wms_menu $remtok(%wms_menu,menubar,1,32) }
  280.     }
  281.     if ($did == 55) {
  282.       if (!$istok(%wms_menu,status,32)) { set %wms_menu $addtok(%wms_menu,status,32) }
  283.       else { set %wms_menu $remtok(%wms_menu,status,1,32) }
  284.     }
  285.     if ($did == 56) {
  286.       if (!$istok(%wms_menu,channel,32)) { set %wms_menu $addtok(%wms_menu,channel,32) }
  287.       else { set %wms_menu $remtok(%wms_menu,channel,1,32) }
  288.     }
  289.     if ($did == 57) {
  290.       if (!$istok(%wms_menu,query,32)) { set %wms_menu $addtok(%wms_menu,query,32) }
  291.       else { set %wms_menu $remtok(%wms_menu,query,1,32) }
  292.     }
  293.     if ($did == 58) {
  294.       if (!$istok(%wms_menu,nicklist,32)) { set %wms_menu $addtok(%wms_menu,nicklist,32) }
  295.       else { set %wms_menu $remtok(%wms_menu,nicklist,1,32) }
  296.     }
  297.     if ($did == 4) {
  298.       if ($did($did).seltext) { did -e $dname 7 }    
  299.     }
  300.     if ($did == 15) {
  301.       if ($did($did).seltext) { did -e $dname 17 }    
  302.     }
  303.     if ($did == 7) {
  304.       did -b $dname $did
  305.       var %s = $did(4).seltext
  306.       if (!%s) { return }
  307.       var %net = $gettok(%s,1,32)
  308.       var %chan = $gettok(%s,3,32)
  309.       set %wms_ignore_ [ $+ [ %net ] $+ ] _chans $remtok(%wms_ignore_ [ $+ [ %net ] $+ ] _chans,%chan,1,32)
  310.       if (!%wms_ignore_ [ $+ [ %net ] $+ ] _chans) {
  311.         unset %wms_ignore_ [ $+ [ %net ] $+ ] _chans
  312.         set %wms_ignore_chans_networks $remtok(%wms_ignore_chans_networks,%net,1,32)
  313.         if (!%wms_ignore_chans_networks) { unset %wms_ignore_chans_networks }
  314.       }
  315.       wms_ignore_chans_list
  316.     }
  317.     if ($did == 17) {
  318.       did -b $dname $did
  319.       var %s = $did(15).seltext
  320.       if (!%s) { return }
  321.       var %net = $gettok(%s,1,32)
  322.       var %nick = $gettok(%s,3,32)
  323.       set %wms_ignore_ [ $+ [ %net ] $+ ] _nicks $remtok(%wms_ignore_ [ $+ [ %net ] $+ ] _nicks,%nick,1,32)
  324.       if (!%wms_ignore_ [ $+ [ %net ] $+ ] _nicks) {
  325.         unset %wms_ignore_ [ $+ [ %net ] $+ ] _nicks
  326.         set %wms_ignore_nicks_networks $remtok(%wms_ignore_nicks_networks,%net,1,32)
  327.         if (!%wms_ignore_nicks_networks) { unset %wms_ignore_nicks_networks }
  328.       }
  329.       wms_ignore_nicks_list
  330.     }
  331.     if ($did == 6) {
  332.       var %net = $input($lang(27),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
  333.       if (!$dialog($dname)) { return }
  334.       if (!%net) { wms_sets | return }
  335.       if ($numtok(%net,32) !== 1) { _input error 60 $lang(28) | wms_sets | return }
  336.       if ($len(%net) > 50) { _input error 60 $lang(29) | wms_sets | return }
  337.       var %chan = $input($lang(30),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
  338.       if (!$dialog($dname)) { return }
  339.       if (!%chan) { wms_sets | return }
  340.       if ($numtok(%chan,32) !== 1) { _input error 60 $lang(31) | wms_sets | return }
  341.       if ($numtok(%chan,44) !== 1) { _input error 60 $lang(31) | wms_sets | return }
  342.       if ($left(%chan,1) !== $chr(35)) { _input error 60 $lang(32) | wms_sets | return }
  343.       if ($istok(%wms_ignore_ [ $+ [ %net ] $+ ] _chans,%chan,32)) { _input error 60 $lang(33) | wms_sets | return }
  344.       set %wms_ignore_ [ $+ [ %net ] $+ ] _chans $addtok(%wms_ignore_ [ $+ [ %net ] $+ ] _chans,%chan,32)
  345.       if (!$istok(%wms_ignore_chans_networks,%net,32)) { set %wms_ignore_chans_networks $addtok(%wms_ignore_chans_networks,%net,32) }
  346.       wms_ignore_chans_list
  347.       wms_sets
  348.     }
  349.     if ($did == 16) {
  350.       var %net = $input($lang(27),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
  351.       if (!$dialog($dname)) { return }
  352.       if (!%net) { wms_sets | return }
  353.       if ($numtok(%net,32) !== 1) { _input error 60 $lang(28) | wms_sets | return }
  354.       if ($len(%net) > 50) { _input error 60 $lang(29) | wms_sets | return }
  355.       var %nick = $input($lang(21),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
  356.       if (!$dialog($dname)) { return }
  357.       if (!%nick) { wms_sets | return }
  358.       if ($numtok(%nick,32) !== 1) { _input error 60 $lang(35) | wms_sets | return }
  359.       if ($istok(%wms_ignore_ [ $+ [ %net ] $+ ] _nicks,%nick,32)) { _input error 60 $lang(34) | wms_sets | return }
  360.       set %wms_ignore_ [ $+ [ %net ] $+ ] _nicks $addtok(%wms_ignore_ [ $+ [ %net ] $+ ] _nicks,%nick,32)
  361.       if (!$istok(%wms_ignore_nicks_networks,%net,32)) { set %wms_ignore_nicks_networks $addtok(%wms_ignore_nicks_networks,%net,32) }
  362.       wms_ignore_nicks_list
  363.       wms_sets
  364.     }
  365.     if ($did == 8) {
  366.       did -b $dname 8,7
  367.       var %z = 1
  368.       while (%z <= $numtok(%wms_ignore_chans_networks,32)) {
  369.         var %net = $gettok(%wms_ignore_chans_networks,%z,32)    
  370.         if (%wms_ignore_ [ $+ [ %net ] $+ ] _chans) { unset %wms_ignore_ [ $+ [ %net ] $+ ] _chans }
  371.         inc %z
  372.       }
  373.       unset %wms_ignore_chans_networks
  374.       wms_ignore_chans_list
  375.     }
  376.     if ($did == 18) {
  377.       did -b $dname 18,17
  378.       var %z = 1
  379.       while (%z <= $numtok(%wms_ignore_nicks_networks,32)) {
  380.         var %net = $gettok(%wms_ignore_nicks_networks,%z,32)    
  381.         if (%wms_ignore_ [ $+ [ %net ] $+ ] _nicks) { unset %wms_ignore_ [ $+ [ %net ] $+ ] _nicks }
  382.         inc %z
  383.       }
  384.       unset %wms_ignore_nicks_networks
  385.       wms_ignore_nicks_list
  386.     }
  387.   }
  388. }
  389.  
  390. ON *:LOAD: { wms_load }
  391.  
  392. ON *:UNLOAD: {
  393.   wmm_d_close wms_sets
  394.   var %1 = $scriptdir $+ wms_main.ico
  395.   var %2 = $scriptdir $+ wms_lang.ini
  396.   if ($isfile(%1)) { .remove -b $qt(%1) }
  397.   if ($isfile(%2)) { .remove -b $qt(%2) }
  398.   unset %wms_*
  399.   hfree -w WMS_*
  400.   .signal -n wmm_close $addon
  401. }
  402.  
  403. CTCP *:VERSION: { .notice $nick $chr(3) $+ $color(info) $+ ( $+ $chr(3) $+ $color(ctcp) $+ $wmm_bold($nick) $+ $chr(3) $+ $color(info) $+ ): $addon $wmm_under(v) $+ $wmm_bold($wms_ver) Created by: $wmm_bold($wms_owner) on: $wmm_bold($wms_crdate) }
  404.  
  405. ON $*:TEXT:$(/^(\Q $+ $replacecs(%wms_prefix_nick,\E,\E\\E\Q) $+ \E|\Q $+ $replacecs(%wms_prefix_chan,\E,\E\\E\Q) $+ \E).*/Si):#: {
  406.   if (!$isalias(wmm_ver)) || ($wmm_ver < $tools_ver) || (!%wms_status) || ($istok(%wms_ignore_ [ $+ [ $network ] $+ ] _chans,$chan,32)) || ($istok(%wms_ignore_ [ $+ [ $network ] $+ ] _nicks,$nick,32)) { return }
  407.   tokenize 32 $strip($1-)
  408.   var %cn = $network $+ ~ $+ $nick $+ ~ $+ $chan
  409.   if ($hget(WMS_FLOOD,%cn)) { return }
  410.   if ($1 == %wms_prefix_nick $+ mixcloud) {
  411.     hadd -mu6 WMS_FLOOD %cn 1
  412.     if (!$2) { .notice $nick ( $+ $wmm_bold($nick) $+ ): $lang(37) - $lang(38) $wmm_bold($1 < $+ $wmm_under($lang(46)) $+ >) - ( $+ $lang(39) $wmm_bold($1 $wmm_under($addon)) $+ ) | return }
  413.     wms_mixcloud_search $nick $chan .notice $2-
  414.   }
  415.   if ($1 == %wms_prefix_chan $+ mixcloud) {
  416.     hadd -mu6 WMS_FLOOD %cn 1
  417.     if (!$2) { .msg $chan ( $+ $wmm_bold($nick) $+ ): $lang(37) - $lang(38) $wmm_bold($1 < $+ $wmm_under($lang(46)) $+ >) - ( $+ $lang(39) $wmm_bold($1 $wmm_under($addon)) $+ ) | return }
  418.     wms_mixcloud_search $nick $chan .msg $2-
  419.   }
  420. }
  421.  
  422. ; --- End of events ---
  423.  
  424. ; --- Start of aliases ---
  425.  
  426. alias wms_ver { return 1.6 }
  427. alias wms_crdate { return 02/12/2016 }
  428. alias wms_owner { return $+($chr(119),$chr(101),$chr(115),$chr(116),$chr(111),$chr(114)) }
  429. alias -l tools_ver { return 2.6 }
  430. alias -l addon { return $+($chr(77),$chr(105),$chr(120),$chr(99),$chr(108),$chr(111),$chr(117),$chr(100),$chr(45),$chr(83),$chr(101),$chr(97),$chr(114),$chr(99),$chr(104)) }
  431. alias -l help_url { return http:// $+ $wms_owner $+ .ucoz.com/wmm }
  432. alias -l lang_url { return http:// $+ $wms_owner $+ .ucoz.com/wmm/languages/wms_lang.ini?nocache= $+ $ticks }
  433. alias -l main_ico_url { return http:// $+ $wms_owner $+ .ucoz.com/wmm/images/wms_main.ico?nocache= $+ $ticks }
  434. alias -l _input {
  435.   if (!$1) { return }
  436.   if ($1 == ok) { .timer -ho 1 0 !noop $input($replace($3-,@newline@,$crlf),ouidbk $+ $iif($2 && $2 isnum,$2,0),$addon $iif($isalias(wmm_bel),$wmm_bel,->) $iif($lang(23),$v1,OK)) }
  437.   if ($1 == warn) { .timer -ho 1 0 !noop $input($replace($3-,@newline@,$crlf),woudbk $+ $iif($2 && $2 isnum,$2,0),$addon $iif($isalias(wmm_bel),$wmm_bel,->) $iif($lang(24),$v1,Warn)) }
  438.   if ($1 == error) { .timer -ho 1 0 !noop $input($replace($3-,@newline@,$crlf),houdbk $+ $iif($2 && $2 isnum,$2,0),$addon $iif($isalias(wmm_bel),$wmm_bel,->) $iif($lang(25),$v1,Error)) }
  439. }
  440.  
  441. alias -l lang {
  442.   var %f = $scriptdir $+ wms_lang.ini
  443.   if (!$isfile(%f)) { return 0 }
  444.   if (!%wms_lang) { set %wms_lang English }
  445.   var %chk_lang = $ini(%f,%wms_lang)
  446.   if (!%chk_lang) { return READ-ERROR! }
  447.   var %r = $readini(%f,n,%wms_lang,$1)
  448.   if (!%r) { return N/A }
  449.   elseif (%r) { return %r }
  450. }
  451.  
  452. ; ##########################################################
  453.  
  454. alias wms_sets {
  455.   if (!$isalias(wmm_ver)) { _input error 60 You must download and install first the $qt($upper($wms_owner) Module Manager) in order to work this module! | url $help_url | .unload -nrs $qt($script) | return }
  456.   if ($wmm_ver < $tools_ver) { _input error 60 You must download and install the latest $qt($upper($wms_owner) Module Manager) version in order to work this module! | url $help_url | .unload -nrs $qt($script) | return }
  457.   if ($group(# [ $+ [ $lower($addon) ] ]).fname !== $script) { _input error 60 This module cannot work more than one time into this mIRC client because you already have this module installed! | .unload -nrs $qt($script) | return }
  458.   var %d = wms_sets
  459.   if ($dialog(%d)) { dialog -ve %d %d | return }
  460.   var %i = $scriptdir $+ wms_main.ico
  461.   var %l = $scriptdir $+ wms_lang.ini
  462.   if (!$isfile(%l)) || (!$isfile(%i)) { var %delay = 1 }
  463.   if (%delay) { wms_load | .timer[WMS_DELAY_DL_AND_OPEN] -o 1 3 wms_sets_reopen | _input ok 3 Downloading some require module files... | return }
  464.   dialog -md %d %d
  465. }
  466.  
  467. alias -l wms_sets_reopen {
  468.   var %i = $scriptdir $+ wms_main.ico
  469.   var %l = $scriptdir $+ wms_lang.ini
  470.   if (!$isfile(%l)) || (!$isfile(%i)) { _input error 60 FATAL ERROR! @newline@ @newline@ $+ Error Code: 001 | return }
  471.   wms_sets
  472. }
  473.  
  474. alias -l wms_ignore_chans_list {
  475.   var %d = wms_sets
  476.   if (!$dialog(%d)) { return }
  477.   did -b %d 7
  478.   did -r %d 4
  479.   if (!%wms_ignore_chans_networks) { did -b %d 4,8 | return }
  480.   var %z = 1
  481.   while (%z <= $numtok(%wms_ignore_chans_networks,32)) {
  482.     var %net = $gettok(%wms_ignore_chans_networks,%z,32)
  483.     var %chans = %wms_ignore_ [ $+ [ %net ] $+ ] _chans
  484.     if (!%net) { goto next_net }
  485.     var %i = 1
  486.     while (%i <= $numtok(%chans,32)) {
  487.       var %c = $gettok(%chans,%i,32)
  488.       if (%c) { did -a %d 4 %net $iif($isalias(wmm_bel),$wmm_bel,->) %c }
  489.       inc %i
  490.     }
  491.     :next_net
  492.     inc %z
  493.   }
  494.   if ($did(4).lines) { did -ez %d 4 | did -e %d 8 }
  495.   else { did -b %d 4,8 }
  496. }
  497.  
  498. alias -l wms_ignore_nicks_list {
  499.   var %d = wms_sets
  500.   if (!$dialog(%d)) { return }
  501.   did -b %d 17
  502.   did -r %d 15
  503.   if (!%wms_ignore_nicks_networks) { did -b %d 15,18 | return }
  504.   var %z = 1
  505.   while (%z <= $numtok(%wms_ignore_nicks_networks,32)) {
  506.     var %net = $gettok(%wms_ignore_nicks_networks,%z,32)
  507.     var %nicks = %wms_ignore_ [ $+ [ %net ] $+ ] _nicks
  508.     if (!%net) { goto next_net }
  509.     var %i = 1
  510.     while (%i <= $numtok(%nicks,32)) {
  511.       var %n = $gettok(%nicks,%i,32)
  512.       if (%n) { did -a %d 15 %net $iif($isalias(wmm_bel),$wmm_bel,->) %n }
  513.       inc %i
  514.     }
  515.     :next_net
  516.     inc %z
  517.   }
  518.   if ($did(15).lines) { did -ez %d 15 | did -e %d 18 }
  519.   else { did -b %d 15,18 }
  520. }
  521.  
  522. alias -l wms_load {
  523.   if (!$isalias(wmm_ver)) { _input error 60 You must download and install first the $qt($upper($wms_owner) Module Manager) in order to work this module! | url $help_url | .unload -nrs $qt($script) | return }
  524.   if ($wmm_ver < $tools_ver) { _input error 60 You must download and install the latest $qt($upper($wms_owner) Module Manager) version in order to work this module! | url $help_url | .unload -nrs $qt($script) | return }
  525.   if ($group(# [ $+ [ $lower($addon) ] ]).fname !== $script) { _input error 60 This module cannot work more than one time into this mIRC client because you already have this module installed! | .unload -nrs $qt($script) | return }
  526.   if ($isalias(wmm_dl)) { wmm_dl $main_ico_url $qt($scriptdir $+ wms_main.ico) }
  527.   if ($isalias(wmm_dl)) { wmm_dl $lang_url $qt($scriptdir $+ wms_lang.ini) }
  528.   if (!$var(wms_menu,0)) { set %wms_menu menubar }
  529.   if (%wms_status == $null) { set %wms_status 1 }
  530.   if (%wms_tiny == $null) { set %wms_tiny 1 }
  531.   if (%wms_strip == $null) { set %wms_strip 0 }
  532.   if (%wms_show_empty == $null) { set %wms_show_empty 0 }
  533.   if (%wms_lang == $null) { set %wms_lang English }
  534.   if (%wms_max_results == $null) { set %wms_max_results 3 }
  535.   if (%wms_prefix_nick == $null) { set %wms_prefix_nick ! }
  536.   if (%wms_prefix_chan == $null) { set %wms_prefix_chan @ }
  537.   if (%wms_title_chars_max == $null) { set %wms_title_chars_max 100 }
  538.   if (%wms_uploaded_on_format == $null) { set %wms_uploaded_on_format $wmm_d_format }
  539.   if (%wms_show == $null) { set %wms_show title length views listeners comments link }
  540.   hfree -w WMS_*
  541.   .signal -n wmm_close $addon
  542. }
  543.  
  544. alias -l wms_mixcloud_search {
  545.   if (!$wmm_internet) || (!%wms_status) || (!$1-) { return }
  546.   if ($3 == .msg) { var %output = $3 $2 }
  547.   elseif ($3 == .notice) { var %output = $3 $1 }
  548.   if (!%wms_show) { set %wms_show title link }
  549.   if (!%wms_max_results) || (!$wmm_isdigit(%wms_max_results)) || (%wms_max_results > 9) { set %wms_max_results 3 }
  550.   if (!%wms_title_chars_max) || (!$wmm_isdigit(%wms_title_chars_max)) || (%wms_title_chars_max > 300) { set %wms_title_chars_max 100 }
  551.   if (!%wms_uploaded_on_format) || (!$wmm_cdate(%wms_uploaded_on_format)) { set %wms_uploaded_on_format $wmm_d_format }
  552.   var %v = mixcloud_ $+ $wmm_random
  553.   wmm_jsonopen -ud %v https://api.mixcloud.com/search/?q= $+ $wmm_urlencode($4-) $+ &type=cloudcast&limit= $+ %wms_max_results
  554.   if ($wmm_jsonerror) { %output ( $+ $wmm_bold($1) $+ ): $lang(40) - ( $+ $lang(41) $wmm_bold($wmm_jsonerror) $+ ) | return }
  555.   var %tot = $wmm_json(%v,data,length)
  556.   if (!%tot) { %output ( $+ $wmm_bold($1) $+ ): $lang(42) | return }
  557.   var %x = 0
  558.   while (%x < %wms_max_results) {
  559.  
  560.     var %id = $wmm_json(%v,data,%x,key)
  561.     if (!%id) { goto next }
  562.     var %total = $calc(%total +1)
  563.  
  564.     if ($istok(%wms_show,title,32)) {
  565.       var %title = $wmm_html2asc($wmm_fixtab($wmm_json(%v,data,%x,name)))
  566.       if (%title) && ($len(%title) >= %wms_title_chars_max) { var %title = $left(%title,$calc(%wms_title_chars_max -3)) $+ ... }
  567.       if (!%title) { var %title = $lang(67) }
  568.     }
  569.     if ($istok(%wms_show,length,32)) {
  570.       var %duration = $duration($wmm_json(%v,data,%x,audio_length),3)
  571.       if (!%duration) { var %duration = 00:00:00 }
  572.     }
  573.     if ($istok(%wms_show,uploaded_by,32)) {
  574.       var %uploader = $wmm_json(%v,data,%x,user,name)
  575.       if (!%uploader) { var %uploader = $lang(67) }
  576.     }
  577.     if ($istok(%wms_show,uploaded_on,32)) {
  578.       var %uploaded = $date($wmm_convertdate($wmm_json(%v,data,%x,created_time)),%wms_uploaded_on_format)
  579.       if (!%uploaded) { var %uploaded = $lang(67) }
  580.     }
  581.     if ($istok(%wms_show,link,32)) {
  582.       var %url = $wmm_json(%v,data,%x,url)
  583.       if (%wms_tiny) { var %url = $wmm_tinycom(%url) }
  584.       if (!%url) { var %url = $lang(67) }
  585.     }
  586.     if ($istok(%wms_show,favorites,32)) { var %favorite = $wmm_json(%v,data,%x,favorite_count) }
  587.     if ($istok(%wms_show,views,32)) { var %views = $wmm_json(%v,data,%x,play_count) }
  588.     if ($istok(%wms_show,comments,32)) { var %comments = $wmm_json(%v,data,%x,comment_count) }
  589.     if ($istok(%wms_show,reposts,32)) { var %reposts = $wmm_json(%v,data,%x,repost_count) }
  590.     if ($istok(%wms_show,listeners,32)) { var %listeners = $wmm_json(%v,data,%x,listener_count) }
  591.  
  592.     if (%wms_show_empty) {
  593.       var %msg = 0,1MixCloud-0,14Search: $iif($isalias(wmm_bel),$wmm_bel,->) $iif(%title !== $null,$wmm_bold($lang(49)) $+ :6 %title $+ ) $iif(%duration !== $null,-*- $wmm_bold($lang(50)) $+ :10 %duration $+ ) $iif(%views !== $null,-*- $wmm_bold($iif(%views == 1,$lang(43),$lang(51))) $+ :13 $bytes(%views,bd) $+ ) $iif(%listeners !== $null,-*- $wmm_bold($iif(%listeners == 1,$lang(44),$lang(52))) $+ :3 $bytes(%listeners,bd) $+ ) $iif(%favorite !== $null,-*- $wmm_bold($iif(%favorite == 1,$lang(59),$lang(54))) $+ :5 $bytes(%favorite,bd) $+ ) $iif(%reposts !== $null,-*- $wmm_bold($iif(%reposts == 1,$lang(45),$lang(53))) $+ :9 $bytes(%reposts,bd) $+ ) $iif(%comments !== $null,-*- $wmm_bold($iif(%comments == 1,$lang(60),$lang(55))) $+ :10 $bytes(%comments,bd) $+ ) $iif(%uploader !== $null,-*- $wmm_bold($lang(57)) $+ :2 %uploader $+ ) $iif(%uploaded !== $null,-*- $wmm_bold($lang(56)) $+ :7 %uploaded $+ ) $iif(%url !== $null,-*- $wmm_bold($lang(58)) $+ :12 $wmm_under(%url) $+ )
  594.       %output $iif(%wms_strip,$strip(%msg),%msg)
  595.     }
  596.     elseif (!%wms_show_empty) {
  597.       var %msg = 0,1MixCloud-0,14Search: $iif($isalias(wmm_bel),$wmm_bel,->) $iif(%title,$wmm_bold($lang(49)) $+ :6 %title $+ ) $iif(%duration,-*- $wmm_bold($lang(50)) $+ :10 %duration $+ ) $iif(%views,-*- $wmm_bold($iif(%views == 1,$lang(43),$lang(51))) $+ :13 $bytes(%views,bd) $+ ) $iif(%listeners,-*- $wmm_bold($iif(%listeners == 1,$lang(44),$lang(52))) $+ :3 $bytes(%listeners,bd) $+ ) $iif(%favorite,-*- $wmm_bold($iif(%favorite == 1,$lang(59),$lang(54))) $+ :5 $bytes(%favorite,bd) $+ ) $iif(%reposts,-*- $wmm_bold($iif(%reposts == 1,$lang(45),$lang(53))) $+ :9 $bytes(%reposts,bd) $+ ) $iif(%comments,-*- $wmm_bold($iif(%comments == 1,$lang(60),$lang(55))) $+ :10 $bytes(%comments,bd) $+ ) $iif(%uploader,-*- $wmm_bold($lang(57)) $+ :2 %uploader $+ ) $iif(%uploaded,-*- $wmm_bold($lang(56)) $+ :7 %uploaded $+ ) $iif(%url,-*- $wmm_bold($lang(58)) $+ :12 $wmm_under(%url) $+ )
  598.       %output $iif(%wms_strip,$strip(%msg),%msg)
  599.     }
  600.  
  601.     :next
  602.     inc %x  
  603.   }
  604.   if (!%total) { %output ( $+ $wmm_bold($1) $+ ): $lang(42) }
  605. }
  606.  
  607. ; --- End of aliases ---
  608.  
  609. ; --- Start of menus ---
  610.  
  611. menu * {
  612.   $iif($istok(%wms_menu,$menu,32),-)
  613.   $iif($istok(%wms_menu,$menu,32),$iif($isalias(wmm_qd),$wmm_qd($addon v $+ $wms_ver - $iif($lang(4),$v1,Settings) $+ ),-*- $addon v $+ $wms_ver - Settings -*-)):wms_sets
  614.   $iif($istok(%wms_menu,$menu,32),-)
  615. }
  616.  
  617. ; --- End of menus ---
  618.  
  619. ; -- Start of groups ---
  620.  
  621. #mixcloud-search off
  622. #mixcloud-search end
  623.  
  624. ; -- End of groups ---
  625.  
  626. ; ------------------------------------------------------------------------------ EOF ------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement