SRL Archive - General

A Simba and .Net question


double codes

2013-06-27 12:07:02

Hey.

In my RS Helper 0.2 i want to include a newer before seen feature in a RuneScape Helper, the ability to calculate how long there is to you level up or how much exp/gp you're making each hour in real-time(You know what i mean).
I've been thinking, since simba already can read text(Images) of the Runescape "In-The-Box" making one in .NET would be a pain.

So here's my question:

Since i can integrate Simba with VB.NET(For obvious reasons), can simba create a text file that i then can parse VB.NET ?
This might be a stupid question but i frankly don't know the mechanics of a scripting language.

I'm unsure how this will work since the end-user must have both Simba and .NET installed and run both the script and the application itself.

Any ideas or answer will be appreciated.

Thanks

Brandon

2013-06-27 12:32:35

@double codes;

A file can be parsed by any language as long as you know the format. It's the same with loading extern libraries. You can do that as long as you know the calling convention and translation.


You have Simba write some file to the disk in some format you made up. Have VB.Net read the file in the exact same format you made up. Simple. You can use already written formats as well. Since you know the format, both reading and writing can be done.

Another idea is to serialize the data in some format you made up. Then Deserialize it in VB. Let's not go there though ;) Use the above. It's easier.

masterBB

2013-06-27 12:45:10

You can make one up yourself, or use an ini. It all isn't that hard. Simba got easy and useful functions to write and read files(in the form of a String for example).

double codes

2013-06-27 13:12:24

From: Brandon
@double codes;

A file can be parsed by any language as long as you know the format. It's the same with loading extern libraries. You can do that as long as you know the calling convention and translation.


You have Simba write some file to the disk in some format you made up. Have VB.Net read the file in the exact same format you made up. Simple. You can use already written formats as well. Since you know the format, both reading and writing can be done.

Another idea is to serialize the data in some format you made up. Then Deserialize it in VB. Let's not go there though ;) Use the above. It's easier.


So that basically answer my question that Simba can write files.
However, do can you think of a way not using both Simba and the .NET application to make the application function as it should be ?

Brandon

2013-06-27 13:54:54

From: double codes
So that basically answer my question that Simba can write files.
However, do can you think of a way not using both Simba and the .NET application to make the application function as it should be ?



Well tbh, I can think of a lot of things.. But I'm not sure that will help you. It really is up to you and you alone what you want to do. I can only assist you to get the job done.

If you want to use only Simba alone, then you can do that by all means. If you want to use VB.Net alone, the same can be done.
One way or another, you'd still have to have some sort of interpretation of the data you collect.

You can read/write from sockets for example to get the data. You can reflect/inject the client. You can intercept graphics card data. You can screen capture the data. All of these methods require that you interpret the data how you see fit but at the same time logically.

It's been quite some time since I did VB, if you do need help and decide to write it strictly in VB, I won't have a problem helping or donating some code. However, I'm not sure if you'll get much usage of your application as most people just look up stats using some website or another. Simba scripters for example just do something like "GetMMLevels('HP');" or "GetSkillLevels('attack');".

Doing this in VB, you'll learn a lot but you'll also be writing a lot of code.


If you're looking for practicality and ease of coding, you can use Simba and I'm sure a lot of users would understand it easier and probably incorporate it into their scripts if it is written well. If it is in VB, well.. there isn't many around here who understand it all that well and you'd get a couple users I guess? Up to you.

Kasi

2013-06-27 14:00:55

From: Brandon

Doing this in VB, you'll learn a lot but you'll also be writing a lot of code. I can't remember but I think @Kasi; used to do VB? Or was that someone else :S


I know VB :P, I wouldn't advise learning it as it will poison your brain. but then again its powerful for basic users. if you wanna get something done quick and don't care about the beauty of coding then VB is your option. Of course you'll have to accept the non-zero based arrays amongst many other flaws.

@Brandon; Don't ever mention that again ;)

double codes

2013-06-27 14:14:05

I am not interested in read data from packets since that would include a sh*tload of parsing and coding in general.
I am however interested in making the data real-time and as accurate as possible at the most efficient way.

I also want to point out that i doubt you will have to donate any code snippets, since i want to learn a fair share of coding myself to get better.

Brandon

2013-06-27 14:18:34

From: double codes
I am not interested in read data from packets since that would include a sh*tload of parsing and coding in general.
I am however interested in making the data real-time and as accurate as possible at the most efficient way.

I also want to point out that i doubt you will have to donate any code snippets, since i want to learn a fair share of coding myself to get better.



If you absolutely need "THE" most efficient way for passing data to and from different programs, these are your options from Worst to Best:


File IO.
Database IO.
Socket IO.
SharedMemory IO.

double codes

2013-06-27 14:40:07

From: Kasi
I know VB :P, I wouldn't advise learning it as it will poison your brain. but then again its powerful for basic users. if you wanna get something done quick and don't care about the beauty of coding then VB is your option. Of course you'll have to accept the non-zero based arrays amongst many other flaws.

@Brandon; Don't ever mention that again ;)


I must say i disagree with many of your points:

"I wouldn't advise learning it as it will poison your brain."
I agree it "Poison" your brain in such a way that for example Java and other programming languages excluding C# is a lot harder to learn.
However VB.NET is pretty amazing, i believe and have proven in some ways that VB.NET compared to other programming languages are just as good.

but then again its powerful for basic users.
Both basic and advance users.
I know a few guys who program in VB.NET and are in what i like to call "Elite" pretty much meaning they know they way around VB.NET as it were a playground.

if you wanna get something done quick and don't care about the beauty of coding then VB is your option.
If you mean optimizing as in beauty i can totally relate to it, but truth be told VB.NET is made for rapid programming to make the job quick.

However, you got the option to optimize the code whenever you wish, i might not be accurate about this but VB.NET and C++ can do pretty much the same with roughly the same time frame and work just as good.

Of course you'll have to accept the non-zero based arrays amongst many other flaws.
I think what you mean by "non-zero based arrays" is that every array starts with 0,1,2,3 and so on ?
I can't see how this is a bad thing ? It makes sense doesn't it ?
In the old times when pacman ruled the game industry, you could only get to round 255 starting at 0 because of a single 8-bit byte.

Every programming has it weaknesses and strengths the question is what do you need to do the job done at the shortest time frame and make the application as good a possible.

I really hope you understand now why i code in VB.NET.
Note: This is my view and it might be comparable to your own.

double codes

2013-06-27 14:42:03

From: Brandon
If you absolutely need "THE" most efficient way for passing data to and from different programs, these are your options from Worst to Best:


File IO.
Database IO.
Socket IO.
SharedMemory IO.


SharedMemory shouldn't be that hard or take that long.
I'll look into it, thanks :)

masterBB

2013-06-27 15:11:31

Why would you use shared memory for that. Also note that you can't use it from a script. The only way to use shared memory is by using a plugin. And if you are going to use a plugin use the same programming language.

Kasi

2013-06-27 15:39:56

@double codes;

You say you disagree with most of my points but I have 4 points, but you’ve agreed on one, elaborated and added to two, and misunderstood the last.

Firstly, as I do code in different languages, I do help out some friends irl though coding in VB. As I move between multiple languages, VB is by far the most illogical language of them all. This relates to the last point you brought up about the non-zero based arrays. In VB if you allocated an array with 50 elements. It will give you space for 51 elements. It goes from 0|1|2|..|48|49|50. Why it does this I do not know but I hate it because for example it’ll fuck up the basic logic of a simple shellsort etc. Doesn’t mean you can’t program a shellsort but its personally off-putting. People will notice this, I guarantee it. It does poison to an extent.

As for my point about the beauty of coding I mean multiple things. Of course optimising but also aesthetics. I personally just think VB is an ugly language. I hate reading it. To me coding is more than just job. It’s an art. It sounds cheesy, but I like stuff looking good, not the end result but the actual code. I take pride in what I code. My point about VB being a quick solution to a problem still stands. It’s a fast and powerful language. All be it – basic, which brings me to my next point.

You say you know people who program in VB, who you call elite. VB isn’t a hard language to master. Its powerful as ive already mentioned. Of course it would be easy to learn and therefore easier to master. I see no benefit in this. If you’re learning a language, why learn an easy language? Where would the fun be in that? You said it yourself, made for rapid programming to make the job quick.

You’re speaking from purely a job sense – like it’s a chore. There is a no fun in that.

You might think I’m criticizing your preferable language. However I’m just stating the reasons why I dislike it. That all being said, it does do the job. And is quick in doing so. Everybody has their preferences. Yours is VB.

double codes

2013-06-27 16:09:02

I'm sorry my post was arrogant and disrespectful to both you and the coding community.
I tried to play cool and by that i failed, i love programming there only that i can't code that much or else i get depressed because well i don't know.
However i try to get my project released in the purest form of coding with documentation and well written code so people can easily understand what does what.

I am that type of guy who says "I am gonna get this done!" and then i don't get it done or i just frankly forget everything about it.
There is just now i can finally code without felling that i will probably just throw the whole project away since i now use it for RuneScape.

My thoughts about changing programming languages have come to mind quite a lot recently but i feel like i have something to prove to VB that it isn't just a crappy programming languages but a not maybe a great but at least a decent programming language to code in.


Sorry for wasting your time.

Thanks.

Brandon

2013-06-27 16:29:38

From: double codes
… Long post …

Thanks.



VB is your own preference. C++/ASM is mine. Java is Kasi's. Pascal/Go is Wizzup's, etc. He's just stating why he disliked VB. After all, all three of us did VB at some point in time. I too dislike it but don't be discouraged because I'm sure that is not his intent.

Your project is already in VB, there's no switching now unless you're going to re-write the whole thing in C#. And yes, I did look at your project's code.

As for using Shared Memory. MasterBB is correct in that it can only be used via a plugin. In other words, you're going to have to write the SharedMemory stuff into a dll and I'm sure you'd much rather skip all that work and choose another option.

I only laid out the options for you to choose. I'm not saying that you shouldn't choose shared memory. I'm saying that you should choose the right tool for your task. IMHO, FileIO as less efficient as it may be in comparison to the others, it is the easiest and it might not be as inefficient as you may think. In fact, many programs use FileIO to store settings and constantly read and write data. The thing is, you should limit how much of it you read and write. For example, you don't want to constantly read/write 200+mb files over and over. Rather you might read a chunk of it into memory and keep it there. Things that are constant/static/don't change are the things to look for when optimizing.

VB compiles to a JIT interpreted language. It shouldn't be as slow as it may seem. It is true .NET anything is slower than a native compiled language but it's not that bad. The FileIO can be fast if you make it so. There are actually quite a bit of parsers and viruses written in C# and VB. There's a reason for that: Quick to program, easy to understand, not too slow, gets the job done.

We're not here to discourage you. Just to guide you in the right direction. IMHO, choose the FileIO then if it isn't as fast as you want to be, it'd be easy to easily swap the code out and implement another system.

double codes

2013-06-27 17:03:20

From: Brandon
VB is your own preference. C++/ASM is mine. Java is Kasi's. Pascal/Go is Wizzup's, etc. He's just stating why he disliked VB. After all, all three of us did VB at some point in time. I too dislike it but don't be discouraged because I'm sure that is not his intent.

Your project is already in VB, there's no switching now unless you're going to re-write the whole thing in C#. And yes, I did look at your project's code.

As for using Shared Memory. MasterBB is correct in that it can only be used via a plugin. In other words, you're going to have to write the SharedMemory stuff into a dll and I'm sure you'd much rather skip all that work and choose another option.

I only laid out the options for you to choose. I'm not saying that you shouldn't choose shared memory. I'm saying that you should choose the right tool for your task. IMHO, FileIO as less efficient as it may be in comparison to the others, it is the easiest and it might not be as inefficient as you may think. In fact, many programs use FileIO to store settings and constantly read and write data. The thing is, you should limit how much of it you read and write. For example, you don't want to constantly read/write 200+mb files over and over. Rather you might read a chunk of it into memory and keep it there. Things that are constant/static/don't change are the things to look for when optimizing.

VB compiles to a JIT interpreted language. It shouldn't be as slow as it may seem. It is true .NET anything is slower than a native compiled language but it's not that bad. The FileIO can be fast if you make it so. There are actually quite a bit of parsers and viruses written in C# and VB. There's a reason for that: Quick to program, easy to understand, not too slow, gets the job done.

We're not here to discourage you. Just to guide you in the right direction. IMHO, choose the FileIO then if it isn't as fast as you want to be, it'd be easy to easily swap the code out and implement another system.



Please for the love of god don't look at the source code it's horrible and unstable, i've rewritten the whole project now and added threads(The timers where only a temporary solution) and fixed up on functions and subs.
I haven't look into anything yet so i can't really give you a clear response but i think i know an easy but yet efficient way to get values from memory.

I'll keep you updated :).

Kasi

2013-06-27 18:10:40

@double codes;

Wasn't disrespectful at all, maybe a little arrogant, but that's okay because most of us are arrogant ;)

if your willing to learn, this community is open to teaching you, just post away if your ever stuck on anything and someone will be sure to assist you.