I don't have enough time to write the complete mIRC scripting
manual, so just some tips for this moment:
Getting plug-in configuration:
1. Do as described in Plug-In
Control section (deprecated API)
2. $dde mPlug cfg_* "",
where * can be string,
cmdstr, strip,
enabled, convert,
update. Use /dde mPlug cfgdump to
get all variables list.
Setting plug-in configuration: (updated)
1. Do as described in Plug-In Control section
(deprecated API)
2.
/dde mPlug setvar <variable> <value>, for
instance, to disable AMIP type /dde mPlug setvar enabled 0.
Variables list can be retrieved using /dde mplug cfgdump .
You can load/save config using /dde
mplug config load and /dde mplug config save.
Getting playing song information:
1. $dde mPlug var_* "",
where * can be any %variable
(without % symbol) e.g. var_name,
var_1, var_fl,
e.t.c.
2. /dde mPlug format <handler> <format_string>
Calls handler with format_string with replaced variables. (/cmsg,%lb,%mcmd
are not handled) e.g. /dde mPlug format /echo "playing &u%name&u
(%4|%5|%7)"
3. New to AMIP 2.00: "$dde mPlug format
string" variable can be used in mIRC. <string>
is like config string. all variables are replaced. But <string>
cannot contain spaces!!! Replace all spaces by '_'
sign
(underscore). Example:
$dde mPlug format "np:_&b%name&p_%?4<"%4"|>_(%?7<%7|->|%?5<%5|->|%?VBR='yes'<%ABR|%br>~kbps)"
(New)
"$dde mPlug fn <id>"
variable can be used in mIRC to get name of file from playlist with
the specified <id> number"
"$dde mPlug title <id>" variable
can be used in mIRC to get title from playlist with the specified <id>
number"
Getting any song information:
There is special variable: $dde mPlug formatsong
"song_number:string_with_your_variables".
Example: $dde mPlug formatsong "10:%name_br:%br~kbps".
Note that spaces are changed to underscores. It is like $dde
mPlug format ... but gets info about song specified by number
separated from the rest string by the colon.
Here is a good mIRC script example
for AMIP sent by "Shawn Jackson" <rede83(at)home.com> (updated
by Thanatos 6000) :
;############################## AMIP #############################
;1. Place in AMIP: /mp3ad
;2. Set channel to advertise in in this script
;3. Turn this script on
;-----Display current song playing on request-----
alias song {
say [Song: %song $+ ] [Album: %songalbum %songyear $+ ] [ $+ %songlength $+ / $+ %songbitrate $+ kbps/ $+ %songtyp $+ ] }
;-----Song Advertisement-----
alias adsong {
/msg %amipchan [Song: %song $+ ] [Album: %songalbum $iif(%songyear,%songyear) $+ ] [ $+ %songlength $+ / $+ %songbitrate $+ kbps/ $+ %songtyp $+ ] }
;-----Set Variables-----
alias songinfo {
set %songfile $dde(mPlug,var_fn)
set %song $dde(mPlug,var_name)
set %songlength $dde(mPlug,var_min) $+ m $+ $dde(mPlug,var_sec) $+ s
set %songyear $dde(mPlug,var_5)
set %songalbum $dde(mPlug,var_4)
set %songtyp $dde(mPlug,var_typ)
set %songbitrate $dde(mPlug,var_br)
if (%songalbum == $null) {
set %songalbum Unavailiable
}
if %songyear != $null) {
set %songyear $chr(40) $+ %songyear $+ $chr(41)
}
}
;-----Delay to allow AMIP to update completely-----
alias mp3ad {
.timer 1 1 getsonginfo
}
;-----Set
alias getsonginfo {
songinfo
if ((%mp3ad.on == $true) && ($server != $null)) { adsong }
}
;-----Menu System-----
alias amipon {
set %advert.onoff On
set %mp3ad.on $true
}
alias amipoff {
set %advert.onoff Off
set %mp3ad.on $false
}
alias chamipchan {
set %amipchan $?="Channel to advertise in: (eg. #chat)"
}
menu menubar {
MP3Ad
. $+ %advert.onoff
..On:/amipon
..Off:/amipoff
.-
.Channel
.. $+ %amipchan
...Change:/chamipchan
}
;-----Script Loading-----
on *:load: {
/amipload
}
alias amipload {
set %mp3ad.on $false
set %advert.onoff Off
set %amipchan #albums
echo 1. Place in AMIP: /mp3ad
echo 2. Set channel to advertise in in this script
echo 3. Turn this script on
}
;-----Control Winamp With mIRC-----
alias mp3 {
if ($1 = next) {
dde mPlug control >
}
elseif ($1 = prev) {
dde mPlug control <
}
elseif ($1 = play) {
dde mPlug control play
}
elseif ($1 = stop) {
dde mPlug control stop
}
elseif ($1 = pause) {
dde mPlug control pause
}
elseif ($1 = vol) {
if ($2 == up) {
dde mPlug control vup
}
if ($2 == down) {
dde mPlug control vdwn
}
elseif ($2 == mute) {
dde mPlug control vol 0
}
elseif (($2 >= 0) && ($2 <= 100)) {
%chvol = $2 / 100
%chvol = 255 * %chvol
dde mPlug control vol %chvol
unset %chvol
}
else {
echo Volume Usage
echo /mp3 vol echo Variables:
echo up - increases volume
echo down - decreases volume
echo mute - decreases volume completely
echo number - sets volume percentage (number between 1 and 100)
}
}
else {
echo Usage
echo /mp3 *
echo -
echo Variables:\
echo next - skips to next track on playlist
echo prev - skips to previous track
echo play - turns mp3 playback on/restarts track
echo stop - turns mp3 playback off
echo pause - pauses mp3 playback
echo vol * - changes volume, command alone displays * options
}
}