All pastes #50586 Raw Edit

Miscellany

public text v1 · immutable
#50586 ·published 2006-04-22 20:51 UTC
rendered paste body
##########################################
# Use/Edit this at your own risk         #
# Thanks to Xomp for Idea/Testing/Layout #
# Thanks to Vic10us for http syntax help #
# Thanks to all the people who helped    #
# contact me at zool@dead-blood.com      #
# or on efnet as GiZmoe in #evolutionx   #
##########################################
# Modifié par Miles Prower,              #
#   sur les conseils de Ag2X             #
# (irc.epiknet.org | #GX-Mod.com         #
#                  | #scripts            #
##########################################

alias gog { sockopen zool %gip 80 }
on *:sockopen:zool:{
  sockwrite -n $sockname GET /xbmcCmds/xbmcHttp?command=getcurrentlyplaying HTTP/1.1
  sockwrite -n $sockname Host: %gip $+ $crlf $+ $crlf
}
on *:sockopen:zool2:{
  sockwrite -n $sockname GET /xbmcCmds/xbmcHttp?command=GetTagFromFileName&parameter= $+ %file HTTP/1.1
  sockwrite -n $sockname Host: %gip $+ $crlf $+ $crlf
}

on *:sockread:zool:{
  if ($sockerr) { echo -a Error | halt }
  else {
    var %temp
    sockread %temp
    if (<li> isin %temp) gstyle %temp
  }
}
on *:sockread:zool2:{
  if ($sockerr) { echo -a Error | halt }
  else {
    var %temp
    sockread %temp
    if (<li> isin %temp) gstyle %temp
  }
}
on 1:load:{ set %gip $$?="XBox's Ip" }
alias gstyle {
  if (<li>Filename isin $1-) { set %file1 $remove($1-,<li>Filename:) | set %file $remove($replace(%file1,$chr(32),'%20'),') | sockopen zool2 %gip 80 }
  if (<li>Duration isin $1-) { set %time1 $remove($1-,<li>Duration:) | set %time $asctime(%time1,n:ss) }
  if (<li>Time isin $1-) { set %curr $remove($1-,<li>Time:) | set %curr1 $calc($gettok(%curr,2,58) + $calc($gettok(%curr,-2,58) * 60)) }
  if (<li>Artist isin $1-) { set %art $remove($1-,<li>Artist:) }
  if (<li>Title isin $1-) { set %title $remove($1-,<li>Title:) }

  if (<li>Release isin $1-) { gecho }
}
alias gecho {
  set %info [7XBMC] • [ $+ %art $+ $chr(32) $+ ¤ $chr(32) $+  $+ %title $+ ] ( $+ %curr $+ / $+ %time $+ )
  msg %chan %info
  unset %file %file1 %curr %curr1 %time1 %time %art %title %ping
}
Menu channel {
  -
  XBMC Now Playing
  .Afficher la piste en cours:{ set %chan $chan | gog }
  .Changer l'Ip de la XBox:/set %gip $$?="Entrez ici l'IP de votre XBox"
}