Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Announcements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-16-2013, 01:59 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Smile GS3 conversion tool (Updatedx2)

We have worked on a tool for converting GraalScript2 to the new Graalscript3 syntax:

http://graalscript3.graalonline.com/

You can use it to test a little bit and see how the new scripting will look like. We plan to release GS3 officially in a few weeks, after improving compatibility and features.

Edit: Updated on June 21 to add better support for global functions and types! You have to restart the npcserver.
Edit: Updated on June 24 to fix object attributes like player.account (TServerPlayer.account), no additional restart required.

Last edited by Admins; 06-24-2013 at 09:40 AM..
Reply With Quote
  #2  
Old 06-16-2013, 02:19 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.speed 1;
}

function 
onTimeout() {
  
player.+= (keydown(3)-keydown(1))*this.speed;
  
player.+= (keydown(2)-keydown(0))*this.speed;
  
setTimer(0.05*this.on);
}

function 
onKeyPressed(codekey) {
  
this.on abs(this.on-(key=="b"));
  
setTimer(0.05*this.on);
}
function 
onPlayerChats() {
  if (
player.chat.starts("/speed ") && this.on) {
    
this.speed int(player.chat.substring(7));
  }

Tested this staff boots script, just to see how it works, and it gave this error in the onPlayerChats() event, right under the if statement:
NPC Code:
Unexpected symbol 'if'



But apart from that, looking good!
__________________
Reply With Quote
  #3  
Old 06-16-2013, 03:01 PM
BlueMelon BlueMelon is offline
asdfg
BlueMelon's Avatar
Join Date: Sep 2008
Posts: 1,481
BlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to beholdBlueMelon is a splendid one to behold
Fails to convert a 50 line script when I tried..
(No error just stays at "Converting..." forevor)
__________________
http://i.imgur.com/OOJbW.jpg
Reply With Quote
  #4  
Old 06-16-2013, 03:29 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by BlueMelon View Post
Fails to convert a 50 line script when I tried..
(No error just stays at "Converting..." forevor)
I think posting the script could help with debugging it and to find a solution
__________________
Reply With Quote
  #5  
Old 06-16-2013, 04:34 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Sweet. Looking forward to an official release.
Reply With Quote
  #6  
Old 06-17-2013, 01:50 PM
Julien Julien is offline
Registered User
Join Date: Jun 2013
Posts: 8
Julien is on a distinguished road
Quote:
Originally Posted by Chompy View Post
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.speed 1;
}

function 
onTimeout() {
  
player.+= (keydown(3)-keydown(1))*this.speed;
  
player.+= (keydown(2)-keydown(0))*this.speed;
  
setTimer(0.05*this.on);
}

function 
onKeyPressed(codekey) {
  
this.on abs(this.on-(key=="b"));
  
setTimer(0.05*this.on);
}
function 
onPlayerChats() {
  if (
player.chat.starts("/speed ") && this.on) {
    
this.speed int(player.chat.substring(7));
  }

Tested this staff boots script, just to see how it works, and it gave this error in the onPlayerChats() event, right under the if statement:
NPC Code:
Unexpected symbol 'if'



But apart from that, looking good!
There was a problem with the '&' and '&&' operators.
It's fixed now.
Your script is reporting more meaningful errors.

Please note that built-in global functions are only partially supported:
"keydown" and "setTimer" are still being reported as not existing functions.
Reply With Quote
  #7  
Old 06-17-2013, 02:33 PM
Draenin Draenin is offline
Magnificent Bastard
Draenin's Avatar
Join Date: Dec 2004
Location: Bermuda Triangle
Posts: 6,790
Draenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud ofDraenin has much to be proud of
Send a message via AIM to Draenin Send a message via MSN to Draenin Send a message via Yahoo to Draenin
It'd be nice if this were integrated into RC, and not a web page that people have to find via the forums. (Most likely months later.)
Reply With Quote
  #8  
Old 06-17-2013, 03:57 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Draenin View Post
It'd be nice if this were integrated into RC, and not a web page that people have to find via the forums. (Most likely months later.)
They probably wont even know it's enabled until they see the thread tho.. lol
Reply With Quote
  #9  
Old 06-17-2013, 05:15 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Julien View Post
There was a problem with the '&' and '&&' operators.
It's fixed now.
Your script is reporting more meaningful errors.

Please note that built-in global functions are only partially supported:
"keydown" and "setTimer" are still being reported as not existing functions.
look guys its either an intern or paid eurocenter employee!
__________________
Quote:
Reply With Quote
  #10  
Old 06-17-2013, 06:27 PM
Dragon551 Dragon551 is offline
Alfonso :3
Dragon551's Avatar
Join Date: Mar 2006
Location: In a pocket.
Posts: 712
Dragon551 is a splendid one to beholdDragon551 is a splendid one to beholdDragon551 is a splendid one to beholdDragon551 is a splendid one to beholdDragon551 is a splendid one to behold
Send a message via AIM to Dragon551 Send a message via MSN to Dragon551
Quote:
Originally Posted by fowlplay4 View Post
look guys its either an intern or paid eurocenter employee!
He's watching us..
__________________
-Alfonso (AGT)


---------------------
---------------------
#AGT
Reply With Quote
  #11  
Old 06-17-2013, 08:28 PM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
Quote:
Originally Posted by fowlplay4 View Post
look guys its either an intern or paid eurocenter employee!
dont be silly, its ravej's troll account where he actually uses spell check
Reply With Quote
  #12  
Old 06-17-2013, 08:39 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Quote:
Originally Posted by Julien View Post
There was a problem with the '&' and '&&' operators.
It's fixed now.
Your script is reporting more meaningful errors.

Please note that built-in global functions are only partially supported:
"keydown" and "setTimer" are still being reported as not existing functions.
OMG HAII!!! Enjoy your stay
__________________
MEEP!
Reply With Quote
  #13  
Old 06-19-2013, 08:43 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Failed completely :/
PHP Code:
public function NewRC(acc){
  
//Let NC messages send first..
  
sleep(5);
  
temp.comment this.GetComments(acc);
  if(
md5(comment) != this.(@acc)){
    
acc.sendtorc("Your comments have changed since you last logged on.");
  }
  
this.(@acc) = md5(comment);
}
function 
GetComments(ac){
  
temp.st temp.ac.substring(02);
  
temp.path format("accounts/%s/%s.txt"stac);
  
temp.file.loadstring(temp.path);
  
temp.file temp.file.tokenize("\r\n");
  
temp.comments;
  for(
temp.line temp.file){
    if(
line.starts("COMMENTS")){
      return 
line.substring(9);
    }
  }
  return 
"none";

__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
  #14  
Old 06-19-2013, 09:15 AM
Julien Julien is offline
Registered User
Join Date: Jun 2013
Posts: 8
Julien is on a distinguished road
Quote:
Originally Posted by Gunderak View Post
Failed completely :/
PHP Code:
public function NewRC(acc){
  
//Let NC messages send first..
  
sleep(5);
  
temp.comment this.GetComments(acc);
  if(
md5(comment) != this.(@acc)){
    
acc.sendtorc("Your comments have changed since you last logged on.");
  }
  
this.(@acc) = md5(comment);
}
function 
GetComments(ac){
  
temp.st temp.ac.substring(02);
  
temp.path format("accounts/%s/%s.txt"stac);
  
temp.file.loadstring(temp.path);
  
temp.file temp.file.tokenize("\r\n");
  
temp.comments;
  for(
temp.line temp.file){
    if(
line.starts("COMMENTS")){
      return 
line.substring(9);
    }
  }
  return 
"none";

Hello,

After trying the above code on http://graalscript3.graalonline.com/, it reports successful conversion.
The conversion is not really perfect though. For example, the converter tool cannot guess the type of the "acc" parameter in the "NewRC" function.

When checking syntax, several errors are reported.
Some errors are valid, others are not (for example "md5" function is not supported yet).

Could you please detail what is going wrong on your side?
Do you have any error reported? Is the conversion running forever maybe?
Reply With Quote
  #15  
Old 06-19-2013, 09:38 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
No, it converts it with errors.
The main problem is the md5, the rest I could convert myself, and did.
How would I reference md5?
It would be cool if we could do something like global::md5() or using namespace global;
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion
Reply With Quote
Reply


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


All times are GMT +2. The time now is 05:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.