Horscht
Banned?
Hi
I downloaded this script, which echoes whatever is played in my Xbox Media Center (script will be attached at the end). Currently I have to name a channel where it should echo to, and whenever I type /gog, it'll echo what is playing in the defined channel. What do I have to change to not need to assign a chan first, but to simply type /gog and get the script to echo in the chan I am typing it? If you could tell me which line to edit, i would be very thankfull
tia
Horscht
I downloaded this script, which echoes whatever is played in my Xbox Media Center (script will be attached at the end). Currently I have to name a channel where it should echo to, and whenever I type /gog, it'll echo what is playing in the defined channel. What do I have to change to not need to assign a chan first, but to simply type /gog and get the script to echo in the chan I am typing it? If you could tell me which line to edit, i would be very thankfull
tia
Horscht
Code:
##########################################
# 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 #
##########################################
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¶meter= $+ %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 (%temp != $null) { write -c temp.txt %temp | if ( [li] isin $read(temp.txt,1)) { gstyle $read(temp.txt,1) } }
}
}
on *:sockread:zool2:{
if ($sockerr) { echo -a Error | halt }
else {
var %temp
sockread %temp
if (%temp != $null) { write -c temp.txt %temp | if ( [li] isin $read(temp.txt,1)) { gstyle $read(temp.txt,1) } }
}
}
on 1:load:{ set %gip $$?="XBox's Ip" | /set %gchan $$?="Channel to display(Leave blank just to echo)" }
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 $+ ) •7GIZmoep3•
if (%gchan != $null) { msg %gchan %info }
if (%gchan == $null) { echo -a %info }
if (%ga == 1) { set %ping $calc((%time1 - %curr1) + 3) | .timerzool 1 %ping /gog }
unset %file %file1 %curr %curr1 %time1 %time %art %title %ping
}
Menu channel {
-
XBMC GiZmoep3
.Start Announce:/gog
.Auto ReAnnounce
..On:/set %ga 1
..Off:/set %ga 0
..Stop Announce:.timerzool off
.Other
..Change Ip:/set %gip $$?="XBox's Ip"
..Change Channel:/set %gchan $$?="Channel to display(Leave blank just to echo)"
-
}
Last edited by a moderator: