FormLib
I've put another library up on the hub. Really, though, right now it's more of an example of using the fairly new ability to call JavaScript functions in order to update a browser window without refreshing the page. It has a lot more potential, but I'm not sure whether or not anyone will use it if I bother 'finishing' it.
Anyways, the library's called FormLib, and it lets you define an interface at run-time. It is extensible - you could write a back-end for displaying an interface using skins and then switch to browser windows later with relative ease.
There's no documentation and no demo (yet), so here's an example:
#define HTML
#define img1 "http://www.byond.com/rsc/atom28_members.png"
#define img2 "http://www.byond.com/rsc/atom28_red_spin.gif"
var
htm_Form/window=new("frmMain")
htm_Table/table=new(3,3, "tblContent", window)
htm_LinkButton/SpinAtom/button=new("lnkButton", table, "Click here.")
htm_Image/atom = new("imgAtom", table)
client/verb/test()
window.layout=table
atom.SetSource(img1)
table.SetCell(1, 1, atom)
table.SetCell(1, 2, button)
window.Show(src)
htm_LinkButton/SpinAtom
Click()
atom.SetSource(img2)
|
Then, you just need to create a window in the skin with a browser control named "frmMain".
Let me emphasize, though, that this isn't finished and isn't really meant to be used in a major product. It could change radically in later versions (if there are any).
Posted by Nickr5 on Saturday, October 31, 2009 04:17PM
- 0 comments
(link)
/
Members say:
yea +0,
nay -0
Keywords:
library,
formlib,
programming
n_Scripting
I've decided to release my scripting library. It comes with a /doc folder which contains the documentation and some examples (although the demo file has the most comprehensive example so far). I'm still looking for feedback and willing to answer questions, though, so if you have either of those, please comment! The documentation may be lacking in some parts, so feel free to give your ideas on that as well.
While one implementation of a scripting language is included ('n_Script'), the library should be extensible enough so that you can write your own language on top of it. For an example of nS's syntax, see my earlier post.
Here are some of the library's features:
- Functions and variables - can be defined in any type of block.
- Expression parsing - A bit of a challenge to implement, but expressions should be more or less flaweless and support function calls inside of function calls and other complicated syntax.
- If/else statements - No else if support yet, however.
- Loops
-
- Break & continue statements
And some things I'd like to implement in the future:
- Complex datatypes - such as arrays or lists (currently the library is limited to numbers and strings only)
- Else if statements
- Constants - if they become necessary, but variables should suffice for now
- Labels and goto statements
- User-defined objects - not likely to happen any time soon, but maybe...
- Debugging features
Posted by Nickr5 on Thursday, October 22, 2009 05:54PM
- 2 comments
(link)
/
Members say:
yea +2,
nay -0
Keywords:
library,
n_scripting
(Edited on Friday, October 23, 2009 03:00PM)
Finishing Up
The scripting library that was the subject of my
last post is usable and almost ready for release. Right now, I'm mainly looking for suggestions and making some small fixes here and there, trying to avoid needing to break backwards compatibility after release. I'm also working on the
documentation (unzip, open index.html), for which I could use some of your ideas as well.
Posted by Nickr5 on Saturday, October 17, 2009 10:37AM
- 0 comments
(link)
/
Members say:
yea +0,
nay -0
Keywords:
n_scripting
(Edited on Sunday, October 18, 2009 11:14AM)
Scripting Languages for BYOND
Lately I've been working on writing a library for using scripting languages from within BYOND games, which could be useful for both configuration and games like Exadv1's
Console (or at least I'm guessing it could be, as I've never really played the game myself due to a major lack of documentation on excode). I'm hoping to make this very extensible while still remaining simple to use.
It's not quite finished yet, but I've created a demo
here so that anyone can help test for bugs. Right now, the demo's only built in function is print.
Here's an example of the language, which can also be found on the demo's hub page:
a=10;
if(a>0) {
i=0;
while(i<a) {
i+=1;
print(OddOrEven(i));
}
}
def OddOrEven(x) {
if(x%2) {
return "Odd";
} else {
return "Even";
}
}
|
Also note that the language is unique (or quirky?) in that functions, like variables, can be defined anywhere and are local to the block they're in, so for example you could have a function inside of an if statement.
Update:
-Else fixed for Tiberath ;)
-Also, I forgot to mention that unlike in DM, the ^ operator is used for exponents and the grave accent (`) is the binary xor operator.
Posted by Nickr5 on Monday, October 12, 2009 06:06PM
- 12 comments
(link)
/
Members say:
yea +3,
nay -0
Keywords:
library,
programming,
scripting,
n_scripting
(Edited on Tuesday, October 13, 2009 11:43AM)
Wall of Text, Part II
[¯¯¯¯][¯¯¯¯][¯¯¯¯]
¯¯][¯¯WALL¯¯][¯¯
[¯¯¯¯][¯OF¯][¯¯¯¯]
¯¯][¯¯TEXT¯¯¯][¯¯
A wall of text is something that is frowned upon in most, actually virtually all Internet societies, including forums, chat boards, and Uncyclopedia. You should not make walls of text because it can get you banned anywhere unless it is a place that encourages walls of text. I highly doubt any place does support something so irritating and annoying, but anything can exist, but not really because unless you are in heaven then that can happen. But no one actually knows that was just a hypothesis, a lame one that is. Actually not really lame. You can create a wall of text supporting site, but you would be hated if you do that, so do not. But you can if you like, but I discourage that. Now on to the actual information of walls of texts. The wall of text was invented when the Internet was invented, but actually it was slow at that time. So whenever it became fast. But there would need to be some free or not free community for people, and that community would be able to have walls of text. But that community probably wouldn't have actually invented the wall of text. So basically, no one except God knows when or where or how the wall of text existed/was invented. Noobs probably invented, but probably not. Who knows. Walls of texts are usually filled with a lot of useless information and junk. Information and junk can be the same, but only if the information is junk or the junk is information. But who cares. The information/junk inside a wall of text are usually related to whatever the wall of text is located, but the best walls of text, which are actually the most irritating, most eye-bleeding ones, are completely random. Walls of text usually make the reader asplode or have their eyes bleed and fall out of their sockets. A number of people can stand it, but not read them. Actually some people can stand and read them. Those people do not have short attention spans. These are boring and patient people who have no life or have all the time in their hands, which are the same, but not really. The punishment of what making walls of text varies of the strictness of the community. But it doesn't really matter. Nobody cares. Walls of texts should be free of links, different font colors, strange characters, which are those other symbols used in society, and capital letters because it ruins the whole purpose of the infamy of walls of texts. It makes them look dumb and weird and dumb. Walls of texts are obviously free of huge spaces and outstanding things like capital letters. Of course, paragraphs should never be in a wall of text. Walls of text are known to create nausea, confusion, head explosion, and others...
(Read the rest of the article here.)
Posted by Nickr5 on Sunday, August 30, 2009 10:32AM
- 2 comments
(link)
/
Members say:
yea +2,
nay -0
Keywords:
humor,
stupid
(Edited on Sunday, August 30, 2009 12:58PM)