PDA

View Full Version : Pascalinterpreterinjava (soon to be a SCAR emulator)



lardmaster
06-29-2009, 11:19 AM
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. (http://www.mediafire.com/file/kghhzbjzmwm/pascalinterpreterinjava.zip) 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!

senrath
06-29-2009, 11:22 AM
How about Jascal? 'Cause there is a Python interpreter in Java called Jython.

lardmaster
06-29-2009, 11:34 AM
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.

ian.
06-29-2009, 11:34 AM
You could see how RSBot does some of the stuff you need. It's all open source ;)

How about JaSCAR? JavaSCAR

Da 0wner
06-29-2009, 11:41 AM
Pascjaval?

ian.
06-29-2009, 11:43 AM
Pascjaval?

I lol'd.

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

lardmaster
06-29-2009, 11:45 AM
I think pascjaval it will be!

Nadeem
06-30-2009, 08:08 AM
Hmmm this is simply eminent, I like it :) I'd be glad to help if/when needed, just msg me up.



~NS

lardmaster
06-30-2009, 03:01 PM
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.)

Shuttleu
06-30-2009, 03:52 PM
PIJ?
Pascal Interpreter in Java

~shut

lardmaster
06-30-2009, 03:53 PM
http://www.google.com/search?q=pij

JIHAAAAAD!

JPHamlett
07-01-2009, 04:49 AM
pipija

p := pasca
l := linter
p := preter
i := in
j := java
a:= application

Nadeem
07-01-2009, 06:58 AM
You might as well call it:

SPIIJ - SCAR Pascal Interpreter In Java

:p



~NS

MylesMadness
07-01-2009, 07:12 AM
You might as well call it:

SPIIJ - SCAR Pascal Interpreter In Java

:p



~NSOr just spij, that sounds awesome.

~Myles

Nadeem
07-01-2009, 07:16 AM
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

marpis
07-02-2009, 12:49 AM
JIPPA

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

Java Interpreter Programmed for Pascal Operations

n3ss3s
07-02-2009, 01:57 AM
JIPPA

Java Interpreted Programmed for Pascal Applications


Doesn't make sense, acronym sounds good.

Dan Cardin
07-02-2009, 04:09 AM
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.)

mixster
07-02-2009, 06:21 PM
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

Smartzkid
07-02-2009, 09:08 PM
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 (http://www.villavu.com/forum/showthread.php?t=42396) 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.

Dan Cardin
07-03-2009, 12:08 AM
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 ;)

Shuttleu
07-03-2009, 12:36 AM
i cant get it to work in linux

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.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
Could not find the main class: edu.js.interpreter.gui.ide. Program will exit.
:(

~shut

Jimmy5410
07-03-2009, 05:50 AM
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

applet.getComponent(0)
and dispatching events to it using the dispatchEvent(AWTEvent e) method.

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

Home
07-03-2009, 04:36 PM
PWJ Pascal With Java ? :)

~Home

kyleisntwild
07-08-2009, 06:42 AM
Call it: Sex

Da 0wner
07-08-2009, 09:21 AM
PWJ Pascal With Java ? :)

~Home

I think it'd be Java with Pascal :p.

I see how you could be thinking also (code Pascal in Java)?

senrath
07-08-2009, 09:27 AM
I vote for Greedily Run Other Pascal Environments, Java Introduces Muscle, if only because of the acronym.

Blender
07-09-2009, 09:24 AM
Lol, I would DEFINITELY install GROPE!

lardmaster
07-09-2009, 02:42 PM
Hey,

About the client loader: I dug up an old loader I wrote and fixed it up. It is included in the latest svn.

About sending events to it: I had an idea of how to send events to it, but there are other things I also need in order to make it work. I need to intercept the events it would normally get. I started to code some of the key and mouse functions, but getting the bitmap from the screen seemed to be a problem. You can't actually get the buffer of a Canvas object. At first I thought they would be using repaint() and update(), and I figured out a way to intercept their events, but it turns out they don't. They instead use getGraphics() and then paint directly to the graphics. I don't know of any way of intercepting this. I tried turning on double buffering in the AWT peer, and grabbing the back buffer. This works, but not when minimized, so it is no better than normal screen grabbing. I think it might be possible that it stops drawing due to java code, which means it would be possible to make it keep drawing when minimized. However, I think it is native code that determines when it is minimized and stops updating the buffers, and I don't want to mess with that. Also, grabbing the back buffer isn't so great, because you have to wait a bit before you switch the buffers and try to grab it, because otherwise sometimes you will switch buffers before the client even paints the whole scene. If I could intercept the getGraphics call, that would be great, but I have semi given up for now.

On the other hand, in terms of getting straight scar emulation, things are progressing. I got the keyboard and mouse working. However, some things, like window targeting, require native code. I currently am building a library with Xlib (X Windows) code using JNI. My eventual plan is to create a windows and mac version, so it will be cross platform.

There are some things that I am not implementing, like SendKeysVB, because they would be projects of their own.

Some things are not possible with java, but are too trivial to do JNI stuff for now, like IsKeyDown.
Other things, like SendKeysSilent, I am leaving out because they are obsolete.

The way I see things, the next thing to do is Color functions, then Bitmaps, then OCR.

If somebody would help write the JNI stuff for windows and mac, that would be great.

About my gui: Not using a window manager is really my problem. I just use BoxLayout, because I can't figure out any of the other ones.

therealbonfield
07-09-2009, 06:18 PM
how far along is this project? also who will rhis be released to?

lardmaster
07-10-2009, 01:10 AM
This will be released to everyone. Right now the mouse and keyboard input as well as window targeting is mostly done. Networking, File access, strings and math are all complete. I am starting on color finding and bitmaps. After that I will do OCR and it should be pretty complete. Right now, the SVN won't build, because it requires some native stuff that I haven't uploaded yet.

n3ss3s
07-10-2009, 04:20 PM
How about Scavenger? Real word, sounds good, sounds something like 'scava' etc...

Freddy1990
07-10-2009, 07:41 PM
What is up with everyone always trying to clone SCAR instead of trying to be original? -_-"

Wizzup?
07-10-2009, 07:56 PM
Open Source clones are highly original. It allows everyone to work on and learn from it, rather than one person.

mixster
07-10-2009, 09:09 PM
What is up with everyone always trying to clone SCAR instead of trying to be original? -_-"

What better way to have a successful bot than to have access to a well built and maintained library of code, many skilled scripters who are competent at the language and a mountain of scripts?

Yakman
07-11-2009, 10:04 PM
if scar was open source, people would work on it instead of trying to clone it.

Freddy1990
07-12-2009, 02:22 AM
if scar was open source, people would work on it instead of trying to clone it.

Yet when I try open-source, no one seems interested enough to do anything but leech.

R0b0t1
07-12-2009, 03:16 AM
Depends, are your ideas creative? Is there room for improvement?

Leeching is part of the process. It is a waste of time to reinvent something, thus placing your code out there means you accept other people will use it and learn from it, most likely without contributing to your project, especially if it's goal is accomplished. When you release the source code to your stuff, most of it is finished. I thought it was obvious why no one had anything to add...

bullzeye95
07-12-2009, 03:38 AM
Yet when I try open-source, no one seems interested enough to do anything but leech.

IIRC when you tried open-source, you basically gave the idea and said "go for it" with no formal guidelines, structure, or organization (EDIT: did you try to make an open-source project more than once?). I think people would be very interested in an open-source SCAR. It would be a great opportunity to learn and contribute. If you did decide to make it an open-source project, you couldn't just accept anyone though; giving anyone free-reign of an application obviously is not smart. But it being open-source would still provide a huge wealth of knowledge for non-contributors.

Janilabo
07-12-2009, 03:50 AM
I see some good points here, for and against Open-Source..

So, why not 2 versions? Closed and Open. See how far the Open-Source would go?
I don't really see anyone losing on that.. I actually see everyone just winning on that. :p

We all clearly have seen what the power of the Open-Source can really become... (With that I mean, there's just loads and loads of amazing Open-Source applications around!)

But these are just my 2 cents. :D ..and to be honest, as long as SCAR has a good future, I am a happy man. Whether or not it will go Open-Source'd...

Ontopic:

Really nice project, Lard! Keep up the good work! It's gonna be great.

Wizzup?
07-12-2009, 03:55 AM
I see some good points here, for and against Open-Source..

So, why not 2 versions? Closed and Open. See how far the Open-Source would go?
I don't really see anyone losing on that.. I actually see everyone just winning on that. :p

We all clearly have seen what the power of the Open-Source can really become... (With that I mean, there's just loads and loads of amazing Open-Source applications around!)

But these are just my 2 cents. :D ..and to be honest, as long as SCAR has a good future, I am a happy man. Whether or not it will go Open-Source'd...

It wouldn't make sense if Freddy would Open Source SCAR, and at the same time continue his own version as closed source. Furthermore, SCAR 4.0 can not be Open Sourced, as Freddy will use lots of bought products, that may not be shared, AFAIK. (At least not in Source...)
And I don't see much parts of SCAR being Open Sourced at all, either.

So someone else will have to make his own version of SCAR, and then open source it, that's how it will happen, in my eyes. Most of SCAR is pretty easy to recreate anyway.

It may be an idea to go on topic again...?

Cazax
07-12-2009, 04:04 AM
Yet when I try open-source, no one seems interested enough to do anything but leech.
I admit that I was part of your open source project, and I did not help(And nobody did, except Method with his debugger). Why: Like bullzeye said, there was no organization and I couldn't help in any way. I just saw a bunch of files, no comments or anything, and you could have told what to do or at least what we can do. The good thing is that your code motivated me to learn Delphi :)

On topic: Good luck lardmaster! What will be the name?

Wanted
07-12-2009, 04:06 AM
PAL

Pascal
Adjustable
Linguistics

I think PAL sounds cool.

or

jPAL.... JPAL...J-PAL.

Java Pascal Adjustable Linguistics. The main idea is to have the 'PAL' you can change the words or whatever lol.

R0b0t1
07-12-2009, 04:18 AM
When Freddy tried open source, like I said before, it was pretty much releasing the source to things that were finished. Done. Nothing left to add.

SCAR, on the other hand, has many opportunities for improvement. You keep trying to pair up things that don't go together.


EDIT: It depends what license he bought them under, although all those people who donated to Freddy are dipshits.

Baked0420
07-12-2009, 04:23 AM
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.)

lmao I think this should be the name

Janilabo
07-12-2009, 05:11 AM
EDIT: It depends what license he bought them under, although all those people who donated to Freddy are dipshits.Watch your words, mate.

kingarabian
07-12-2009, 11:11 AM
Well maybe its not because its open source or closed source. Maybe its because Pascal/Delphi do not have much to give like Java? After all Jagex made runescape in Java...

What would be cool is if SCAR can interpret Java code :D.

mastaraymond
07-13-2009, 02:23 AM
Kay;

What is up with everyone always trying to clone SCAR instead of trying to be original? -_-"


..and then I started really to get involved into macro development, though I already had some background, this time I rly hit it off, and well, I managed to create SCARBrowser and SCSS along the way and then I started working on the thing that I never released and not too many people cept for the devs know about... SRAT, Sriptable Runescape Autoing Tool. It was basically an exact SCAR clone, lemme see if I can get my hands on a screeny...

R0b0t1
07-13-2009, 05:17 AM
Yeah once the positions change it becomes WRONG.

Freddy1990
07-13-2009, 08:42 AM
When Freddy tried open source, like I said before, it was pretty much releasing the source to things that were finished. Done. Nothing left to add.

SCAR, on the other hand, has many opportunities for improvement. You keep trying to pair up things that don't go together.


EDIT: It depends what license he bought them under, although all those people who donated to Freddy are dipshits.

Hmm, I wonder if you serve any other purpose over here aside from giving me crap over nothing?

Dan Cardin
07-13-2009, 09:21 AM
lmao I think this should be the name
I spoke incorrectly, it technically means "I love you", but speaking from the invariable context of the informal dividends of the structure of the language, it could be interpreted as meaning "love". And that was all on purpose since "it can be interpretted to mean 'love'", which brings attention to the fact that it is a dual interpretter.

Anyways, could an admin *cough*Wizzup*cough*who shouldnt*cough* be contributing*cough* to the *cough*argument *cough*offtopically*cough* (sorry something tickled my throat) split this topic or something so that you can all criticize freddy elsewhere?

NiCbaZ
07-13-2009, 10:22 AM
Most of SCAR is pretty easy to recreate anyway.



I had a go and got all the GUI done + with the compiler (same one freddy uses) and probally about 15-20% of the scar functions.. aka most of color finding, math etc.. but then.. i gave up.

Wizzup?
07-13-2009, 06:43 PM
I spoke incorrectly, it technically means "I love you", but speaking from the invariable context of the informal dividends of the structure of the language, it could be interpreted as meaning "love". And that was all on purpose since "it can be interpretted to mean 'love'", which brings attention to the fact that it is a dual interpretter.

Anyways, could an admin *cough*Wizzup*cough*who shouldnt*cough* be contributing*cough* to the *cough*argument *cough*offtopically*cough* (sorry something tickled my throat) split this topic or something so that you can all criticize freddy elsewhere?


It may be an idea to go on topic again...?

I don't think I really contributed to the argument much, and I've already posted that ^ on the previous page.

Go on topic, guys. If you want to discuss hypocrisy of certain members, do it somewhere else.

This thread is for lardmaster's project! :)

Jimmy5410
07-14-2009, 10:13 AM
Hey,

About the client loader: I dug up an old loader I wrote and fixed it up. It is included in the latest svn.

About sending events to it: I had an idea of how to send events to it, but there are other things I also need in order to make it work. I need to intercept the events it would normally get. I started to code some of the key and mouse functions, but getting the bitmap from the screen seemed to be a problem. You can't actually get the buffer of a Canvas object. At first I thought they would be using repaint() and update(), and I figured out a way to intercept their events, but it turns out they don't. They instead use getGraphics() and then paint directly to the graphics. I don't know of any way of intercepting this. I tried turning on double buffering in the AWT peer, and grabbing the back buffer. This works, but not when minimized, so it is no better than normal screen grabbing. I think it might be possible that it stops drawing due to java code, which means it would be possible to make it keep drawing when minimized. However, I think it is native code that determines when it is minimized and stops updating the buffers, and I don't want to mess with that. Also, grabbing the back buffer isn't so great, because you have to wait a bit before you switch the buffers and try to grab it, because otherwise sometimes you will switch buffers before the client even paints the whole scene. If I could intercept the getGraphics call, that would be great, but I have semi given up for now.

On the other hand, in terms of getting straight scar emulation, things are progressing. I got the keyboard and mouse working. However, some things, like window targeting, require native code. I currently am building a library with Xlib (X Windows) code using JNI. My eventual plan is to create a windows and mac version, so it will be cross platform.

There are some things that I am not implementing, like SendKeysVB, because they would be projects of their own.

Some things are not possible with java, but are too trivial to do JNI stuff for now, like IsKeyDown.
Other things, like SendKeysSilent, I am leaving out because they are obsolete.

The way I see things, the next thing to do is Color functions, then Bitmaps, then OCR.

If somebody would help write the JNI stuff for windows and mac, that would be great.

About my gui: Not using a window manager is really my problem. I just use BoxLayout, because I can't figure out any of the other ones.

xboot java.awt.Canvas or hack runescape's Canvas class to extend your Canvas.

What exactly is the that you're trying to do in native code that can't be accomplished with Java?

ruler
07-14-2009, 01:23 PM
I recall using epascal in ibot long time ago and it was 100 times faster than scar in simple algorithms where we did not go to any compiled calls.

I would like to see some benchmarks comparing this to.
https://epascal.dev.java.net/

A quick read thru shows a good working knowledge of java.

I dont think you need any serialVersionUID, since i dont see any serialization calls except for one implementation.




public static enum grouping_exception_types {
MISMATCHED_PARENS, MISMATCHED_BEGIN_END, UNFINISHED_BEGIN_END, UNFINISHED_PARENS, EXTRA_END_PARENS, EXTRA_END,
};

grouping_exception_types grouping_exception_type;

public grouping_exception(grouping_exception_types t) {
this.grouping_exception_type = t;
}

public String toString() {
switch (grouping_exception_type) {
case EXTRA_END:
return "Unmatched 'end' token";
case EXTRA_END_PARENS:
return "Unmatched end parentheses";
case MISMATCHED_BEGIN_END:
return "Mismatched begin-end construct";
case MISMATCHED_PARENS:
return "Mismatched parenthesized construct";
case UNFINISHED_BEGIN_END:
return "Unfinished begin-end construct";
case UNFINISHED_PARENS:
return "Unfinished parenthesized construct";
default:
return "Unknown exception type";
}
}

move the string descriptors into the individual enums, with each having a string field describing itself then override toString to return that field.

I don't know why your not using the native java types or at least the wrappers.

Looks very inefficient, alot of new's. I could be wrong assuming execute( .. ) is runtime not compile time.



My main concern is why pascal. If you going to re-make SCAR do it in MONO and make people code in C# please. Also look at mono tasklets.


Making a bot is nothing new.
rsbot,scionbot,kbot,scar,optimus,automatrix,xbot,s eedbot,prsb,sbot1,2,3,aryan,genribot,JB_BOT,ARGA,J IF,RuneGrail,SAM,TLM,xshangx,ares,sythescape,jmacr o
+100 VB color bots

Using pascal your missing tons of syntactic sugar.

R0b0t1
07-14-2009, 10:33 PM
OH GOD LETS MAKE A POST WITH A HINT OF CONDESCENDING. a

ruler
07-15-2009, 09:56 AM
OH GOD LETS MAKE A POST WITH A HINT OF CONDESCENDING. a
What is your review of the code?

R0b0t1
07-16-2009, 06:43 PM
It works, but trying to implement it in OO could end up making it worse and hindering performance.

Why are you so obsessed with multiple threads? C# is not the newest and best thing because it is multithreaded.

Nava2
07-17-2009, 10:15 AM
About your multi-platforming, why not write the plugin in a cross-platform language like C or C++?

Also, don't write it for C# :<

R0b0t1
07-17-2009, 11:41 AM
Yes, C# sucks. Besides being platform-specific, it has to go through .NET (which is like the JVM, almost), not to mention the crap that is the .NET libraries themselves.



I was actually working on a C program to compile stuff to machine code and then run it in RAM, but this might be tricky, but I expect to have more problems w/ the parsing of the language, not the compiling to RAM part. I know C# is introspective, but it's not made for things like that.

ruler
07-17-2009, 02:21 PM
It works, but trying to implement it in OO could end up making it worse and hindering performance.

Why are you so obsessed with multiple threads? C# is not the newest and best thing because it is multithreaded.
SCAR has 2 threads. I use many more. Multi threading on the desktop has existed since windows NT (early 1990's) it is not new. I use it because my system has many states and it is more efficient way to handle a many-many state machine. where as in one thread i would need tons of timers, constant jumps out loop to check numerous states. Possible to code yes, hard to extend. Threading makes this easier and efficient.



Yes, C# sucks. Besides being platform-specific, it has to go through .NET (which is like the JVM, almost), not to mention the crap that is the .NET libraries themselves.



I was actually working on a C program to compile stuff to machine code and then run it in RAM, but this might be tricky, but I expect to have more problems w/ the parsing of the language, not the compiling to RAM part. I know C# is introspective, but it's not made for things like that.
I dont think you understand alot based on your comments.

C# started off where Java left off.

C# has macros, LINQ, more native types (unsigned etc), more advance case statments with goto's and switches on strings, type struct thus allocation on the stack instead of heap for better performance, native generics, etc.
tons of syntactical suger.

mono has tasklets
http://tirania.org/blog/archive/2009/Apr-09.html

Hence why i recommend it.

The rest of your post doesn't make sense to me, elaborate in detail. You were saying you were writing a program in C to parse this, which to me sounds like a academic exercise, since many off the shelf ones exist. As for the run it in the RAM, all programs are run in the ram.

Their are tons of parsers that take in standard grammers.

http://en.wikipedia.org/wiki/List_of_parser_generators

http://www.antlr.org/grammar/pascal


About your multi-platforming, why not write the plugin in a cross-platform language like C or C++?

Also, don't write it for C# :<
SMART is compiled in cross platform language but it links to stuff that is windows only same with SCAR.

R0b0t1
07-17-2009, 07:18 PM
No, you don't get my point. I know multi threading is not new. I looked at something you were making and you had like 20+ threads... Which is way too many, you will decrease your performance.

Also, succeeding an idea which may or may not be good depending on what you're doing doesn't mean it's automagically awesome.


What I meant was take in a program and turn it into machine code, store this machine code somewhere on the heap, and jump to it like a function.

ruler
07-17-2009, 09:29 PM
No, you don't get my point. I know multi threading is not new. I looked at something you were making and you had like 20+ threads... Which is way too many, you will decrease your performance.

Also, succeeding an idea which may or may not be good depending on what you're doing doesn't mean it's automagically awesome.


What I meant was take in a program and turn it into machine code, store this machine code somewhere on the heap, and jump to it like a function.
FUD... saying things like "you will decrease performance", succeeding may not be awesome . Judging my your previous posts you may be just trolling.

Even Freddy thinks so
http://www.villavu.com/forum/showpost.php?p=600538&postcount=93


Last year with a couple of bots running i could have 20 threads with many bots but this was short lived as a script job system replaced those instances. I believe i mentioned that tidbit as the reason for the new system which i may have been describing.

per process (nexus)
1 for swing
1 for swt
1 for paint
1 for input

2-7 Thread worker pool shared by bots.

per bot:
1 for rs
1 for script

We scale well to about 4-5 bots at that point its best to start another process.

R0b0t1
07-18-2009, 01:00 PM
No, succeed as in be after.

tarajunky
07-18-2009, 02:52 PM
Freddy, always remember that imitation is the highest form of flattery...

Ouivile
07-18-2009, 05:02 PM
PIJ?
Pascal Interpreter in Java

~shut

hi 5 my thoughts exactly

PIJ OR PIIJ ==>[PIH-DJE] like in pigey or pigeoto lol

lardmaster
07-20-2009, 11:45 AM
Well, this thread has spanned many things *not* related to my original post, but I guess I will respond to ruler, since he seems on topic :)

Vs. Epascal: I would love to do some sort of comparison, but I wouldn't know what code to compare? Are there any implementation agnostic benchmarks? The reason I didn't just decide to use Epascal was
"Interpreter doesn't supports:
* record statement (preparing)
* type statement (preparing)
* objects
* arrays as parameters in functions and procedures
"// I don't support objects, and don't plan to, but it supports the others.

About SerialVersionUID: Yeah, that really is unnecessary, and truth be told, I only added one because the compiler gives you a warning if you don't have one, and I was trying to clean up some of the warnings. I don't see any point in serializing anything I have made.

About the enums: Thanks for pointing me in the right direction. Java has a whole level of enum capabilites that I was completely unaware of, and reading up on it, it will make this code much better, but it will especially clean up my arithemetic.

I have no idea what you mean by not using native java types, or at least wrappers. Wrappers are exactly what I am using, the only exception is in type information, which I keep in my own wrapper class for java.lang.Class, because array types in pascal hold extra information that is not contained in java.lang.Class.

About the efficiency: It will generate a lot of objects to create the tree, but once it starts running (the execute() method), it won't really create many objects. It is called at runtime, as in partway through the execution, if that is what you mean, and not as preparation. However, I know that generally a programmer has no understanding of the bottlenecks in his code until he profiles it, which I haven't.

you said "my main concern is why pascal", but I think you meant why java, but I will answer both questions :) Why pascal: because there are tons of SCAR scripts that do things well. Why java: the ironic truth is that my original idea was to allow java bots like ibot to run SCAR scripts.

About making a bot: My plan wasn't to really make a bot, but simply something that would allow java bots to hook up to SCAR scripts. I tried contacting you for a while about it, but I couldn't, so I decided to start working on a strict SCAR emulator.

On a side-note: Trying to post on the rscheata forums, it appears that my account has been banned after being taken over, in a circumstance eerily similar to what happened here. I tried talking to Mark about it, but I was only able to contact him one time, and he suddenly went afk partway through the conversation. If you could give me an IM account I could contact you on, then I could prove to you that I am the actually lardmaster, and hopefully you could allow me to post about this on rscheata, or help me setup some sort of interface to nexus.

Thanks!

ruler
07-21-2009, 05:51 AM
for benchmarks do simple loops / simple example pascal scripts.

wrappers like http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Number.html

as for bottlenecks anything with keywords like "new", "monitor enter/exit", volatile, many method invocations, reflection will slow you down. But i would first reduce the number of new's during execution.


Mark went thru the typical verification process as in asking question only you would know answers to.

You came back to the forums 4 months, the person using the acct knew alot of things, mark added gmod back to the account, then the acct was used for scamming, and used to deleted/cover up the incident. Mark banned for that. Then mark was contacting by your msn saying that you let your friend use your forum acct to get free pro. After a week mark let you come back under ex-staff title then forum acct tried to scam again.

As of now, the story on msn is currently, the msn was stolen and the real one is now talking.

Sadly the opportunities to fix this has past. If you were hacked for real you should have realized it over the 4 month span.

lardmaster
07-22-2009, 12:40 AM
I know it's kind of ironic that I am taking my own thread off-topic...

What kind of things did the person with the account know? Do you mean like programming? I mean, there is not a lot of personal information attached to my account, so I don't know how he could "know" a lot of things related to that.

Isn't there any way I could show that the previous account was somebody completely different? Like looking at IPs. If you compare the location from before I stopped logging in to at the time of scamming, they would probably be in different states or even countries. I doubt the scammer also lives in Massachusetts.

I mean, I can prove I am the original owner of the account, but at this point I guess you think it was the original owner who scammed. And to answer your question, the reason I didn't attempt to login or try to for any runescape cheating sites was because I was busy with school. I can't remember exactly, but I pretty much stopped sometime in the fall. However, I had time to continue programming.

And, about the use of wrappers: The java wrapper types (Integer, Double, etc) implement the Number interface, so I am doing no wrapping above autoboxing.

EDIT:I looked over the posts he made under my account. None of them seem to indicate any knowledge whatsoever. All he did was do lots of market stuff. And, if it means anything, he posted screenshots of a windows desktop, and I always used Linux except sometimes at a friends house. You should know, because I would bug you for linux support. I don't know if you log user-agents though...

killhack95
07-28-2009, 03:01 AM
If you like kde linux, why not name it Jse-J scar environement (j being for java)

soaeij-scar ownz anyways, even in java!