after looking at the documentation this can be done alot simpler
Macro VLCPosBck
Macro VLCPosFwd
Macro VLCPosBck
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest h._create
str s1="http://127.0.0.1:8080/requests/status.xml"
str enc.encrypt(4 ":vlcremote");;password for vlc http server(username:password) if no usename then just :password
h.Open("GET" s1)
h.setRequestHeader("content-type", "application/xml"); h.SetRequestHeader("Authorization", F"Basic {enc}")
h.send()
err
,out _error.description
,ret
if h.Status=200
,IXml x._create
,x.FromString(h.ResponseText)
,str vlcState =x.RootElement.Child("state").Value
,if vlcState !="stopped"
,,str vlcPosition=x.RootElement.Child("position").Value
,,double d=val(vlcPosition 2)
,,str seek
,,if(d<=0.05)
,,,seek="95%"
,,else
,,,seek="-5%"
,,seek.escape(9)
,,s1=F"http://127.0.0.1:8080/requests/status.xml?command=seek&val={seek}"
,,h.Open("GET" s1)
,,h.setRequestHeader("content-type", "application/xml"); h.SetRequestHeader("Authorization", F"Basic {enc}")
,,h.send()
,else
,,out x.RootElement.Child("state").Value
Macro VLCPosFwd
typelib WinHttp {662901FC-6951-4854-9EB2-D9A2570F2B2E} 5.1
WinHttp.WinHttpRequest h._create
str s1="http://127.0.0.1:8080/requests/status.xml"
str enc.encrypt(4 ":vlcremote");;password for vlc http server(username:password) if no usename then just :password
h.Open("GET" s1)
h.setRequestHeader("content-type", "application/xml"); h.SetRequestHeader("Authorization", F"Basic {enc}");
h.send()
err
,out _error.description
,ret
if h.Status=200
,IXml x._create
,x.FromString(h.ResponseText)
,str vlcState =x.RootElement.Child("state").Value
,if vlcState !="stopped"
,,str vlcPosition=x.RootElement.Child("position").Value
,,double d=val(vlcPosition 2)
,,str seek
,,if(d>=0.95)
,,,seek="5%"
,,else
,,,seek="+5%"
,,seek.escape(9)
,,s1=F"http://127.0.0.1:8080/requests/status.xml?command=seek&val={seek}"
,,h.Open("GET" s1)
,,h.setRequestHeader("content-type", "application/xml"); h.SetRequestHeader("Authorization", F"Basic {enc}")
,,h.send()
,else
,,out x.RootElement.Child("state").Value