mIRC Home    About    Download    Register    News    Help

Print Thread
#261070 25/07/17 09:02 PM
A
Abaddon
Abaddon
A
Can someone give me example code for song request ? Thanks

#261071 26/07/17 12:17 AM
Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
Please explain more clearly what you're wanting. Are you wanting a script that responds to someone else's request, or a script that requests a song if someone plays a sound you don't already have? Or, is the script supposed to respond to some filetypes like mp3 but ignore other sounds like midi?

Note: in mirc-options/sound/requests you can check a box "listen for 'nick file' requests" to respond to someone else's requests, or check the box to "send 'nick file' as private msg".

Nowever, some of those options can get you banned from some channels, because they don't want you to open a query window to beg for a sound.

maroon #261072 26/07/17 01:22 AM
A
Abaddon
Abaddon
A
I want something like nightbot song request

#261076 26/07/17 02:27 PM
Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
You're still not being clear. Are you wanting to request the songs or let others request from you? If there's something out there that has what you want, why are you wanting the wheel reinvented?

maroon #261077 26/07/17 03:26 PM
A
Abaddon
Abaddon
A
i want script that get the request from viewer and plays the song.Sorry for bad English smile

Last edited by Abaddon; 26/07/17 03:27 PM.
#261079 26/07/17 07:29 PM
Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
This snippet for the remotes tab will play a sound_filename.mp3 to channel if someone types in channel: !song sound_filename.mp3

If you have other types of sounds to play, you can add them to the list next to mp3 wav mid

If you want this to react to !song typed only in 1 channel, change :#: into :#NameOfChannel:

If you don't want to listen to sounds played into channel, you can remove the line beginning with "ctcp" and also those following it. If you want to listen to songs played into channel only for 1 channel, add a line next to ";place_holder" which looks like:

if ($chan != #NameOfChannel) return


Code:
on *:TEXT:!song *:#:{
  var %song $nopath($strip($2-))
  var %type $gettok(%song,-1,46)
  if (!$istok(mp3 wav mid,%type,32)) return
  var %file $getdir(%song) $+ %song
  if ($isfile(%file)) { ctcp # SOUND $qt(%song) | echo -ag played requested sound: %song }
else { echo -s actions to take if %song does not exist }
}

ctcp *:SOUND:*:{
  ;place_holder
  var %song $nopath($strip($2-))
  var %type $gettok(%song,-1,46)
  if (!$istok(mp3 wav mid,%type,32)) return
  var %file $getdir(%song) $+ %song
  if ($isfile(%file)) { echo $iif($target == $me,-s,#) listening to song played to $iif($target == $me,me,#) : %song | splay -q %song }
  else { echo $iif($target == $me,-s,#) Note: do not have song played to $iif($target == $me,me,#) : %song }
}

maroon #261080 26/07/17 10:58 PM
A
Abaddon
Abaddon
A
i want when someone types !song <youtube link> the bot do play the song. Sorry for bad English smile

Last edited by Abaddon; 26/07/17 10:59 PM.
#261081 26/07/17 11:28 PM
Joined: Jan 2004
Posts: 2,081
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jan 2004
Posts: 2,081
It's been like pulling teeth to get you to tell what you want. It's frustrating to go down the wrong path only to discover the effort is wasted. Are you wanting it to just open that url in your web-browser? If that's all it's doing, and the requestor already knows the link, why can't they just do "/url youtubelink". If it's supposed to be 'like' nightbot, can't they just *use* nightbot? Or are you asking for something that's like nightbot, but not like nightbot?


Link Copied to Clipboard