Page 1 of 3 123 LastLast
Results 1 to 25 of 71

Thread: Pascalinterpreterinjava (soon to be a SCAR emulator)

  1. #1
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Pascalinterpreterinjava (soon to be a SCAR emulator)

    So, I am mostly done with my latest project, a pascal interpreter in java, aptly named "pascalinterpreterinjava". If you have any better suggestions for a name, please post them.

    Basically, I wrote an interpreter in java with the goal of being able to run SCAR scripts without SCAR. At this point, the only language feature it is missing is pointers.

    In terms of the SCAR library (being able to call built-in SCAR functions), it currently supports: Input and output, String manipulation, File IO, Networking, and Script control, but is missing Forms, Keyboard/mouse control, and pixel/bitmap image finding.

    You may notice that it is missing the most important functionality. This is partly because I haven't gotten around to it yet, but also because I am planning on giving it SMART- like functionality, and have it interface directly with the game, rather than taking control of your pointer.

    So, here is the source code and class files. To run it, run run.sh or run.bat (for windows)

    At this point it won't really do much besides give you a sandbox for writing pascal scripts (much like SCAR), except it lacks the macroing capability of SCAR. However, that brings me to my next point.

    I would appreciate help with this project in three areas: First, I would be very grateful to anyone who tinkers around with it and finds bugs. Second, if anybody has experience coding GUIs in java, my GUI could use a real makeover (try resizing it to see what I mean.) Finally, if anybody knows about (or wrote) a good client loader I could use to directly send events to (and read pixels from) the applet, that would be great. Otherwise I will have to do something with the user specifying the top left corner of the applet or something like this. (also, it will allow me to make it send events silently and to multiple applets at the same time.) Once I get a client loader, I will finish writing the last of the api (although I don't know if I will ever implement forms)

    Oh, I almost forgot to post the SVN for my project: http://pascalinterpreterinjava.googlecode.com Hosts the code, and you can find instructions there for downloading the latest code I have been working on.

    Thanks a lot!

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,885
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    How about Jascal? 'Cause there is a Python interpreter in Java called Jython.

  3. #3
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmm... That might be a good one. There are some things named jascal all ready though. I was hoping for a unique name, so people would find info if they googled it.

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  4. #4
    Join Date
    Dec 2008
    Posts
    2,829
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You could see how RSBot does some of the stuff you need. It's all open source

    How about JaSCAR? JavaSCAR

  5. #5
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,790
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Pascjaval?

  6. #6
    Join Date
    Dec 2008
    Posts
    2,829
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Da 0wner View Post
    Pascjaval?
    I lol'd.

    By the way, I'll test this in about an hour

  7. #7
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think pascjaval it will be!

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  8. #8
    Join Date
    Feb 2006
    Posts
    380
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I wish you luck on this!
    I only have two years of Java experience, and can't do anything you just did, but will look at the source code anyways.

    I know it runs SCAR without SCAR, but will it allow for stand alone scripts to be used, for example in a jar file etc?

  9. #9
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    585
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Hmmm this is simply eminent, I like it I'd be glad to help if/when needed, just msg me up.



    ~NS

  10. #10
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Trevor: It's a little wierd.

    Scar is like two things bundled in one. It is an interpreter, and an API for macroing. What I wrote was the first half of that, the interpreter. However, that is pretty much useless without any api to call. In order for it to do anything, you need one of three things.

    Someone writes an interface to a bot they wrote (It will be *really* easy. Just look at some of the examples in the plugins folder.) This would probably be ideal, as it would mean the least work for me!

    or someone could implement the scar api, which I started to do. This would make it a full-fledged clone of scar, and would be able to run scar without modification. This would be the only option to run non-rs scar scripts. However, this looks unlikely because it seems some of scar's functionality would require using JNI (Basically, I would have to write the code in C for every operating system I wanted it to work on.)

    or, someone could write a bot which uses the scar api, but would allow you to minimize or run multiple bots. This seems to be what I will do, at least as one solution. In order to do this, I would have to write or use somebody else's client loader. My best bet will probably be to ask Benland100 for his, but he hasn't been on IM recently (I will PM him shortly.) Once the client is loaded, hooking up the functions to move the mouse and read the screen should be easy. (Bitmap/DTM stuff still will need to be done :P)


    So your question about running java scripts (I think that is what you were trying to say) isn't quite right, because if you write a java script, you could call the bots API directly. What I wrote is only so SCAR scripts can call a java API. (Yes, I know it's already possible, but at the time of making this, I wasn't aware). This is only if you want to run scar scripts with some other bot (for example allowing minimization and multiple scripts at once.)

    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  11. #11
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,787
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  12. #12
    Join Date
    Sep 2006
    Location
    Scripter's Heaven
    Posts
    455
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default


    And check out my pascal interpreter!
    <R0b0t1> No, really, I went to a bar and picked up a transvestite.

  13. #13
    Join Date
    Feb 2009
    Posts
    2,117
    Mentioned
    2 Post(s)
    Quoted
    25 Post(s)

    Default

    pipija

    p := pasca
    l := linter
    p := preter
    i := in
    j := java
    a:= application
    If my avatar offends you, let me know and I'll change it.

  14. #14
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    585
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You might as well call it:

    SPIIJ - SCAR Pascal Interpreter In Java





    ~NS

  15. #15
    Join Date
    Mar 2007
    Location
    WhereDoILive:='New Hampshire'
    Posts
    3,120
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Nadeem View Post
    You might as well call it:

    SPIIJ - SCAR Pascal Interpreter In Java





    ~NS
    Or just spij, that sounds awesome.

    ~Myles

  16. #16
    Join Date
    Dec 2008
    Location
    In a galaxy far, far away...
    Posts
    585
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by MylesMadness View Post
    Or just spij, that sounds awesome.

    ~Myles
    Thats what I though but then added in the extra I because SPIJ is some spanish/indonesian government site...



    ~NS

  17. #17
    Join Date
    Aug 2008
    Location
    Finland
    Posts
    2,848
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    JIPPA

    Java Interpreter Programmed for Pascal Applications
    ~~
    EVEN BETTER ONE:
    JIPPO

    Java Interpreter Programmed for Pascal Operations
    Last edited by marpis; 07-02-2009 at 12:37 PM.

  18. #18
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,803
    Mentioned
    1 Post(s)
    Quoted
    23 Post(s)

    Default

    Quote Originally Posted by marpis View Post
    JIPPA

    Java Interpreted Programmed for Pascal Applications

    Doesn't make sense, acronym sounds good.

  19. #19
    Join Date
    Apr 2007
    Posts
    3,161
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    Dont name something silly, give it a real name.
    Java Application That Interprets SCAR Scripts and Allows You to Run Them
    JATIS SAYRT. (which means "Love" in Swahili.)
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  20. #20
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,460
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    Scava since it aims to be Scar in Java - maybe Scarva.
    Otherwise, I like the sounds of SPARTA
    Scar / Pascal Always Releases Trusted Apps
    (Couldn't think of how to fit a J in it for Java though)

    Maybe JASPER
    Java Allows Scar / Pascal to Epicly Run

    Possibly:
    Greedily Run Other Pascal Environments, Java Introduces Muscle!
    (Muscle referring to the power it brings).

    My favourite one is "JAP"
    Java Autoing in Pascal
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  21. #21
    Join Date
    Sep 2006
    Location
    New Jersey, USA
    Posts
    5,368
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Dude, can't you use SMART? I know you'd probably have to use JNI to call the functions, but it should work quite nicely (plus you get reflection!). If that's not possible, I could dig up an older version of SMART from the pre-embedded days, but you'd need Ben's permission for that, because he never publicly released that version. Also note that it would be missing some features taken for granted in the newer releases.

    Of course, if all you're looking for is a simple loader, check out this thread by Tv-XxX. You'll want to read most of the thread, especially Yakman's posts. Note that my version of the loader is 'technically' safer, but neither should have any detectability problems.
    Interested in C# and Electrical Engineering? This might interest you.

  22. #22
    Join Date
    Apr 2007
    Posts
    3,161
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    I personally like "Greedily Run Other Pascal Environments, Java Introduces Muscle!" It's short and to the point.

    Java Owning SCAR That Lasts for Eternity (JOSTLE)
    SCAR In Disguise Gets On Track; Awesome; By Java (SIDGOTA BJ)
    Java, A Capable, Kind Interpreter (JACKI)

    honestly lardguy, just think of a word that would sounds good and fit your meaning into it if you know what i mean
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  23. #23
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,787
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    i cant get it to work in linux
    Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: edu/js/interpreter/gui/ide
    Caused by: java.lang.ClassNotFoundException: edu.js.interpreter.gui.ide
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    Could not find the main class: edu.js.interpreter.gui.ide.  Program will exit.


    ~shut

  24. #24
    Join Date
    May 2008
    Location
    California
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Did you hardcode the entire gui? If so, you should probably consider using a/some LayoutManager(s), so that your gui will cope better with resizing.

    For minimization, and such, create a new instance of the client class as an applet. Set its stub to one of your classes, and call it's init and start methods in that order. You can proceed to add it to a JFrame.

    For sending mouse events, get the client's graphics component by either using a getCanvas() hook, or something like
    Code:
    applet.getComponent(0)
    and dispatching events to it using the dispatchEvent(AWTEvent e) method.

    If you need some help, pm me/post here.

  25. #25
    Join Date
    Feb 2006
    Location
    Finland
    Posts
    2,999
    Mentioned
    1 Post(s)
    Quoted
    1 Post(s)

    Default

    PWJ Pascal With Java ?

    ~Home

Page 1 of 3 123 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •