Old 28th October 2002, 21:37   #1
ann-dee-roo
Member
 
Join Date: Jun 2002
Posts: 64
need help with a script

Sorry, I'm a bit of a beginner at programming, PHP is all I know, so maki is quite different for me. In that script that Gonzotek wrote up for me, I need to define the BrowserID. I will be making more changes that I won't ask for the answers, but if you could help me with this it would be greatly appreciated. I am finding the documentation to be less that satisfactory. here's the script:

#include "lib/std.mi"

Global Browser myBrowser;
Global Timer submitTimer;

system.onScriptloaded() {
group browserGroup = getScriptGroup();
myBrowser = browserGroup.findObject("BrowserID");
submitTimer = NEW Timer;
submitTimer.setDelay(5000);
submitTimer.start();
}

system.onScriptUnloading(){
delete submitTimer;
}

submitTimer.onTimer() {
string submitURL = "http://24.68.98.82/song_current.php?title=";
myBrowser.navigateURL(submitURL+getPlayItemString());
}
ann-dee-roo is offline   Reply With Quote
Old 28th October 2002, 22:32   #2
Hollow
Major Dude
 
Hollow's Avatar
 
Join Date: Oct 2001
Location: Baker Lab, Ithaca NY
Posts: 1,128
Send a message via AIM to Hollow
BrowserID refers to the id="" field in the xml. So make sure that you a) have a browser object in your xml and b) have its id field the same as what appears in the findobject() line. It doesn't matter where you change this (ie in the maki or in the xml) they just have to match.

The moon is made of cheese.
Oh for some tasty moon cheese.
www.redtetrahedron.org
Hollow is offline   Reply With Quote
Old 28th October 2002, 23:03   #3
ann-dee-roo
Member
 
Join Date: Jun 2002
Posts: 64
What kind of object do I need for browser?
ann-dee-roo is offline   Reply With Quote
Old 28th October 2002, 23:12   #4
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
<browser id="browserid" x="5" y="6" w="100" h="100" />

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 28th October 2002, 23:26   #5
ann-dee-roo
Member
 
Join Date: Jun 2002
Posts: 64
ok i put that in my xml file (thanks gonzo), but still got the same gm error. my xml file appears as below:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<WinampAbstractionLayer version="0.8">

<scriptinfo>
<version>1.0</version>
<name>Song_current</name>
<comment>...</comment>
<author>Your Name here</author>
<email>aholmes84@hotmail.com</email>
<homepage>http://24.68.98.82/</homepage>
</scriptinfo>

<scripts>
<script id="song_current" file="song_current.maki"/>
</scripts>
<browser id="BrowserID" x="5" y="6" w="100" h="100" />
</WinampAbstractionLayer>
ann-dee-roo is offline   Reply With Quote
Old 28th October 2002, 23:59   #6
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
That's because the browser appears after the script does in the xml. Winamp loads resources from the xml in top-down order, so the script is instantiated before the browser is. Additionally, the script refers to a group (getscriptgroup), and you don't have a group in the xml. You need to build the interface around the browser object.
code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<WinampAbstractionLayer version="0.8">

<scriptinfo>
<version>1.0</version>
<name>Song_current</name>
<comment>...</comment>
<author>Your Name here</author>
<email>aholmes84@hotmail.com</email>
<homepage>http://24.68.98.82/</homepage>
</scriptinfo>

<groupdef id="browser.content.group">
<browser
id="browserid"
x="2"
y="23"
w="5"
relatw="1"
h="-30"
relath="1"
autoopen="1"
/>
<script id="song_current" file="song_current.maki"/>
</groupdef>


<container id="adrBrowser" name="ann-dee-roo's Browser" default_visible="1" >
<layout id="normal" minimum_h="116" minimum_w="275">
<Wasabi:StandardFrame:NoStatus
x="0" y="0" w="0" h="0" relatw="1" relath="1"
content="browser.content.group"
/>
</layout>
</container>
</WinampAbstractionLayer>


So the group, with the browser and script in it, is defined in <groupdef> first. Then it is placed into a layout by making it the content of a Wasabi:Standardframe:NoStatus group. The "Wasabi:Standardframe:NoStatus" group is just an easy way to get a standard Winamp3 window, which will inherit the properties (colors, design, etc.) of the active skin. Oh yeah, if you put a script directly into a group, it doesn't need to be surrounded by <scripts></scripts>.

-=Gonzotek=-

[edit] Fixed the relatw of the browser object...I dunno why I set it at 0[/edit]

I was away for a while.
But I'm feeling much better now.

Last edited by Gonzotek; 29th October 2002 at 00:19.
Gonzotek is offline   Reply With Quote
Old 29th October 2002, 00:05   #7
Hollow
Major Dude
 
Hollow's Avatar
 
Join Date: Oct 2001
Location: Baker Lab, Ithaca NY
Posts: 1,128
Send a message via AIM to Hollow
I removed this post, since quick draw Gonzo answered while i was writing my answer.

The moon is made of cheese.
Oh for some tasty moon cheese.
www.redtetrahedron.org
Hollow is offline   Reply With Quote
Old 29th October 2002, 00:18   #8
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
I struggled with this exact same problem like several months ago, so it's all in my head already.

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Old 29th October 2002, 01:43   #9
ann-dee-roo
Member
 
Join Date: Jun 2002
Posts: 64
Wow, I though the XML part would be the easy part, looks like I need to start doing my homework. Thanks gonzo, look slike there's only room for one maki-slinger in this forum hallow
ann-dee-roo is offline   Reply With Quote
Old 29th October 2002, 02:02   #10
Gonzotek
Gunslinger
 
Gonzotek's Avatar
 
Join Date: May 2000
Location: Terminus
Posts: 4,693
Quote:
Originally posted by ann-dee-roo
look slike there's only room for one maki-slinger in this forum hallow
No way man! The more the merrier! I need advice too, from time to time

-=Gonzotek=-

I was away for a while.
But I'm feeling much better now.
Gonzotek is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Skinning and Design > Modern Skins

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump