SRL Archive - Suggestions

Interpreter For C-Type Language


LolL

2011-03-28 15:30:27

An interpreter for a C-type language would, I guarantee after being learned well, increase development fUn and make code so much easier to read/write. No MORE FREAKING BEGINS AND ENDS.

So it doesn't have to have a super-duper complex syntax. We could customize it to our liking (like keep the var tag instead of using C pointers). But must-have features would be:
  • Brackets!! if (thisHappens) { soMuchLessPainfull(); }
  • C-type function declarations: int get_noobs() { //code… } – no need to write function/procedure every single time!
  • C-type value returning: return 1; return 2; return 3; etc.
  • the #define directive
  • ZOMG!!! using "=" instead of ":="
  • Along with C-type function declarations, there would be C-type variable declarations (no "var")

And I'm sure you guys can think of other features to add. The main point is to finally ditch Pascal, please please. (For Pascal fanatics, people who haven't learned C basics yet, older scripts, etc.: there could be both a C interpreter and Pascal interpreter.)

Sabzi

2011-03-28 15:40:01

But I want strings :p. :D
I would so love this, tho.

Dan Cardin

2011-03-28 15:57:13

python with give you the cleanliness that you speak of but it's already made. It's also something with actual support behind support for it in Simba.

Brandon

2011-03-28 15:57:41

Ummm u guys are forgetting scar++ …. I tried working on it as much as I can but I just cant get dtm's and stuff to work even though wizzup sent me the source code of how its done in simba.. that means I'd actually have to learn pascal to translate it..
Anyway check this out… it works 100% of the time and perfectly… even tolerances work:


#include <Scar++.h>
#include <iostream>

using namespace std;

int x, y;
const
Color = 0;

int main()
{
Scar setup;
if(FindColourToleranceIn(x,y, Color, 0, 0, 100, 100, 15)
{
cout<<"Found Colour at: "<<x<<" , "<< y<<"\n";
}
return 0;
}

Emaziz

2011-03-28 16:41:34

I would loooove to use C++ instead of pascal :D

i luffs yeww

2011-03-28 16:43:45

From: Sabzi
But I want strings :p. :D
I would so love this, tho.


You can has your strings, I promise. ;) That is one reason why I like C++ over C.

@ggzz, The problem I have with SCAR++ is that it hasn't been developed in awhile, and, afaik, it's just ported functions. It would make a lot more sense to recreate a C++ bot (which I've been slowly working on).

Anyway. Ontopic, C-style interpretation without C would be silly. Unless you mean add C support, which could be done after libMML is done (if not now?). I'd like to completely remake Simba to be C(/C++ ;D), but a lot are opposed to moving away from Pascal. I'd be fine with C or C++, but preferably C++ (solely based on personal preference. :p I have nothing against C, I just haven't spent time learning much of it yet).

But I'll be trudging along with my C++ bot.

Sabzi

2011-03-28 17:19:20

I didn't read the part after "Anyway", but I am interested in a c++ simba like(not reflection/injection/whatever based) bot.
Would it be object oriented?
I think I would be able to help as well. It would be great practice.
Okay, I have read that part too. I also prefer ++. God I hate all the mallocs in c.(and no real strings :crying:)

i luffs yeww

2011-03-28 17:22:01

Well you can just create an enum string type like you have to do with bool if you want that in C. :p I don't think it's a major factor to not use it. Definitely a good language. Just some silly gimmicks (like no string/bool), imo.

Sabzi

2011-03-28 17:30:59

I know how to use "almost strings" in cee(from the tags). I just don't like it.
If it's not object oriented(the project) I actually don't see too much reason to go with c++.
However we haven't finished learning c++.

i luffs yeww

2011-03-28 17:34:35

Wait what? What project? :x And why not C++? I'm not talking about using SCAR++ at all in case you thought that.. I've been remaking a bot in C++ for rs is all. Just wanted to bring that up because it's relevant. :p

And I figured you knew how to make them in C. ;) Archive purposes + searching may lead to that post some day.

Sabzi

2011-03-28 17:39:51

From: i luffs yeww
Wait what? What project?
you gave answer too:
I've been remaking a bot in C++ for rs is all.

I may have misread things, today was a bad day, got home from university at 8:30 pm(gone there at 8:00 am).
And as I have mentioned I just glanced through longer parts in this thread.
If it's a personal project just think that I wasn't speaking at all.

kitchenrange

2011-03-28 17:41:31

Is your C++ bot going to be completely color yew?

Is it even possible for C++ to access reflection?

Brandon

2011-03-28 17:44:10

From: kitchenrange
Is your C++ bot going to be completely color yew?

Is it even possible for C++ to access reflection?


well with a bot with something like smart (I believe its written in c++ and java just for the client itself and reflection) This can be done the same way.. except instead of doing scripts in pascal or "Simba interp" u can do them in pure c++

i luffs yeww

2011-03-28 17:45:50

Ohhh. I missed the "If" in "If it's not OOP." :p

I'll have OOP with the bot. It could definitely be made in C with some changes, I just don't see why since I know C++ better than C, and strings/bools/etc. ;)

@king, I've never really done work with an aimbot for FPS games, but I've used them. I have a slight idea of how they work (hooking the game, similar to reflection afaik), but since FPS games aren't made in Java it's probably different. :p I'm just doing some color POCs atm. And this is mostly just a learning experience for me.

I'll use Java for the client (obvi), and maybe for some reflection stuff. I don't know if I want any reflection/hooking/etc. anyway though.. I have some cool ideas I want to implement into it (an idea from mathematica that I'll probably make into a plugin for Simba as well that could handle walking quite fantastically (hopefully)), and shouldn't need any reflection/hooking/etc. like I said. So I dunno.

Smartzkid

2011-03-28 19:21:29

S of things like your current world position.You should bother BenLand for his C++ based macro (I forget what it was called; 'trout' comes to mind)

Imo we can do whatever we like with languages/etc, but they won't succeed until someone comes up with a way to run srl functions from within said hypothetical bot. IE put pascalscript into a dll.

EDIT: If you intercept the graphics library calls, you can do a lot of neat object recognition, but reflection still has an edge in that it can access values of things like world position.

You should be able to run SMART from a C/++ application if you use the right calling convention.

i luffs yeww

2011-03-28 19:22:53

Smartz, I don't get what you mean. Why just port srl functions rather than remake them to work better with the bot/language? :x

Nava2

2011-03-28 19:24:15

http://www.lua.org/about.html ??

i luffs yeww

2011-03-28 19:33:31

From: Nava2
http://www.lua.org/about.html ??


Go on..

:p but srsly. I've looked into Lua before but dunno why I'd choose it over other languages.

Nava2

2011-03-28 19:45:46

Use it as a scripting language.. its C-style and proven.

i luffs yeww

2011-03-28 20:11:48

Why not just use C? :p C is proven as well, I'd say.. ;)

Nava2

2011-03-28 23:49:38

From: i luffs yeww
Why not just use C? :p C is proven as well, I'd say.. ;)


C is not an interpreted language, hence irrelevant to the discussion. :)

i luffs yeww

2011-03-28 23:55:03

He's not asking for an C-like interpreted language though? He's just asking for an interpreter to interpret C-style syntax.

Well after rereading a few times, he kinda is saying he wants an interpreter for C syntax but not a C interpreter necessarily, and then says we ditch Pascal, possibly inferring he wants C entirely (with the PascalScript interpreter as well), I think? lol I dunno. That's what I got from it.

Still, I think this brings up some things to talk about amongst people like you (Nava), Cohen, Wizzup?, Raymond, etc. etc. (anyone who knows what they're talking about and has valid things to bring up). I say Cohen because him and I talked about it, and I don't think I have much say in stuff like this (although I have a lot to say). Maybe I'll show my bot (in a few weeks) as a small POC of what I think would be good.

Echo_

2011-03-29 05:57:51

From: kitchenrange
Is your C++ bot going to be completely color yew?

Is it even possible for C++ to access reflection?


Of course, SMART is written in C++ after all.

Wizzup?

2011-03-29 11:15:40

From: Smartzkid
You should be able to run SMART from a C/++ application if you use the right calling convention.


It works fine for any language capable of doing native calls. Python can do it, I'm sure others can do too.

Smartzkid

2011-03-29 22:47:12

It might also be worth looking into hosting C#'s compiler as a service (using Mono, of course)

Familiar syntax
Powerful libraries
Can be fully interpreted or JIT'ted

Wizzup?

2011-03-30 06:15:42

And by Microsoft…