Advertisement
ThomasDieKleineLok

radio dingens

May 16th, 2023 (edited)
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.22 KB | None | 0 0
  1. ##########################################################
  2. ##
  3. ## Radio-script v 1.0.3
  4. ##
  5. ## Lasst es wie es ist und gut ist
  6. ##
  7. ## mfg 2013 ©ThomasDieKleineLok
  8. ##
  9. ###########################################################
  10. on *:start:{
  11.   if (!$hget(sound)) { hmake sound }
  12.   if ($exists($qt(sound.hsh))) { hload sound $qt(sound.hsh) }
  13. }
  14. on *:connect:{ if (($hget(sound,chan)) && ($hget(sound,anaus) == 1)) { radiostart } }
  15. on *:text:*:#:{
  16.   if ($1 == !radio) && ($2 == help) { msg $chan 9radio-bot befehle: | msg $chan 9!radio on 10startet das posten | msg $chan 9!radio off 10stoppt das posten | msg $chan 09!radio chan #derraum 10radio channel setzen mit | msg $chan 09!radio surl https://www.habedichlieb.de:9999/der/radiostream/zumhören.mp3 10Z.B. 10Radio stream setzen zum Zuhören. | msg $chan 09!radio url https://www.habedichlieb.de:9999/der/radiostream/ 10Z.B. 10Radio URL zum Auslesen setzen. }
  17.   if ($1 == !radio) && ($2 == on) && ($hget(sound,chan)) { radiostart | msg $chan 10radio ist nun an... | hadd -m sound anaus 1 }
  18.   if ($1 == !radio) && ($2 == on) && (!$hget(sound,chan)) { msg $chan 10bitte erst mit 09!radio chan #derraum 10den channel setzen }
  19.   if ($1 == !radio) && ($2 == off) { .timerradio off |  msg $chan 10radio ist nun aus... | hadd -m sound anaus 0 }
  20.   if ($1 == !radio) && ($2 == chan) { hadd -m sound chan $3 | msg $chan 10Im Channel $+(,09,$3,10) poste ich nun die Mucke | hsave -o sound "sound.hsh" }
  21.   if ($1 == !radio) && ($2 == surl) { hadd -m sound surl $3 | msg $chan Habe folgende Stream URL gesetz, $hget(sound,surl) | hsave -o sound "sound.hsh" }
  22.   if ($1 == !radio) && ($2 == url) { hadd -m sound url $3 | msg $chan Habe folgende URL zum Auslesen gesetz, $hget(sound,url) | hsave -o sound "sound.hsh" }
  23.   if ($1 == !radio) && ($2 == stats) {
  24.     msg $hget(sound,chan) $+(09[R],$chr(32),,04,song,,15,:,,$chr(32),,04,$replace($hget(sound,song),$chr(245),$chr(32),&,&),$chr(32),,15,*,,,14,$chr(32),$hget(sound,surl),$chr(32),,15,*)
  25.     msg $hget(sound,chan) $+(09[R],$chr(32),,04,Spitzenzuhörer,,15,:,,$chr(32),,14,$hget(sound,peak),$chr(32),,04,Aktuelle Zuhörer,,15,:,,$chr(32),,14,$hget(sound,listeners))            
  26.     msg $hget(sound,chan) $+(09[R],$chr(32),,04,Bitrate,,15,:,,$chr(32),,14,$hget(sound,bitrate),$chr(32),kB,$chr(47),s)            
  27.   }
  28. }
  29.  
  30. alias -l radiostart { .timerradio 0 10 radio }
  31. alias -l radio { sockclose radio | sockopen -e radio $gettok($gettok($hget(sound,url),2,47),1,58) $gettok($gettok($hget(sound,url),3,58),1,47) | sockmark radio $remove($hget(sound,url),https://,http://,$gettok($hget(sound,url),2,47)) }
  32.  
  33. on *:SOCKOPEN:radio: {
  34.   sockwrite -n $sockname GET $sock($sockname).mark HTTP/1.1
  35.   sockwrite -n $sockname Host: $sock($sockname).addr
  36.   sockwrite -n $sockname Connection: close
  37.   sockwrite -n $sockname
  38. }
  39.  
  40. on *:SOCKREAD:radio: {
  41.   var %sound_tp | sockread %sound_tp
  42.   ;echo -a 1 %sound_tp
  43.   if ($regex(%sound_tp,/<tr><td>Bitrate:</td><td class="streamdata">(.+?)</td></tr><tr><td>Current Listeners:</td><td class="streamdata">(.+?)</td></tr><tr><td>Peak Listeners:</td><td class="streamdata">(.+?)</td></tr>.+?<tr><td>Current Song:</td><td class="streamdata">(.+?)</td></tr>/)) {
  44.     if ($hget(sound,bitrate) != $regml(1)) {
  45.       msg $hget(sound,chan) $+(09[R],$chr(32),,04,Bitrate gewechselt zu,,15,:,,$chr(32),,14,$regml(1),$chr(32),kB,$chr(47),s)            
  46.       hadd -m sound bitrate $regml(1)
  47.     }
  48.     if (($hget(sound,listeners) != $regml(2)) || ($hget(sound,peak) != $regml(3))) {
  49.       msg $hget(sound,chan) $+(09[R],$chr(32),$iif($hget(sound,peak) != $regml(3),$+(,04,Spitzenzuhörer,,15,:,,$chr(32),,14,$regml(3),$chr(32))),$iif($hget(sound,listeners) != $regml(2),$+(,04,Aktuelle Zuhörer,,15,:,,$chr(32),,14,$regml(2))))            
  50.       hadd -m sound listeners $regml(2) | hadd -m sound peak $regml(3)
  51.     }
  52.     if ($hget(sound,song) != $replace($regml(4),$chr(32),$chr(245))) {
  53.       msg $hget(sound,chan) $+(09[R],$chr(32),,04,song,,15,:,,$chr(32),,04,$replace($regml(4),&amp;,&),$chr(32),,15,*,,,14,$chr(32),$hget(sound,surl),$chr(32),,15,*)
  54.       hadd -m sound song $replace($regml(4),$chr(32),$chr(245))
  55.     }
  56.     hsave -o sound "sound.hsh"
  57.   }
  58. }
  59.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement