Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- #########################################
- # Mixcloud-Search #
- # v1.6 - (02/12/2016) #
- # Thanks Supporters #
- #########################################
- */
- ; --- Start of dialogs ---
- dialog -l wms_sets {
- title ""
- icon $scriptdir $+ wms_main.ico, 0
- size -1 -1 329 154
- option dbu disable
- button "Close this window", 1, 77 136 193 17, default ok
- tab "Settings 1", 2, 2 2 324 122
- text "Ignore channel(s):", 3, 4 20 75 8, tab 2 center
- list 4, 4 30 78 92, disable tab 2 size hsbar vsbar
- button "Add", 6, 84 30 43 10, tab 2
- button "Del", 7, 84 40 43 10, disable tab 2
- button "Clear", 8, 84 111 43 12, disable tab 2
- button "Add", 16, 200 30 43 10, tab 2
- text "Ignore user(s):", 14, 248 20 76 8, tab 2 center
- button "Del", 17, 200 40 43 10, disable tab 2
- list 15, 245 30 78 92, disable tab 2 size hsbar vsbar
- button "Clear", 18, 200 111 43 12, disable tab 2
- tab "Settings 2", 13
- text "Private Notice Command:", 9, 4 20 125 8, tab 13
- edit "", 5, 130 19 18 9, tab 13 limit 1
- text "Channel Message Command:", 11, 4 30 125 8, tab 13
- edit "", 10, 130 29 18 9, tab 13 limit 1
- combo 19, 4 65 63 57, tab 13 size drop
- text "Language:", 20, 4 55 63 8, tab 13 center
- text "Max Search Results:", 27, 4 40 126 8, tab 13
- edit "", 28, 130 39 18 9, tab 13 limit 1
- check "Enable", 12, 2 141 54 10
- text "", 21, 306 144 22 8, center disable
- check "Show the 'Title' information", 29, 160 18 164 10, tab 13
- check "Show the 'Length' information", 30, 160 28 164 10, tab 13
- check "Show the 'Views' information", 31, 160 38 164 10, tab 13
- check "Show the 'Favorites' information", 32, 160 48 164 10, tab 13
- check "Show the 'Comments' information", 33, 160 58 164 10, tab 13
- check "Show the 'Listeners' information", 34, 160 68 164 10, tab 13
- check "Show the 'Reposts' information", 35, 160 78 164 10, tab 13
- check "Show the 'Uploaded on' information", 36, 160 88 164 10, tab 13
- check "Show the 'Uploaded by' information", 37, 160 98 164 10, tab 13
- check "Show the 'Link' information", 38, 160 108 164 10, tab 13
- check "Allow all output links to be shorten", 520, 4 80 154 10, tab 13
- tab "Settings 3", 45
- check "Show empty search informations", 44, 4 40 250 10, tab 45
- check "Show color/bold/underline in informations", 52, 4 50 250 10, tab 45
- text "Max 'Title' information characters", 46, 4 20 155 8, tab 45
- edit "", 47, 160 19 18 9, tab 45 limit 3
- text "Date/Time format 'Uploaded on' information", 50, 4 30 155 8, tab 45
- edit "", 51, 160 29 90 9, tab 45 autohs
- check "Display the 'menubar' module menu", 54, 4 70 200 10, tab 45
- check "Display the 'status' module menu", 55, 4 80 200 10, tab 45
- check "Display the 'channel' module menu", 56, 4 90 200 10, tab 45
- check "Display the 'query' module menu", 57, 4 100 200 10, tab 45
- check "Display the 'nicklist' module menu", 58, 4 110 200 10, tab 45
- menu "Menu", 22
- item "Help", 23, 22
- item break, 501
- item "About", 24, 22
- item break, 502
- item "Restart", 25, 22
- item break, 503
- item "Exit", 26, 22
- }
- ; --- End of dialogs ---
- ; --- Start of events ---
- ON *:DIALOG:wms_sets:*:*: {
- if ($devent == init) {
- dialog -t $dname $addon v $+ $wms_ver $lang(4) $iif($isalias(wmm_bel),$wmm_bel,->) (/wms_sets)
- did -ra $dname 1 $lang(3)
- did -ra $dname 2 $lang(4) 1
- did -ra $dname 3 $lang(5)
- did -ra $dname 6 $lang(6)
- did -ra $dname 7 $lang(7)
- did -ra $dname 8 $lang(8)
- did -ra $dname 16 $lang(6)
- did -ra $dname 14 $lang(9)
- did -ra $dname 17 $lang(7)
- did -ra $dname 18 $lang(8)
- did -ra $dname 13 $lang(4) 2
- did -ra $dname 9 $lang(10)
- did -ra $dname 11 $lang(11)
- did -ra $dname 20 $lang(12)
- did -ra $dname 27 $lang(19)
- did -ra $dname 12 $lang(13)
- did -ra $dname 21 v $+ $wms_ver
- did -o $dname 22 $lang(14)
- did -o $dname 23 $lang(15)
- did -o $dname 24 $lang(16)
- did -o $dname 25 $lang(17)
- did -o $dname 26 $lang(18)
- did -ra $dname 520 $lang(61)
- did -ra $dname 29 $lang(47) $qt($lang(49)) $lang(48)
- did -ra $dname 30 $lang(47) $qt($lang(50)) $lang(48)
- did -ra $dname 31 $lang(47) $qt($lang(51)) $lang(48)
- did -ra $dname 32 $lang(47) $qt($lang(54)) $lang(48)
- did -ra $dname 33 $lang(47) $qt($lang(55)) $lang(48)
- did -ra $dname 34 $lang(47) $qt($lang(52)) $lang(48)
- did -ra $dname 35 $lang(47) $qt($lang(53)) $lang(48)
- did -ra $dname 36 $lang(47) $qt($lang(56)) $lang(48)
- did -ra $dname 37 $lang(47) $qt($lang(57)) $lang(48)
- did -ra $dname 38 $lang(47) $qt($lang(58)) $lang(48)
- did -ra $dname 45 $lang(4) 3
- did -ra $dname 44 $lang(62)
- did -ra $dname 52 $lang(66)
- did -ra $dname 50 $lang(65) $qt($lang(56)) $lang(48)
- did -ra $dname 46 $lang(63) $qt($lang(49)) $lang(64)
- did -ra $dname 54 $lang(68) $qt(menubar) $lang(69)
- did -ra $dname 55 $lang(68) $qt(status) $lang(69)
- did -ra $dname 56 $lang(68) $qt(channel) $lang(69)
- did -ra $dname 57 $lang(68) $qt(query) $lang(69)
- did -ra $dname 58 $lang(68) $qt(nicklist) $lang(69)
- if ($istok(%wms_menu,menubar,32)) { did -c $dname 54 }
- if ($istok(%wms_menu,status,32)) { did -c $dname 55 }
- if ($istok(%wms_menu,channel,32)) { did -c $dname 56 }
- if ($istok(%wms_menu,query,32)) { did -c $dname 57 }
- if ($istok(%wms_menu,nicklist,32)) { did -c $dname 58 }
- if ($istok(%wms_show,title,32)) { did -c $dname 29 }
- if ($istok(%wms_show,length,32)) { did -c $dname 30 }
- if ($istok(%wms_show,views,32)) { did -c $dname 31 }
- if ($istok(%wms_show,favorites,32)) { did -c $dname 32 }
- if ($istok(%wms_show,comments,32)) { did -c $dname 33 }
- if ($istok(%wms_show,listeners,32)) { did -c $dname 34 }
- if ($istok(%wms_show,reposts,32)) { did -c $dname 35 }
- if ($istok(%wms_show,uploaded_on,32)) { did -c $dname 36 }
- if ($istok(%wms_show,uploaded_by,32)) { did -c $dname 37 }
- if ($istok(%wms_show,link,32)) { did -c $dname 38 }
- if (%wms_tiny) { did -c $dname 520 }
- if (%wms_status) { did -c $dname 12 }
- if (%wms_show_empty) { did -c $dname 44 }
- if (%wms_strip) { did -c $dname 52 }
- if (%wms_prefix_chan) { did -ra $dname 10 %wms_prefix_chan }
- if (%wms_prefix_nick) { did -ra $dname 5 %wms_prefix_nick }
- if (%wms_max_results) { did -ra $dname 28 %wms_max_results }
- if (%wms_title_chars_max) { did -ra $dname 47 %wms_title_chars_max }
- if (%wms_uploaded_on_format) { did -ra $dname 51 %wms_uploaded_on_format }
- var %f = $scriptdir $+ wms_lang.ini
- if ($ini(%f,0)) {
- var %t = $v1
- var %i = 1
- while (%i <= %t) {
- var %l = $ini(%f,%i)
- if (%l) && (%l !== %wms_lang) { did -a $dname 19 %l }
- inc %i
- }
- if (%wms_lang) { did -ca $dname 19 %wms_lang }
- }
- else { did -b $dname 19 }
- wms_ignore_chans_list
- wms_ignore_nicks_list
- }
- if ($devent == menu) {
- if ($did == 23) { url $help_url }
- if ($did == 24) { _input ok 60 v $+ $wms_ver $lang(36) $wms_crdate $lang(26) $wms_owner }
- if ($did == 25) { dialog -k $dname | .timer -mo 1 500 wms_sets }
- if ($did == 26) { dialog -k $dname }
- }
- if ($devent == close) {
- if (!%wms_show) { set %wms_show title link }
- if (!$did(5)) || ($did(5) isalnum) { set %wms_prefix_chan @ }
- if (!$did(10)) || ($did(10) isalnum) { set %wms_prefix_nick ! }
- if (!$did(28)) || (!$wmm_isdigit($did(28))) || ($did(28) > 9) { set %wms_max_results 3 }
- if (!$did(47)) || (!$wmm_isdigit($did(47))) || ($did(47) > 300) { set %wms_title_chars_max 100 }
- if (!$did(51)) { set %wms_uploaded_on_format $wmm_d_format }
- if ($did(51)) && (!$wmm_cdate($did(51))) { set %wms_uploaded_on_format $wmm_d_format }
- if ($did(19)) { set %wms_lang $did(19) }
- }
- if ($devent == edit) {
- if ($did == 5) {
- if ($did($did).text) { set %wms_prefix_nick $v1 }
- else { unset %wms_prefix_nick }
- }
- if ($did == 10) {
- if ($did($did).text) { set %wms_prefix_chan $v1 }
- else { unset %wms_prefix_chan }
- }
- if ($did == 28) {
- if ($did($did).text) { set %wms_max_results $v1 }
- else { unset %wms_max_results }
- }
- if ($did == 47) {
- if ($did($did).text) { set %wms_title_chars_max $v1 }
- else { unset %wms_title_chars_max }
- }
- if ($did == 51) {
- if ($did($did).text) { set %wms_uploaded_on_format $v1 }
- else { unset %wms_uploaded_on_format }
- }
- }
- if ($devent == sclick) {
- if ($did == 29) {
- var %v = title
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 30) {
- var %v = length
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 31) {
- var %v = views
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 32) {
- var %v = favorites
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 33) {
- var %v = comments
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 34) {
- var %v = listeners
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 35) {
- var %v = reposts
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 36) {
- var %v = uploaded_on
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 37) {
- var %v = uploaded_by
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 38) {
- var %v = link
- if (!$istok(%wms_show,%v,32)) { set %wms_show $addtok(%wms_show,%v,32) }
- else { set %wms_show $remtok(%wms_show,%v,1,32) }
- }
- if ($did == 520) {
- if (!%wms_tiny) { set %wms_tiny 1 }
- else { set %wms_tiny 0 }
- }
- if ($did == 12) {
- if (!%wms_status) { set %wms_status 1 }
- else { set %wms_status 0 }
- }
- if ($did == 44) {
- if (!%wms_show_empty) { set %wms_show_empty 1 }
- else { set %wms_show_empty 0 }
- }
- if ($did == 52) {
- if (!%wms_strip) { set %wms_strip 1 }
- else { set %wms_strip 0 }
- }
- if ($did == 54) {
- if (!$istok(%wms_menu,menubar,32)) { set %wms_menu $addtok(%wms_menu,menubar,32) }
- else { set %wms_menu $remtok(%wms_menu,menubar,1,32) }
- }
- if ($did == 55) {
- if (!$istok(%wms_menu,status,32)) { set %wms_menu $addtok(%wms_menu,status,32) }
- else { set %wms_menu $remtok(%wms_menu,status,1,32) }
- }
- if ($did == 56) {
- if (!$istok(%wms_menu,channel,32)) { set %wms_menu $addtok(%wms_menu,channel,32) }
- else { set %wms_menu $remtok(%wms_menu,channel,1,32) }
- }
- if ($did == 57) {
- if (!$istok(%wms_menu,query,32)) { set %wms_menu $addtok(%wms_menu,query,32) }
- else { set %wms_menu $remtok(%wms_menu,query,1,32) }
- }
- if ($did == 58) {
- if (!$istok(%wms_menu,nicklist,32)) { set %wms_menu $addtok(%wms_menu,nicklist,32) }
- else { set %wms_menu $remtok(%wms_menu,nicklist,1,32) }
- }
- if ($did == 4) {
- if ($did($did).seltext) { did -e $dname 7 }
- }
- if ($did == 15) {
- if ($did($did).seltext) { did -e $dname 17 }
- }
- if ($did == 7) {
- did -b $dname $did
- var %s = $did(4).seltext
- if (!%s) { return }
- var %net = $gettok(%s,1,32)
- var %chan = $gettok(%s,3,32)
- set %wms_ignore_ [ $+ [ %net ] $+ ] _chans $remtok(%wms_ignore_ [ $+ [ %net ] $+ ] _chans,%chan,1,32)
- if (!%wms_ignore_ [ $+ [ %net ] $+ ] _chans) {
- unset %wms_ignore_ [ $+ [ %net ] $+ ] _chans
- set %wms_ignore_chans_networks $remtok(%wms_ignore_chans_networks,%net,1,32)
- if (!%wms_ignore_chans_networks) { unset %wms_ignore_chans_networks }
- }
- wms_ignore_chans_list
- }
- if ($did == 17) {
- did -b $dname $did
- var %s = $did(15).seltext
- if (!%s) { return }
- var %net = $gettok(%s,1,32)
- var %nick = $gettok(%s,3,32)
- set %wms_ignore_ [ $+ [ %net ] $+ ] _nicks $remtok(%wms_ignore_ [ $+ [ %net ] $+ ] _nicks,%nick,1,32)
- if (!%wms_ignore_ [ $+ [ %net ] $+ ] _nicks) {
- unset %wms_ignore_ [ $+ [ %net ] $+ ] _nicks
- set %wms_ignore_nicks_networks $remtok(%wms_ignore_nicks_networks,%net,1,32)
- if (!%wms_ignore_nicks_networks) { unset %wms_ignore_nicks_networks }
- }
- wms_ignore_nicks_list
- }
- if ($did == 6) {
- var %net = $input($lang(27),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
- if (!$dialog($dname)) { return }
- if (!%net) { wms_sets | return }
- if ($numtok(%net,32) !== 1) { _input error 60 $lang(28) | wms_sets | return }
- if ($len(%net) > 50) { _input error 60 $lang(29) | wms_sets | return }
- var %chan = $input($lang(30),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
- if (!$dialog($dname)) { return }
- if (!%chan) { wms_sets | return }
- if ($numtok(%chan,32) !== 1) { _input error 60 $lang(31) | wms_sets | return }
- if ($numtok(%chan,44) !== 1) { _input error 60 $lang(31) | wms_sets | return }
- if ($left(%chan,1) !== $chr(35)) { _input error 60 $lang(32) | wms_sets | return }
- if ($istok(%wms_ignore_ [ $+ [ %net ] $+ ] _chans,%chan,32)) { _input error 60 $lang(33) | wms_sets | return }
- set %wms_ignore_ [ $+ [ %net ] $+ ] _chans $addtok(%wms_ignore_ [ $+ [ %net ] $+ ] _chans,%chan,32)
- if (!$istok(%wms_ignore_chans_networks,%net,32)) { set %wms_ignore_chans_networks $addtok(%wms_ignore_chans_networks,%net,32) }
- wms_ignore_chans_list
- wms_sets
- }
- if ($did == 16) {
- var %net = $input($lang(27),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
- if (!$dialog($dname)) { return }
- if (!%net) { wms_sets | return }
- if ($numtok(%net,32) !== 1) { _input error 60 $lang(28) | wms_sets | return }
- if ($len(%net) > 50) { _input error 60 $lang(29) | wms_sets | return }
- var %nick = $input($lang(21),eidbk60,$addon $iif($isalias(wmm_bel),$wmm_bel,->) $lang(22))
- if (!$dialog($dname)) { return }
- if (!%nick) { wms_sets | return }
- if ($numtok(%nick,32) !== 1) { _input error 60 $lang(35) | wms_sets | return }
- if ($istok(%wms_ignore_ [ $+ [ %net ] $+ ] _nicks,%nick,32)) { _input error 60 $lang(34) | wms_sets | return }
- set %wms_ignore_ [ $+ [ %net ] $+ ] _nicks $addtok(%wms_ignore_ [ $+ [ %net ] $+ ] _nicks,%nick,32)
- if (!$istok(%wms_ignore_nicks_networks,%net,32)) { set %wms_ignore_nicks_networks $addtok(%wms_ignore_nicks_networks,%net,32) }
- wms_ignore_nicks_list
- wms_sets
- }
- if ($did == 8) {
- did -b $dname 8,7
- var %z = 1
- while (%z <= $numtok(%wms_ignore_chans_networks,32)) {
- var %net = $gettok(%wms_ignore_chans_networks,%z,32)
- if (%wms_ignore_ [ $+ [ %net ] $+ ] _chans) { unset %wms_ignore_ [ $+ [ %net ] $+ ] _chans }
- inc %z
- }
- unset %wms_ignore_chans_networks
- wms_ignore_chans_list
- }
- if ($did == 18) {
- did -b $dname 18,17
- var %z = 1
- while (%z <= $numtok(%wms_ignore_nicks_networks,32)) {
- var %net = $gettok(%wms_ignore_nicks_networks,%z,32)
- if (%wms_ignore_ [ $+ [ %net ] $+ ] _nicks) { unset %wms_ignore_ [ $+ [ %net ] $+ ] _nicks }
- inc %z
- }
- unset %wms_ignore_nicks_networks
- wms_ignore_nicks_list
- }
- }
- }
- ON *:LOAD: { wms_load }
- ON *:UNLOAD: {
- wmm_d_close wms_sets
- var %1 = $scriptdir $+ wms_main.ico
- var %2 = $scriptdir $+ wms_lang.ini
- if ($isfile(%1)) { .remove -b $qt(%1) }
- if ($isfile(%2)) { .remove -b $qt(%2) }
- unset %wms_*
- hfree -w WMS_*
- .signal -n wmm_close $addon
- }
- 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) }
- ON $*:TEXT:$(/^(\Q $+ $replacecs(%wms_prefix_nick,\E,\E\\E\Q) $+ \E|\Q $+ $replacecs(%wms_prefix_chan,\E,\E\\E\Q) $+ \E).*/Si):#: {
- 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 }
- tokenize 32 $strip($1-)
- var %cn = $network $+ ~ $+ $nick $+ ~ $+ $chan
- if ($hget(WMS_FLOOD,%cn)) { return }
- if ($1 == %wms_prefix_nick $+ mixcloud) {
- hadd -mu6 WMS_FLOOD %cn 1
- 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 }
- wms_mixcloud_search $nick $chan .notice $2-
- }
- if ($1 == %wms_prefix_chan $+ mixcloud) {
- hadd -mu6 WMS_FLOOD %cn 1
- 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 }
- wms_mixcloud_search $nick $chan .msg $2-
- }
- }
- ; --- End of events ---
- ; --- Start of aliases ---
- alias wms_ver { return 1.6 }
- alias wms_crdate { return 02/12/2016 }
- alias wms_owner { return $+($chr(119),$chr(101),$chr(115),$chr(116),$chr(111),$chr(114)) }
- alias -l tools_ver { return 2.6 }
- 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)) }
- alias -l help_url { return http:// $+ $wms_owner $+ .ucoz.com/wmm }
- alias -l lang_url { return http:// $+ $wms_owner $+ .ucoz.com/wmm/languages/wms_lang.ini?nocache= $+ $ticks }
- alias -l main_ico_url { return http:// $+ $wms_owner $+ .ucoz.com/wmm/images/wms_main.ico?nocache= $+ $ticks }
- alias -l _input {
- if (!$1) { return }
- 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)) }
- 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)) }
- 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)) }
- }
- alias -l lang {
- var %f = $scriptdir $+ wms_lang.ini
- if (!$isfile(%f)) { return 0 }
- if (!%wms_lang) { set %wms_lang English }
- var %chk_lang = $ini(%f,%wms_lang)
- if (!%chk_lang) { return READ-ERROR! }
- var %r = $readini(%f,n,%wms_lang,$1)
- if (!%r) { return N/A }
- elseif (%r) { return %r }
- }
- ; ##########################################################
- alias wms_sets {
- 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 }
- 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 }
- 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 }
- var %d = wms_sets
- if ($dialog(%d)) { dialog -ve %d %d | return }
- var %i = $scriptdir $+ wms_main.ico
- var %l = $scriptdir $+ wms_lang.ini
- if (!$isfile(%l)) || (!$isfile(%i)) { var %delay = 1 }
- 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 }
- dialog -md %d %d
- }
- alias -l wms_sets_reopen {
- var %i = $scriptdir $+ wms_main.ico
- var %l = $scriptdir $+ wms_lang.ini
- if (!$isfile(%l)) || (!$isfile(%i)) { _input error 60 FATAL ERROR! @newline@ @newline@ $+ Error Code: 001 | return }
- wms_sets
- }
- alias -l wms_ignore_chans_list {
- var %d = wms_sets
- if (!$dialog(%d)) { return }
- did -b %d 7
- did -r %d 4
- if (!%wms_ignore_chans_networks) { did -b %d 4,8 | return }
- var %z = 1
- while (%z <= $numtok(%wms_ignore_chans_networks,32)) {
- var %net = $gettok(%wms_ignore_chans_networks,%z,32)
- var %chans = %wms_ignore_ [ $+ [ %net ] $+ ] _chans
- if (!%net) { goto next_net }
- var %i = 1
- while (%i <= $numtok(%chans,32)) {
- var %c = $gettok(%chans,%i,32)
- if (%c) { did -a %d 4 %net $iif($isalias(wmm_bel),$wmm_bel,->) %c }
- inc %i
- }
- :next_net
- inc %z
- }
- if ($did(4).lines) { did -ez %d 4 | did -e %d 8 }
- else { did -b %d 4,8 }
- }
- alias -l wms_ignore_nicks_list {
- var %d = wms_sets
- if (!$dialog(%d)) { return }
- did -b %d 17
- did -r %d 15
- if (!%wms_ignore_nicks_networks) { did -b %d 15,18 | return }
- var %z = 1
- while (%z <= $numtok(%wms_ignore_nicks_networks,32)) {
- var %net = $gettok(%wms_ignore_nicks_networks,%z,32)
- var %nicks = %wms_ignore_ [ $+ [ %net ] $+ ] _nicks
- if (!%net) { goto next_net }
- var %i = 1
- while (%i <= $numtok(%nicks,32)) {
- var %n = $gettok(%nicks,%i,32)
- if (%n) { did -a %d 15 %net $iif($isalias(wmm_bel),$wmm_bel,->) %n }
- inc %i
- }
- :next_net
- inc %z
- }
- if ($did(15).lines) { did -ez %d 15 | did -e %d 18 }
- else { did -b %d 15,18 }
- }
- alias -l wms_load {
- 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 }
- 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 }
- 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 }
- if ($isalias(wmm_dl)) { wmm_dl $main_ico_url $qt($scriptdir $+ wms_main.ico) }
- if ($isalias(wmm_dl)) { wmm_dl $lang_url $qt($scriptdir $+ wms_lang.ini) }
- if (!$var(wms_menu,0)) { set %wms_menu menubar }
- if (%wms_status == $null) { set %wms_status 1 }
- if (%wms_tiny == $null) { set %wms_tiny 1 }
- if (%wms_strip == $null) { set %wms_strip 0 }
- if (%wms_show_empty == $null) { set %wms_show_empty 0 }
- if (%wms_lang == $null) { set %wms_lang English }
- if (%wms_max_results == $null) { set %wms_max_results 3 }
- if (%wms_prefix_nick == $null) { set %wms_prefix_nick ! }
- if (%wms_prefix_chan == $null) { set %wms_prefix_chan @ }
- if (%wms_title_chars_max == $null) { set %wms_title_chars_max 100 }
- if (%wms_uploaded_on_format == $null) { set %wms_uploaded_on_format $wmm_d_format }
- if (%wms_show == $null) { set %wms_show title length views listeners comments link }
- hfree -w WMS_*
- .signal -n wmm_close $addon
- }
- alias -l wms_mixcloud_search {
- if (!$wmm_internet) || (!%wms_status) || (!$1-) { return }
- if ($3 == .msg) { var %output = $3 $2 }
- elseif ($3 == .notice) { var %output = $3 $1 }
- if (!%wms_show) { set %wms_show title link }
- if (!%wms_max_results) || (!$wmm_isdigit(%wms_max_results)) || (%wms_max_results > 9) { set %wms_max_results 3 }
- if (!%wms_title_chars_max) || (!$wmm_isdigit(%wms_title_chars_max)) || (%wms_title_chars_max > 300) { set %wms_title_chars_max 100 }
- if (!%wms_uploaded_on_format) || (!$wmm_cdate(%wms_uploaded_on_format)) { set %wms_uploaded_on_format $wmm_d_format }
- var %v = mixcloud_ $+ $wmm_random
- wmm_jsonopen -ud %v https://api.mixcloud.com/search/?q= $+ $wmm_urlencode($4-) $+ &type=cloudcast&limit= $+ %wms_max_results
- if ($wmm_jsonerror) { %output ( $+ $wmm_bold($1) $+ ): $lang(40) - ( $+ $lang(41) $wmm_bold($wmm_jsonerror) $+ ) | return }
- var %tot = $wmm_json(%v,data,length)
- if (!%tot) { %output ( $+ $wmm_bold($1) $+ ): $lang(42) | return }
- var %x = 0
- while (%x < %wms_max_results) {
- var %id = $wmm_json(%v,data,%x,key)
- if (!%id) { goto next }
- var %total = $calc(%total +1)
- if ($istok(%wms_show,title,32)) {
- var %title = $wmm_html2asc($wmm_fixtab($wmm_json(%v,data,%x,name)))
- if (%title) && ($len(%title) >= %wms_title_chars_max) { var %title = $left(%title,$calc(%wms_title_chars_max -3)) $+ ... }
- if (!%title) { var %title = $lang(67) }
- }
- if ($istok(%wms_show,length,32)) {
- var %duration = $duration($wmm_json(%v,data,%x,audio_length),3)
- if (!%duration) { var %duration = 00:00:00 }
- }
- if ($istok(%wms_show,uploaded_by,32)) {
- var %uploader = $wmm_json(%v,data,%x,user,name)
- if (!%uploader) { var %uploader = $lang(67) }
- }
- if ($istok(%wms_show,uploaded_on,32)) {
- var %uploaded = $date($wmm_convertdate($wmm_json(%v,data,%x,created_time)),%wms_uploaded_on_format)
- if (!%uploaded) { var %uploaded = $lang(67) }
- }
- if ($istok(%wms_show,link,32)) {
- var %url = $wmm_json(%v,data,%x,url)
- if (%wms_tiny) { var %url = $wmm_tinycom(%url) }
- if (!%url) { var %url = $lang(67) }
- }
- if ($istok(%wms_show,favorites,32)) { var %favorite = $wmm_json(%v,data,%x,favorite_count) }
- if ($istok(%wms_show,views,32)) { var %views = $wmm_json(%v,data,%x,play_count) }
- if ($istok(%wms_show,comments,32)) { var %comments = $wmm_json(%v,data,%x,comment_count) }
- if ($istok(%wms_show,reposts,32)) { var %reposts = $wmm_json(%v,data,%x,repost_count) }
- if ($istok(%wms_show,listeners,32)) { var %listeners = $wmm_json(%v,data,%x,listener_count) }
- if (%wms_show_empty) {
- 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) $+ )
- %output $iif(%wms_strip,$strip(%msg),%msg)
- }
- elseif (!%wms_show_empty) {
- 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) $+ )
- %output $iif(%wms_strip,$strip(%msg),%msg)
- }
- :next
- inc %x
- }
- if (!%total) { %output ( $+ $wmm_bold($1) $+ ): $lang(42) }
- }
- ; --- End of aliases ---
- ; --- Start of menus ---
- menu * {
- $iif($istok(%wms_menu,$menu,32),-)
- $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
- $iif($istok(%wms_menu,$menu,32),-)
- }
- ; --- End of menus ---
- ; -- Start of groups ---
- #mixcloud-search off
- #mixcloud-search end
- ; -- End of groups ---
- ; ------------------------------------------------------------------------------ EOF ------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement