SRL Archive - Development

Simba Development update 29/04/2012


Wizzup?

2012-04-29 07:55:10

Hello everyone,

I figured after a few weeks of working on Simba on and off, we've got quite a few great developments to share. Note that most of what I'm going to mention isn't ready to be used/tested yet - (SRL integration in missing for example); but it's on the horizon and will be available in the near future.

Simba 0.99

First of all, Simba 0.99 will be released soon. It contains a lot of bug fixes (more details will be given upon release) and a big amount of (perhaps not too noticeable features). A feature worth noting however is the ability to use Lape and SRL on Simba 0.99; which means we can write scripts in an interpreter other than PascalScript. If all turns out well, we'll (gradually) be moving to Lape all together and abandon PascalScript; but I suspect this won't happen any time soon. (PascalScript will stay in Simba for quite a while).

SMART Changes

BenLand100 has done some wonderful things to SMART. First of all, the SMART you have sitting in your plugin folder supports EIOS; the generic input method that Simba uses. This was a requirement for Lape initially; because Lape could not yet load/call methods from plugins. (Well, it could, but not with our current plugins)

Apart from the EIOS support, he has also been working on moving SMART out of the Simba process. You've read that right, no more JVM in the Simba process that will crash Simba once SMART/Runescape crashes. The CPU usage will also be split; so Runescape CPU usage won't show up Simba CPU usage anymore. We can also finally properly debug Simba as the JVM kept interfering with our debugger.

While the advantages mentioned right now seem marginal; having SMART out of the process also means we can finally start using some of Simba's cooler features: the ability to run several scripts at the same time using one Simba. Of course, you could already do this, but several scripts using the same mouse is hardly useful. Each script can now connect to its own SMART, and you won't need a separate Simba folder for each script.

https://github.com/BenLand100/SMART/tree/master/remote

Simba Multiprocess

This is something Dgby714 and I have been working on. Right now, Simba runs all the scripts in a thread in its own process; but we've been working on moving the scripts out of the Simba process. There are several clear advantages to this:

  • Scripts will run on the main thread of their own process, thus making forms a lot easier.
  • We can clearly seperate running scripts from the editor; Simba; which should make remote managers of scripts (start/stop them via your phone) a lot easier. This is probably not going appear very soon though.

Don't expect Simba Multiprocess to appear in Simba 0.99 or Simba 1.0 though; it will however most likely come in Simba >1.0; so 1.1.

https://github.com/MerlijnWajer/Simba/branches/multiprocess

Lape, Lape and Lape

Nielsie95 has been doing great work on steadily improving Lape. On of the missing features was to perform calls to native functions (such as plugins) without wrappers (which have to created on compile-time of Simba) and callbacks for native functions (again, without wrappers).

BenLand100, Nielsie95 and I have started work on supporting calling native functions (callbacks will follow later), progress can be seen here:

https://code.google.com/p/la-pe/issues/detail?id=14 and https://github.com/MerlijnWajer/Simba/tree/libffi-lape

Support for using the ordinary plugins is already in place; callbacks and calling native functions from scripts is underway.

Having callbacks (even without callbacks, it is possible) will inevitably eventually result in Forms / import classes appearing in Lape, but I can't comment on when this will happen.

Plugin ABI change

To go forward with this change, we're going to slightly adjust the requirements for plugins. They should use one calling convention only; on 32 bit this will be cdecl and on 64 bit the native calling convention of the operating system. We'll be changing the names of GetFunctionCount etc to make sure no one gets bitten by the calling convention changes.

Simba 1.0

While I haven't talked much about Simba 1.0, it's certainly underway. We've been merging most new features into Simba 0.99; so there isn't a lot to report on for Simba 1.0, but the script manager will definitely be in 1.0. We should start a script manager council soon; a group which verifies and pushes scripts to the script manager. :)

Linux and Mac support

Simba 0.99 contains decent Linux support; so I'm going to consider releasing a ``proper'' Linux version with 0.99, but there are a few bugs I'd like to see fixed first, so I might release a proper Linux version with Simba 0.99.1. If I end up not doing this, you can obviously still get it from the autobuilds.

When Simba will natively support Mac is unknown at this time, but I've created an initial os_mac.pas file to ease porting Simba to the Mac. The only thing required is someone with a Mac, basic knowledge of Simba and the willingness and time to learn.

Gestapo

2012-04-29 07:58:16

Great cant wait!

Flight

2012-04-29 08:05:46

Now that was a pleasant read. Job well done Dev. team, I'm very much looking forward to this.

putonajonny

2012-04-29 08:08:45

Thats great to hear, can't wait :)

Benny

2012-04-29 08:21:50

Awesome, thanks :)

Abu

2012-04-29 08:24:03

We need more tutorials on Lape :/

Great updates though! Really looking forward to running multiple scripts via one Simba and the future update of a Scripts Manager :D

begginer

2012-04-29 08:28:20

This will be so good.

Daniel

2012-04-29 08:31:13

From: abu_jwka
We need more tutorials on Lape :/


http://villavu.com/forum/showthread.php?t=68613

Apart from that, it's pretty much the same as PascalScript, with the addition of pointers.

Wizzup?

2012-04-29 08:42:51

From: abu_jwka
We need more tutorials on Lape :/


I'm sure they'll follow once more people are picking it up. :)

From: Daniel
http://villavu.com/forum/showthread.php?t=68613

Apart from that, it's pretty much the same as PascalScript, with the addition of pointers.


I've started working on that a few months ago (on my blog because it can render the .rst nicely and does live changes): http://blog.wizzup.org/blog/lape

litoris

2012-04-29 08:59:06

I can run Simba on Ubuntu using Wine, it runs the scripts fine but gets really messy when editing/writing stuff. I might actually work on a script when there's a native Linux version :D

Dgby714

2012-04-29 09:41:16

From: litoris
I can run Simba on Ubuntu using Wine, it runs the scripts fine but gets really messy when editing/writing stuff. I might actually work on a script when there's a native Linux version :D


There is a native Simba if all your doing is writing a script =P
Tho don't run it unless your in Lape. (with lape srl)

lilcmp1

2012-04-29 09:47:35

Wow, incredible all the work you guys put into this. Thank you, and thanks for the update.

Justin

2012-04-29 09:51:52

Fantastic work! Thanks to everyone who has helped develop Simba!
Can't wait for the release!

Abu

2012-04-29 09:52:04

From: Daniel
http://villavu.com/forum/showthread.php?t=68613

Apart from that, it's pretty much the same as PascalScript, with the addition of pointers.


I've read over that plenty of times - no idea how to use pointers or any of the other features for that matter :redface:


From: Wizzup?
I've started working on that a few months ago (on my blog because it can render the .rst nicely and does live changes): http://blog.wizzup.org/blog/lape


Bookmarked.

Will definitely be going over that thanks!

Echo_

2012-04-29 10:05:52

Can't wait for OO in Lape, great job devs :)

Slone

2012-04-29 11:59:36

Wow exciting stuff, sounds fantastic. Can't wait to try it out!

Olly

2012-04-29 13:01:11

Looks good, Nice work guys.

P1nky

2012-04-29 13:03:00

Can't wait and great so capability for MAC is under construction even better :)

Sin

2012-04-29 13:05:38

Cannot wait for this!
Appreciate all the hard work you and the other devs put into this :)

punkd

2012-04-29 14:24:58

Great read. I'm look g forward to the updates. Thanks dev team!

masterBB

2012-04-29 14:53:48

From: Wizzup?
I've started working on that a few months ago (on my blog because it can render the .rst nicely and does live changes): http://blog.wizzup.org/blog/lape


At the area (http://blog.wizzup.org/blog/lape#division) where you explain dividing in lape. You state the div and / are the same. Though this is the case in pascalscript, it works different in lape. The '/' operator uses precise extendeds for calculating, the 'div' operator uses integer values for calculating.


writeln(1/4);
writeln(1 div 4);
writeln(1 / 4.0);

Lape:
0.25
0
0.25

Pascalscript:
0
0
0.25

Silentcore

2012-04-29 14:59:40

What a good way to start my day. Great release you guys going to make.

Imanoobbot

2012-04-29 15:02:03

From: Wizzup?

When Simba will natively support Mac is unknown at this time, but I've created an initial os_mac.pas file to ease porting Simba to the Mac. The only thing required is someone with a Mac, basic knowledge of Simba and the willingness and time to learn.


All the updates sound good. Im really looking forward to them! :)

So basicly I am using Simba all the day on my mac and would love to help and willingness to learn but I really have no Idea what to do, what to learn etc.

Hero

2012-04-29 15:41:41

Very good job. Looking forward to the script manager some day :)

Wizzup?

2012-04-29 17:39:03

From: masterBB
At the area (http://blog.wizzup.org/blog/lape#division) where you explain dividing in lape. You state the div and / are the same. Though this is the case in pascalscript, it works different in lape. The '/' operator uses precise extendeds for calculating, the 'div' operator uses integer values for calculating.


writeln(1/4);
writeln(1 div 4);
writeln(1 / 4.0);

Lape:
0.25
0
0.25

Pascalscript:
0
0
0.25


If you want to work on this please do. I can send you the .rst file. I've stopped working on it and I'm not sure when I'll continue.

Abu

2012-04-29 17:47:05

From: Wizzup?

I've started working on that a few months ago (on my blog because it can render the .rst nicely and does live changes): http://blog.wizzup.org/blog/lape


So I've read over this but I still can't seem to understand the use of pointers, why not just use @ ? The explanation given was:
The @ operator returns the memory address of a variable, whereas the ^ operator retrieves the value from a memory address

I'm not sure I understand this…

Also, why do you have to put () after procedures to call them? In PascalScript just writing CallProcedure will call it, but with lape you have to do CallProcedure(), explain why?

Furthermore, I'm not sure if Xor is unique to lape as I've never used it before, but it seems virtually the same as or :confused:

Thanks

Bobarkinator

2012-04-29 17:58:45

From: abu_jwka
So I've read over this but I still can't seem to understand the use of pointers, why not just use @ ? The explanation given was:

I'm not sure I understand this…

Also, why do you have to put () after procedures to call them? In PascalScript just writing CallProcedure will call it, but with lape you have to do CallProcedure(), explain why?

Furthermore, I'm not sure if Xor is unique to lape as I've never used it before, but it seems virtually the same as or :confused:

Thanks



Somebody please correct me if I'm wrong. But you use @ when you want to get a pointer to a variable. @foo would give you the pointer(memory address) to the variable foo. But say you already had a pointer and you wanted to know the value of the variable that that pointer points to, you'd use ^.

Not sure about the parentheses, maybe something to do with parsing.

As for xor(short for exclusive or), it will only return true if 1 condition is true and the other is false, so it's either or but not both. Whereas or will return true if 1 or both conditions are true.

masterBB

2012-04-29 18:04:03

From: abu_jwka
So I've read over this but I still can't seem to understand the use of pointers, why not just use @ ? The explanation given was:

I'm not sure I understand this…

Also, why do you have to put () after procedures to call them? In PascalScript just writing CallProcedure will call it, but with lape you have to do CallProcedure(), explain why?

Furthermore, I'm not sure if Xor is unique to lape as I've never used it before, but it seems virtually the same as or :confused:

Thanks


You don't have to use () after procedures AFAIK, but it is a standard in almost every major language. It's a good practices anyway. It shows the difference between a function/procedure and a variable. With pascalscript that is a bit odd.

For the pointer question. Many people don't understand pointers. They all think it is some kind of rocket science, but it isn't. Imagine a closet full of drawers. More than a million drawers. Each drawer are 32 bits of your memory of your computer, every drawer has its own unique number representing where it can be found in your memory. When you ask for the pointer of a variable you will ask for the drawer where the variable is stored. This will return a LongInt with the location. This location is called a pointer! Yeah it is that simple.

Xor is not the same as or. Examples!
true or true = true
true or false = true
false or false = false


true xor true = false
true xor false = true
false xor false = false

It will return true when they aren't equal. This is used a lot in bitwise operators. I believe someone already wrote a tutorial about it.

Ps, I'm quite drunk. But I hope this was clear

edit:
I misread the question about the Pointer. The pointer variable contains a pointer(obviously). But without a type.

edit2:
I'm not sure anymore if I misread. Well I gave answer to both questions. PM me for more questions, would gladly answer them tomorrow.

Wizzup?

2012-04-30 05:06:09

It's good to use parenthesis for function and procedure calls; Pointers can be typed; (PInteger is the immediate result of @some_int; but you can cast it to a pointer, to dereference it you also need to cast it to some type at least.

xor is not the same as or and I can assure you that it is in every language (typically denoted as '^' in C-like languages)

Gu3st...

2012-04-30 05:15:17

Great job everyone who worked on this!

This is one awesome update. I can finally see Simba sure and steady becoming that awesome program we've all been wanting :)

Good job everyone. I am extremely satisfied with this update

Sex

2012-04-30 05:24:22

From: abu_jwka
So I've read over this but I still can't seem to understand the use of pointers, why not just use @ ? The explanation given was:

I'm not sure I understand this…

Also, why do you have to put () after procedures to call them? In PascalScript just writing CallProcedure will call it, but with lape you have to do CallProcedure(), explain why?

Furthermore, I'm not sure if Xor is unique to lape as I've never used it before, but it seems virtually the same as or :confused:

Thanks

@ will give you the address to the variable.
^ will retrieve the value at the memory address given.

You'll need to cast the pointer before dereferencing it.


type
PLongInt = ^LongInt;
var
i: LongInt;
ptr : Pointer;
begin
i:= 5;
writeln(i); // value of i
ptr := @i; // stores memory location of i
writeln(ptr); // this is the address
IncEx(PLongInt(ptr)^, 10); // adds 10 to the value at the memory location of i
writeln(i); // new value should be 15
end.

You could do shit like this too:
type
PLongInt = ^LongInt;
var
arr : array [0..5] of LongInt;
ptr : PLongInt;
i : integer;
begin
ptr := @arr;
for i := 0 to 5 do
begin
ptr^ := random(15);
inc(ptr);
end;
writeln(arr);
end.
The parentheses are not required, but they are standard/required in almost every other language. They are used in Lape to differentiate between whether or not you want to call the procedure or just reference.

xor is not the same as or. Think of it as one or the other but not both.

krasniy

2012-04-30 06:10:00

exciting days ahead!!!!!

Echo_

2012-04-30 09:54:30

As Sex demonstrated, pointers can be used as iterators:


var
A: array[0..9] of Integer;
I: Integer;
Iterator: ^Integer; //Pointer to an Integer
begin
A := [1..10];
Iterator := @A; //Points to the first element of A
for I := 0 to High(A) do begin
WriteLn(IntToStr(Iterator^)); //Dereferences the value pointed to
Inc(Iterator); //Increments the memory address, so it points to the next element
end;
end.

Hope that explains a little of what can be done with pointers :)

ssshhhaaa

2012-04-30 09:58:01

The serperate SMART windows idea is awsome!

nokkasiili

2012-04-30 12:48:23

From: Dgby714
There is a native Simba if all your doing is writing a script =P
Tho don't run it unless your in Lape. (with lape srl)


Also Vim and Emacs /troll :f:

Jakkle

2012-04-30 13:09:37

Everything sounds great, moving on well.
Thanks Dev Team for all the work you've put in.
I'm looking forward to the big release of 1.0. :)

Abu

2012-04-30 16:32:04

Ok thanks everyone for the detailed explanations, I'm starting to get the hang of pointers now :p

Thanks again:)

grats

2012-06-07 06:12:53

I donate my mac with teamviewer remote connection to anyone who wants to use it

only thing required is someone with a Mac, basic knowledge of Simba and the willingness and time to learn.


I'm assuming that is basic knowledge of coding simba not coding pascal inside of simba?

Hazzah

2012-06-11 21:17:42

From: Wizzup?

Simba 1.0

While I haven't talked much about Simba 1.0, it's certainly underway. We've been merging most new features into Simba 0.99; so there isn't a lot to report on for Simba 1.0, but the script manager will definitely be in 1.0. We should start a script manager council soon; a group which verifies and pushes scripts to the script manager. :)


This part sounds like it is straight from RSBuddy, but it seems like it would be an amazing feature!