This is xScript converted to 508 and my developing 521 with some new language improvements, anyways you judge it..
Who do you think is better, effective and easier to use?
Watch basic xScript v1
Language definition(xscript v2 <-- the 317 version):
Code:
start/initialise:
*wait* <-- used to wake up all other scripts which are being used and queue them after this script.
var dBarTwo: (integer)playeritem/4151;<--- create new variable and take its place as the players whip(if they have one)
var dBar: (integer)5; <--- create and initialise a variable
if (var dBar) is *higher* or is *equal* to (var dBarTwo) <--- currently variables cannot have numbers in them or you get incompleteScriptException thrown..
(*you can do more things from v1 xscript this is how you comment things out, currently one line*)
an example script code of version 1.5<--- converted 508 version:
Code:
new frame:ded;
*wait*
additem:4151:1;
*wait*
end frame;
new frame:ded2;
*wait*
sendmessage:im sorry u arent dead lololol;
*wait*
end frame;
start:
playergfx:43:100;
new var hi:getfromrange:4:0;
if(900 is lesserThan (getvar:hi)) goto frame ded;
try else goto frame ded2;
end;
catch exceptions: 3:0:0:1;
notify xscript run;
end xscript(if poss);
xScript snippets of code:
Code:
protected HashMap<String, Integer> variables = new HashMap<String, Integer>();
Used inside of frames and in the main start script..
Code:
protected void newFrameCommand(String newCommand)
{
if (offset >= frameCommands.length) offset = frameCommands.length;
frameCommands[offset++] = newCommand;
}
public void fireCommands()
{
System.out.println("Firing commands for frame: "+frameName);
for (String w : frameCommand)
How the frame's commands are fired out from the main start script
Code:
if (integers[0] >= integers[1])
{
String frameName = getFrameName(533);
xFrame frame = xEngine.fullframe.get(frameName);
if (frame != null) frame.fireCommands();
}
Part of the if statements in thProxy-Connection: keep-alive
Cache-Control: max-age=0
scripts..
Code:
if (state[3].startsWith("(getvar:"))
{
String var = state[3].substring(state[3].indexOf(":") + 1, state[3].indexOf(")"));
Integer i = variables.get(var);
if (i != null) secondVariable = i;
}
Self explanatory
Code:
protected HashMap<String, xFrame> fullframe = new HashMap<String, xFrame>();
All frames here..