Scripting Help Wanted Please

AO is the main topic, but you can also talk about things like the latest console game you've played, web comics, movies, music, etc. as they pertain to your AO experience.

Moderators: AOU Team, Forum Moderators, Site Managers

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Scripting Help Wanted Please

Post by Snakebite » Tue Jun 27, 2006 4:44 pm

I've got hold of a Script & started editing it, problem is, I seem to have broken it lol

It's supposed to post a link which opens an info window, but it is trying to dump the whole thing straight into chat... (been testing in Vicinity in a BY lol)

Code: Select all

<a href="text://<center><img src=rdb://96116><font color=#e0e000>Top End Tradeskiller for 

HIRE<img src=rdb://96116><br><br>

<font color=#7F8EAB>ME = 1793<br>
EE = 1670<br>
QFT = 1665<br>
WS = 1756<br>
Pharma = 1407<br>
NP = 1539<br>
CompLit = 1530<br>
Psych = 1124<br>
Chem = 1414<br>
B&E = 1014<br><br>

<font color=#58D27D>Most combines done on the spot.<br>
QL300 AI Armour finished at my Org HQ.<br><br>

QL1-90 AI Armor 5Mill/completed part.<br>
QL91-280 AI Armor 7Mill/completed part.<br>
QL281-300 AI Armor 10Mill/completed part.<br>
(completed part = combined or otherwise)<br><br>

1 & 2 Gem Bracers 2Mill each or 3Mill a Pair.<br>
3 & 4 Gem Bracers 4Mill each or 6Mill a Pair.<br>
I will supply completed Bracelet Circutrys for 2Mill each. (while stocks last)<br><br>

VTE's 3Mill each.<br><br><br>


Any tips for combines other than the above are gratefuly recieved.<br><br>* 

<a href='chatcmd:///tell ######'>Contact ######</a><br><br>

<font color=CCRed>HIRE<br>
To engage the services of (a person) for a fee; employ.<br>
To engage the temporary use of for a fee; rent.<br>
To grant the services of or the 
temporary use of for a fee.">Tradeskiller</a> for <font color=CCRed>hire.
I posted this on the FC Forums too (but lightly only to get links to sites that show you how to do this stuff), I have no skills in writing, but can usualy edit (apparently not this time).

So... What did I do wrong?
The parts '????' will be edited later, & the bit at the bottom is going to be removed once I find out where it stops & the code starts.

Thanks for any help guys :D
Last edited by Snakebite on Wed Jun 28, 2006 4:17 am, edited 1 time in total.
Image
Don't make me come in there and Moderate you!

User avatar
Stillian
Posts: 228
Joined: Mon Jan 09, 2006 11:46 pm
Location: Glasgow, Scotland
Contact:

Post by Stillian » Tue Jun 27, 2006 4:52 pm

Code: Select all

<a href="text://<center><img src=rdb://96116><font color=#e0e000>Top End Tradeskiller for 

HIRE<img src=rdb://96116><br><br> 
</font>?

Also, keep it on one line, with <br> and <p> as seperators, etc etc. I think, that is your problem.

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Tue Jun 27, 2006 5:05 pm

I thought that html would ignore standard 'returns'?

also, what does <p> do? lol
Image
Don't make me come in there and Moderate you!

User avatar
Khuri
AOU Programmer/Coder
Posts: 1759
Joined: Thu Sep 29, 2005 7:57 pm
Location: Germany
Contact:

Post by Khuri » Tue Jun 27, 2006 5:49 pm

Correct, no linebreaks, it does crap up the script. HTML ignores them, but the chat client treats them as new chatline.
Beside, the script should be too big, there's a maximum for 1024 chars per line. In other words, your script (if it runs in one line, as it does not right now) probably will crash your client (at least thats been what happened when i tried out all last times), as it is 1248 chars.
You could split your window up in two chatlines of course, but then people would need to click two thingies :P - and no script larger then 4096 chars at all too. Crashes as well.

Code: Select all

<br> is a linebreak.
<p> is for text passages in HTML, not sure it is supported by AO, even if it would be though, it's kind of useless there :P If you do some text in <p> tags, you automatically get some linebreaks around it.
About the <font> tags you do not close, well it DOES work without closing them. But this is sucky coding ;)
Closing tags in HTML is done the same was as opening them, by doing <font> and </font> (just add the / )

I'll send you a PM with something that might help you.

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Tue Jun 27, 2006 6:55 pm

Hmmm, I see... Yes, it did crash my client once I got the 'returns' out of it, problem now is that I can't log in at all lol Something about 'eronous data'...
Image
Don't make me come in there and Moderate you!

Ukblizzard
AOU Community Legend
Posts: 2709
Joined: Wed Sep 28, 2005 10:05 pm
Location: Germany

Post by Ukblizzard » Tue Jun 27, 2006 7:03 pm

To fix your problem you need to uninstall AO, run around your garden 5 times backwards wearing your girlfriend/wife/bestfriend/mum 's dress and high heels, eat a bowl of ice cream whilst standing on your head, reinstall AO.. and by which point the server will be back up again!


(( Snake, there are LOTS of posts in the AO forum about the server issues and that they are being looked into :P ))

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Wed Jun 28, 2006 1:34 am

Yeah, found that out, but I've never had the eronous data message before...

(you'd think they'd spell it correctly too lol)
Image
Don't make me come in there and Moderate you!

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Wed Jun 28, 2006 4:22 am

Ok... Got it sorted! 8)

It was simply a case that I'd used 'return' & had it too big! lol

Here it is (edited slightly for privacy)

Code: Select all

<a href="text://<center><img src=rdb://96116><font color=#e0e000>Top End Tradeskiller for HIRE</font color><img src=rdb://96116><br><br><font color=#7F8EAB>ME = 1857<br>EE = 1859<br>QFT = 1857<br>WS = 1797<br>Pharma = 1911<br>NP = 2120<br>CompLit = 1776<br>Psych = 1685<br>Chem = 2068<br>B&E = 1162<br>(Unbuffed)</font color><br><br><font color=#58D27D>Most combines done on the spot.<br>QL300 AI Armour finished at my Org HQ.<br><br>Any tips for combines other than AI Armor, VTEs or Arul Sabas are gratefuly received.<br>Contact me for prices for the above.</font color><br><br><a href='chatcmd:///tell ######'>Contact ######</a>">Top End Tradeskiller</a><br><font color=CCRed>For Hire.</font>
Now, I need to know how to add different fonts, make things Bold, Underlined & alter Font Size.

Also, I'd like to put in a link like the 'contact me' link that will open a new info window with my prices in... (actualy open the window, not post another link)

Any ideas you coding wizzzzzzzards??? :lol:


P.S. Thanks for the help.
Image
Don't make me come in there and Moderate you!

Ukblizzard
AOU Community Legend
Posts: 2709
Joined: Wed Sep 28, 2005 10:05 pm
Location: Germany

Post by Ukblizzard » Wed Jun 28, 2006 8:24 am


User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Wed Jun 28, 2006 1:32 pm

Amazingly, that doesn't make much sense to me lol. :?
I just get lost in a sea of info. :lol:
Image
Don't make me come in there and Moderate you!

User avatar
Khuri
AOU Programmer/Coder
Posts: 1759
Joined: Thu Sep 29, 2005 7:57 pm
Location: Germany
Contact:

Post by Khuri » Wed Jun 28, 2006 3:52 pm

Well, Font-Size and Font-Type are locked by the Players GUI-settings. Those can not be changed.
Bold text is also unavailable.

What you can do is underline, and changing the text color. Underline is

Code: Select all

<u>this is underlined</u>
colors you probably noticed already ;)
And you can align the text to the sides, or center it, using the <div> tag. Like

Code: Select all

<div align='center'>
... i should go and get my tutorial done :P

About your questions to create a link inside a reference window, this is possible. But not to link to another self-created reference of yours, unless you dump them as a link in the chatwindow again as well, afaik.
You can create reference-windows with way more content, but then the acutal text/code that gets put into that window needs to be stored on your game folder, as you can include textfiles for example.
But this won't work unless the other person does have this file with the content as well.

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Thu Jun 29, 2006 12:03 am

Just

Code: Select all

<center> </center>
works too...

Damn, I'm annoyed about the text size being locked, I'd have thought you could alter text size in the info windows... :cry: There goes my nice header lol.

Also damn,
<u> </u>
is just BBcode with <> lol



So how do I put a link inside the info window (like my 'contact me' one) that will open a window for my prices?
Image
Don't make me come in there and Moderate you!

User avatar
Khuri
AOU Programmer/Coder
Posts: 1759
Joined: Thu Sep 29, 2005 7:57 pm
Location: Germany
Contact:

Post by Khuri » Thu Jun 29, 2006 4:55 pm

The same way you do your first window? Damn, try around a bit :P
The only thing you need to watch out for then is, that you do not use " for the <a href=" inside the opened <a>-tag, but use ' instead. Because if you got the first <a>-tag opened with ", and then open another one with " as well, the system will think you close the first one again.

So just like this:

Code: Select all

<a href="text://blabla<a href='text://more bla'>more bla link</a> dont click the other link">Click me</a>
And yeah, BB-Code is a "simple form" for HTML-tags.

User avatar
Snakebite
AOU Forum Moderator
Posts: 3292
Joined: Mon Sep 26, 2005 8:32 am
Location: North-East England

Post by Snakebite » Thu Jun 29, 2006 5:51 pm

Won't this be considered more text in the script? or will it see it as another line of which I have 1024 characters worth? So I only need to worry about exceding the 4096 total?
Image
Don't make me come in there and Moderate you!

User avatar
Khuri
AOU Programmer/Coder
Posts: 1759
Joined: Thu Sep 29, 2005 7:57 pm
Location: Germany
Contact:

Post by Khuri » Thu Jun 29, 2006 5:55 pm

Of course, this counts as one line, not multiple lines... so it is 1024 chars in total.
You could do

Code: Select all

<a href="text://blabla you clicked">Click meh!
<a href="text://more bla">more bla link</a>
On two lines. But this is two chatlines in the game then of course too.

Post Reply