SRL Archive - S.M.A.R.T.

SMARTv7.1


BenLand100

2012-04-29 16:06:25

This is an alpha the official release of v7.1 which offers relatively few changes to SMART itself (from an end user standpoint), but extreme changes to how SMART works behind the scenes. Most notably, SMART can now run outside of Simba's process. Additionally, this allows one Simba process to control multiple SMART clients, and negates the need for an external program to kill/restart SMART. This also removes scheduling problems associated with having the entire JVM running inside the same process as Simba. All in all, this is a good move.

Things to know:

  1. The new libsmart is IDENTICAL to the old libsmart (except for one additional method allowing it to be remotely started), so that, if you desire, you can continue to use the new SMART in the old way. That's not an issue now since libsmart was hardly changed besides bumping the version number and changing the screen title, but it may be in the future.
  2. There are two new binaries for each platform (windows 32bit users need libsmart32.dll, libsmartremote32.dll and smartremote.exe) that facilitate remote usage. Simba no longer interacts with libsmart directly, but rather interacts with libsmartremote, which starts new processes with smartremote, and provides communication.
  3. libsmartremote implements all of the functionality of libsmart under the same names, so programmers won't see a significant change there. There is one caveat to this: because I'm lazy, I didn't implement the reflection methods (though if they make a come back I will implement them).
  4. libsmartremote, like libsmart in v7.0+, implements EIOS that makes targeting SMART much easier, more intuitive, and less hackish.
  5. Remote SMART clients (referred to as clients from here on out) are referenced by their process id (PID) and generate files of the form SMART.PID, where PID is replaced by the numeric representation, in the current directory. This is how the script using libsmartremote (referred to as the controller from here on out) is made aware of existing SMART clients.
How this all works:

  • smartremote takes arguments from the command line when invoked by libsmartremote and starts a new client.
  • The client sets up a file mapped shared memory to transfer the image data and listen for commands
  • A controller can pair with a client if it is unpaired, and maps its shared memory
  • Once a controller is paired to a client, the controller can invoke methods across the shared memory, and read the image data provided by the client in the usual way. If the controller is unpaired, no client specific methods do nothing and return failure values.
All of libsmartremote's methods are the same as libsmart, EXCEPT SmartSetup no longer exists. Below are the methods I have implemented to control, pair with, and create clients.


  • function SmartSpawnClient(remote_path, root, params: string; width, height: integer; initseq, useragent, jvmpath: string; maxmem: integer): integer;
  • This is the new SmartSetup. The arguments are the same, with the addition of remote_path which is the path relative to the current directory to libsmart and smartremote. For Simba this is always './Plugins/'. useragent ,jvmpath, and maxmem produce sane defaults when set to zero length strings (or less than or equal to zero for maxmem). After invoking this method, the controller is automatically paired with the spawned client.
  • function SmartGetClients(only_unpaired: boolean): integer;
  • This tells libsmartremote to search for available clients, and returns the number found. It either searches for all clients or only the unpaired clients depending on the only_unpaired flag.
  • function SmartClientID(idx: integer): integer;
  • After calling SmartGetClients, you can use this method to retrieve the ID of any client found. 0 <= idx < SmartGetClients(true/false);
  • function SmartPairClient(pid: integer): boolean;
  • This pairs the controller to the client identified by pid. If the pairing fails, the function returns false and the controller is left in an unpaired state. On success, the function returns true. Failure is a result of the client being paired or being a zombie (zombies are automatically killed by this function).
  • function SmartKillClient(pid: integer): boolean;
  • This tells the client identified by pid to shutdown. It fails if the client is paired with another controller. After this method is invoked, the controller returns to its previous state unless it was paired with the client that was killed, in which case it is left unpaired. Returns true on success, false on failure.
  • function SmartCurrentClient(): integer;
  • Returns the ID of the client this controller is paired with, or zero if unpaired.
EIOS Usage:
Invoking SetEIOSTarget('libsmartremote',IntToStr(pid)); sets all of Simba's targeted function, e.g. mouse/key/image related methods, to use the client identified by pid. This method fails with an exception if the client doesn't exist, is a zombie, or is paired with another controller. EIOS pairings DO NOT affect the controller's pairing, i.e. EIOS can have client A targeted while the controller has client B targetd. In this case, all Smart* methods will invoke client B while all Simba methods will interact with client A. Using EIOS targeting prevents you from having to manually override methods and is preferred over the old method. It requires a version of Simba that may or may not have been released as stable yet, so be patient.


tl/dr: Example Usage:
Smart runs in it's own process now, and here's an example of how to start it (requires Simba with EIOS support)

[LEFT]program RemoteSmartTest;
{$loadlib libsmartremote}

{**
* Pairs with some client. If force_new is false, it checks
* for running, unpaired clients and attempts to pair with
* one of them. If none of them were pairable (i.e. someone
* beat us to it / it was a zombie) or force_new is true,
* it then creates a new remote SMART client and pairs to it.
* The ID of the newly paired client is returned, or 0 for
* ultimate failure (this would be a serious bug and should
* never happen).
*}
function InitSmart(force_new: boolean): integer;
var
i, count: integer;
begin
if not force_new then
begin
count:= SmartGetClients(true); //Gets a list of the current clients (true->unpaired only)
if count > 0 then
begin
for i:= 0 to count-1 do
begin
result:= SmartClientID(i); //Get the i'th client ID
if SmartPairClient(result) then //Pair with that client
begin
SetEIOSTarget('libsmartremote',IntToStr(result)); //Set the client as the mouse/image target
exit; //Exit on success (could fail if it was a zombie)
end;
//Otherwise, try the next in the list
end;
end;
end;
//Otherwise, start a new chttps://github.com/downloads/BenLand100/SMART/SMARTv7.1alpha3.ziplient (auto pairs)
//These arguments are old, use new ones in practice. Note the jvmpath is for gentoo, it fails on other systems and tries the fallback jvm paths
result:= SmartSpawnClient('./Plugins/','http://world19.runescape.com/',',f5',765,503,'','','/usr/lib/jvm/sun-jre-bin-1.6/lib/amd64/server/libjvm.so',-1);
SetEIOSTarget('libsmartremote',IntToStr(result)); //Set the client as the mouse/image target
end;

var
bmp: integer;
begin
InitSmart(false);
writeln(SmartGetColor(50,50));
writeln(GetColor(50,50));
bmp:= BitmapFromClient(0,0,764,502);
DisplayDebugImgWindow(765,503);
DrawBitmapDebugImg(bmp);
FreeBitmap(bmp);
end.
[/LEFT]
Changelog:
===v7.1alpha4===
+Breaks compatibility with Simba pre 0.99
+All exports -> cdecl for full lape compatibility in Simba >=0.99
+Improved loading efficiency
+Fixed static-linking problems for windows
===v7.1beta===
+Export bugfixes
+Improved stability
+Proper ABI for Simba
===v7.1beta2===
+EIOS compatibility with new Simba (fixes access violation on SendKeys)
===v7.1===
+SendKeys uses the appropriate arguments now across the board

Source: https://github.com/BenLand100/SMART

Binaries: https://github.com/downloads/BenLand100/SMART/SMARTv7.1.zip

Jokester

2012-04-29 16:08:46

I just stopped my script so I can test this out! I am loving these updates recently.

Paradoxium

2012-04-29 16:18:34

sweeeet good work, thanks for the release!

Brandon

2012-04-29 16:28:08

Ahh so if I open task manager I will see a smart process that I can identify smart by? if so will there be one for each client spawned?

And this should make it easier to kill smart/jvm :) :)

So basically its like virtual threading?

If yes to all above then i guess we can do Taskkill /IM "SmartProcessName.dll" Or exe.. something like that.

YoHoJo

2012-04-29 16:35:02

WOW! Awesome release, this is pretty awesome!
So now we can open as many SMARTS from one simba with scripts in different tabs?
And we also have functions to kill/restart SMART during run-time without memory building up?!

WOO WOO!

BenLand100

2012-04-29 16:57:56

From: ggzz
Ahh so if I open task manager I will see a smart process that I can identify smart by? if so will there be one for each client spawned?

And this should make it easier to kill smart/jvm :) :)

So basically its like virtual threading?

If yes to all above then i guess we can do Taskkill /IM "SmartProcessName.dll" Or exe.. something like that.

Yes, each SMART will have it's own process, but I think you're missing the point. The problem has always been that you can't kill the JVM without killing the process; if you don't mind killing the process there's no problem. There is functionality (SmartKillClient) to kill the remote clients already. It's not virtual threading at all, unless you're referring to something that isn't the commonly used meaning for virtual threading, it's simply another process.

From: YoHoJo
WOW! Awesome release, this is pretty awesome!
So now we can open as many SMARTS from one simba with scripts in different tabs?
And we also have functions to kill/restart SMART during run-time without memory building up?!

WOO WOO!

Yes on all counts ;)

Abu

2012-04-29 17:31:57

Wow, Great updates!

Thank you BenLand, can't wait to use :)

i3egoHan

2012-04-29 18:03:43

Does Simba cleanup the seperate SMART process upon terminating the simba process?

BenLand100

2012-04-29 18:06:01

From: i3egoHan
Does Simba cleanup the seperate SMART process upon terminating the simba process?

Nope, they live completely separate from the Simba process. One process can create them and another process can use them, and they do clean themselves when the SMART window is closed.

shstiger2009

2012-04-29 18:13:44

Well, I installed everything and 1 window seems to be working fine.

When I try to open 2 scripts in 1 Simba, however, it closes out the other SMART window when I press play on the 2nd script.

Edit- Dumb mistake by me. Trying to rush through everything.

NCDS

2012-04-29 20:24:39

Awesome updates ben! I've been looking forward to this since reading Wizzup's post about simba updates. :)

Brandon

2012-04-30 19:24:39

Ben when I compile I keep getting "graphicsConfig private access from Java.awt.Canvas.Java"

Wanna tip me what I'm doing wrong? Makefile for windows I changed to G++ and compiled with MSYS using Make Windows.

BenLand100

2012-04-30 20:36:51

Are you using Java 7? It's possible they rewrote part of that class. Use Java 6.

bg5

2012-04-30 22:58:46

Can you help me? I'm still getting:
g++: unrecognized option '-static-libstdc++'
when linking. I used the same way to compile as ggz. I have this error also in older SMART version.

Brandon

2012-05-01 00:09:38

I don't think your compiling the same way as I am.. I don't use static and I don't use stdlibg++ anywhere.
Makefile Edit:

WIN_GPP=g++
WIN64_GPP=g++
LIN_GPP=i686-pc-linux-gnu-g++
LIN64_GPP=x86_64-pc-linux-gnu-g++
JAVAC=javac
JAVA=java
Open Msys and cd to the root of the smart folder.. Type: Make clean everything
Press Enter.
Check the Dist folder in the root of the smart folder.


@Ben your probably too busy to update it so I tried myself and I actually need Java 7 (not sure if anyone else does). I failed but yeah this is what I tried below..
It compiles in older version of Java but I need Java 7 to run other applications. It's also faster than 6 by a noticeable amount for other apps. Not sure how much faster it is for smart. I tried re-writing the canvas class so that it uses:


public Canvas() {
}

public Canvas(GraphicsConfiguration config) {
this();
setGraphicsConfiguration(config);
}

@Override
void setGraphicsConfiguration(GraphicsConfiguration gc) {
synchronized(getTreeLock()) {
CanvasPeer peer = (CanvasPeer)getPeer();
if (peer != null) {
gc = peer.getAppropriateGraphicsConfiguration(gc);
}
super.setGraphicsConfiguration(gc);
}
}
but that just makes smart keep disabling and re-enabling itself every refresh. I couldn't find where it was doing this in the Client.java at all. The above code is bad when smart destructs since it can't find Canvas: 0. Lol I failed I guess. Any tips where I need to look?

Source: http://www.docjar.org/html/api/java/awt/Canvas.java.html

Other than that Java 6 compiles it fine using MSys with Mingw.

BenLand100

2012-05-01 00:48:23

From: beginner5
Can you help me? I'm still getting:
g++: unrecognized option '-static-libstdc++'
when linking. I used the same way to compile as ggz. I have this error also in older SMART version.

Probably an ancient version of g++. If you don't link statically it won't run properly on windows. I'm using 4.5.3-r2. Run `g++ –version` to check your version.

That being said, to both of you, you don't have to compile it to use it, I provided binaries -.- SMART is difficult to compile without a properly setup environment, and unless you're running gentoo, a proper environment is difficult, at best, to setup.

I might try compiling it with java7 eventually, but as you might have noticed, SMART relies on the way the Canvas class is written in java6.

bg5

2012-05-01 10:20:19

I don't think your compiling the same way as I am.. I don't use static and I don't use stdlibg++ anywhere.
Makefile Edit:


stdlibg++ is in make for windows32 ,did you delete it from makefile?
https://github.com/BenLand100/SMART/blob/master/Makefile#L294

Probably an ancient version of g++. If you don't link statically it won't run properly on windows. I'm using 4.5.3-r2. Run `g++ –version` to check your version.

4.6.2
Btw. it links -static-libgcc properly but crash at stdlibg++

@Edit

I believe I found solution:
http://ubuntuforums.org/showthread.php?p=11538725
So i deleted -static-libstdc++ from makefile ,If I'm right in my version it's added automatically ,whe compiler see -static-libgcc.
But anyway I can't build .dll because of another error:

nokkasiili

2012-05-01 10:27:44

I managed compile this fine.
Some problems that i occured:
-unistd.h was not included (unlink,close,usleep…) in Remote.cpp
-there was two declaration of std_killClient

BenLand100

2012-05-01 15:06:16

From: nokkasiili
I managed compile this fine.
Some problems that i occured:
-unistd.h was not included (unlink,close,usleep…) in Remote.cpp
-there was two declaration of std_killClient

unistd.h isn't pulled in by fcntl.h on your system? weird, I'll add it in. Also, for the std_killClient, I updated the method without updating the header. I'll fix that too.

From: beginner5

I believe I found solution:
http://ubuntuforums.org/showthread.php?p=11538725
So i deleted -static-libstdc++ from makefile ,If I'm right in my version it's added automatically ,whe compiler see -static-libgcc.
But anyway I can't build .dll because of another error:

Well, it was either an ancient version of g++ or a bleeding edge version. 4.6.2 isn't marked stable in gentoo yet so I'm not going to bother with working with it. BTW those linking errors are because it's not static linking that library. I'd suggest downgrading unless you absolutely need 4.6.2 for something, clearly there's still some problems.

bg5

2012-05-01 15:11:14

BTW those linking errors are because it's not static linking that library. I'd suggest downgrading unless you absolutely need 4.6.2 for something, clearly there's still some problems.

Thx ,I will try downgrading to 4.5.3

Flight

2012-05-01 23:21:35

I must be missing something here, as I always have an access violation error at this line:

result:= SmartSpawnClient('./Plugins/','http://world19.runescape.com/',',f5',765,503,'','','/usr/lib/jvm/sun-jre-bin-1.6/lib/amd64/server/libjvm.so',-1);

I'm guessing something to do with the JVM path, but I've never dealt with that before so I've no idea how to find & set it, ect…

BenLand100

2012-05-02 00:57:21

From: Flight
I must be missing something here, as I always have an access violation error at this line:
Simba Code:
[LEFT]result:= SmartSpawnClient('./Plugins/','http://world19.runescape.com/',',f5',765,503,'','','/usr/lib/jvm/sun-jre-bin-1.6/lib/amd64/server/libjvm.so',-1);
[/LEFT]


I'm guessing something to do with the JVM path, but I've never dealt with that before so I've no idea how to find & set it, ect…

Could you get the console output before it happens?

Flight

2012-05-02 02:00:13


I didn't post it previous because it doesn't look like much could be gathered from what the debug window was printing. Something else, also I'll get a regular windows popup box saying that "smartremote32.exe has stopped working"; dunno if that matters or not.

Would it matter where I extracted your zipped binaries? I just put everything inside the main Plugins folder in Simba.

BenLand100

2012-05-02 11:35:22

From: Flight

I didn't post it previous because it doesn't look like much could be gathered from what the debug window was printing. Something else, also I'll get a regular windows popup box saying that "smartremote32.exe has stopped working"; dunno if that matters or not.

Would it matter where I extracted your zipped binaries? I just put everything inside the main Plugins folder in Simba.

Well, the remote end died and never made the shared memory for some reason. It's a shame the remote output doesn't show up in windows, I might have to build a debug version… What windows version is this? It might be a file permission problem; SMART needs to be able to create a file in the current directory.

Flight

2012-05-02 12:05:54

From: BenLand100
Well, the remote end died and never made the shared memory for some reason. It's a shame the remote output doesn't show up in windows, I might have to build a debug version… What windows version is this? It might be a file permission problem; SMART needs to be able to create a file in the current directory.


Ok yeah that makes sense, I'll check around with file permissions and see what I come up with. Windows 7, I believe win32… After trying to run your example script and the access violation error a temporary file was made in the main Simba directory, one file for each time I tried running the script. Between 3 and 4 mb in size. I imagine this was the product of a RS client being loaded? After having closed out Simba all of these temporary files were automatically deleted.

Again I dunno if this info is useful to you or not, I'm just trying to give as many details as I can.

BenLand100

2012-05-02 14:56:52

The temp files were like SMART.### right? Those are the shared memory files that the remote client creates that allows the local client to communicate. For some reason it's unable to locate/read them. And yes, it's 32 bit judging by the fact that it loaded the 32 bit remote. If you want to really debug this, go to the simba directory in a command line, and run:

Plugins/smartremote32.exe "./Plugins/" "http://world19.runescape.com/" ",f5" "765" "503" "" "" "" ""
And that will hopefully start the remote end so that you can see the debug output.
E: If it does nothing, then I gave you the wrong number of arguments. Should work, though.

Flight

2012-05-02 20:14:34

So I ran it through the command prompt and basically had the same problem. This time I included the 'crash details' according to Windows.


It says the fault module name is msvcrt.dll; perhaps it has something to do with that dll?

BenLand100

2012-05-03 02:34:50

yea msvcrt is microsoft studio visual c runtime. Something failed in the runtime, meaning a system call failed along the way. Since it says the shared memory was mapped to zero, i know the mapping failed. You said it created files and they had a 4-3 mb size? That means it created the file fine but couldn't map it, here:
memmap = CreateFileMapping(file,NULL,PAGE_EXECUTE_READWRITE,0,sizeof(shm_data)+4*2*width*height,shmfile);
Since the file exists and has a size, it must be the execute flag. I'll mod a version and upload alpha2 in a bit.
E: See first post for link

Flight

2012-05-03 03:33:39

Alrighty, downloaded that alpha2 and ran your example script. I still have an access violation error at the same line (SmartSpawnClient) but no Windows pop up of a dll crash, so there's a plus. :P

It did load up a new Smart Client even after the error. The debug says the Memory was mapped to 0x3c, JVM path set correct, and everything else displayed like normal.

After a Smart client was spawned I tried running the test script again (or any script with your new 'InitSmart') and I got an access violation error at line 20:

count:= SmartGetClients(true);

Maybe it's something I'm doing wrong on my end? Also thanks a ton for all the help Ben, I do appreciate it.

BenLand100

2012-05-03 11:21:52

What's the debug on the local (simba) side before the first access violation? It sounds like it might be failing to map the memory there also, could be the same bug lol.
E: That's probably the case, I forgot I mapped memory there too. Uploading alpha3 on first post
E2: I also added some sanity checks to make sure it doesn't segfault on failure, at least. Debug around sensitive areas should be better also, in the event of a problem.

mormonman

2012-05-07 23:34:36

Getting errors still. It loaded good, but it error at SetEIOSTarget(), so I ran it again, and it got a different error at SmartGetClients().

BenLand100

2012-05-08 13:15:37

Looks like it must have had some problem opening the file… I'll look into it.

Bixby Sayz

2012-05-08 18:15:26

Is it possible to adjust SMART's fps slider from within a script?

Wizzup?

2012-05-08 18:29:34

From: Bixby Sayz
Is it possible to adjust SMART's fps slider from within a script?


SmartSetFPS? (not sure if it actually exists)

Brandon

2012-05-08 18:38:59

From: Wizzup?
SmartSetFPS? (not sure if it actually exists)


SmartSetRefresh(100);

Max val = 100.. Min = 1
100 = to the very top. 1 = very bottom.

BenLand100

2012-05-15 20:48:00

Committed and uploaded v7.1alpha4. Breaks all compatibility with Simba version pre 0.99 (today's build)

mormonman

2012-05-15 21:24:48

Instantly crashes simba now.

Right when it tries to load the plugin.
http://i.imgur.com/KYLeB.png

BenLand100

2012-05-15 21:27:27

From: mormonman
Instantly crashes simba now.

What version of simba? inb4not0.99
Or more specifically, you need an 0.99 built today or later
Also this only works with lape. Hopefully I'm not starting a rumor, but pascalscript is going to be removed soon anyway

mormonman

2012-05-15 22:14:36

From: BenLand100
What version of simba? inb4not0.99
Or more specifically, you need an 0.99 built today or later
Also this only works with lape. Hopefully I'm not starting a rumor, but pascalscript is going to be removed soon anyway


you should have mentioned the lape part. :)

mormonman

2012-05-16 00:20:23

Now I get an access error on starting the script:

BenLand100

2012-05-16 00:38:10

Fixed mormonman's issue. another EXECUTE flag unneeded. Should be good now, redownload if you downloaded before this post.

Wizzup?

2012-05-16 09:02:02

Mormonman, Simba 0.99-rc5 is not recent enough. You need the very latest from l0.lt. http://l0.lt/builders/master

You also need the libffi.dll as mentioned on the Simba 0.99-rc5 release thread. (for lape)

As for PS with latest smart, it SHOULD work, I'll test this when I get home.

mormonman

2012-05-16 15:26:23

From: Wizzup?
Mormonman, Simba 0.99-rc5 is not recent enough. You need the very latest from l0.lt. http://l0.lt/builders/master

You also need the libffi.dll as mentioned on the Simba 0.99-rc5 release thread. (for lape)

As for PS with latest smart, it SHOULD work, I'll test this when I get home.


That's when it finally started working.

BenLand100

2012-05-25 15:55:39

So, I'm assuming people have tested this a bit. Does anyone still have problems / major bugs / feature requests / concerns? I'd like to have it stable for the 0.99 release, whenever that is.

BenLand100

2012-05-28 19:00:00

alpha4 -> beta
Will release as stable once Simba 0.99 releases.

John

2012-05-28 19:59:22

Small request, Could you maybe change the look of it,
And i think YohHoJo posted some where about a static loading URL?
Could we some how randomize it?

BenLand100

2012-05-28 20:07:02

From: John
Small request, Could you maybe change the look of it,
And i think YohHoJo posted some where about a static loading URL?
Could we some how randomize it?

You'll have to actually give some details for me to answer that first bit.
As far as the loading URL goes, that is ALL on the SRL side of things. I've been not-so-subtly hinting that the way SRL does it now is blatantly wrong, but no one has really taken any initiative to fix it.

BenLand100

2012-05-30 20:37:55

beta2 fixes an access violation for SendKeys when using EIOS. Should be completely stable now. again, official release with 0.99 Simba

AND NOW the official release. Just waiting for Wizzup to release Simba 0.99

Brandon

2012-06-02 21:17:16

From: BenLand100
beta2 fixes an access violation for SendKeys when using EIOS. Should be completely stable now. again, official release with 0.99 Simba

AND NOW the official release. Just waiting for Wizzup to release Simba 0.99



The follow output is in the console when smart fails to load.. This causes it to stay loading forever!! Only happens after calling SmartSpawnClient('./Plugins/', Params[0], ',' + Params[1], 765, 503, 's', '', '', -1);

I've used the script you have on the first post except I pass the correct parameters to it. I check the parameters everytime so I know it's correct.


Other Thread: Thread[Thread-15,1,main]
Other Thread: Thread[Thread-16,1,main]
Runtime Garbage Collection Invoked
Plugin libsmartremote32 already loaded: 2
The DLL "libsmartremote" doesn't set a memory manager.
Plugin irokiplugin already loaded: 0
The DLL "irokiplugin" doesn't set a memory manager.
formWriteln: Compiled successfully in 1045 ms.
formWriteln: SRL Compiled in 0 msec
Failed to pair - No client by that ID
Plugin libsmartremote32 already loaded: 0
Plugin libsmartremote32 already loaded: 0
EIOS Paired
Incrementing pairing refcount
EIOS requested image buffer
How it was fixed was stupid.. I forcefully terminated the script you have on the original post. When I do that, and run it again, it works and displays the following

formWriteln: The following DTMs were not freed: [SRL - Lamp bitmap, 1]
formWriteln: The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admi
n bitmap, SRL - Flag bitmap]
EIOS Unpaired
Plugin libsmartremote32 already loaded: 2
The DLL "libsmartremote" doesn't set a memory manager.
Plugin irokiplugin already loaded: 0
The DLL "irokiplugin" doesn't set a memory manager.
formWriteln: Compiled successfully in 1092 ms.
formWriteln: SRL Compiled in 0 msec
./Plugins/smartremote32.exe
Shared Memory mapped to 0x4c
Running SMART Constructor
SMART Initialized!
Library: 0x6c780000
SmartSetup Entered
Attempting to load default server JVM
Attempting to load default client JVM
Created a Java Runtime Environment object
reading decrypting defining: smart/Client$4 = 0x22688b8
reading decrypting defining: smart/Client$3 = 0x22688bc
reading decrypting defining: smart/Client = 0x22688c0
reading decrypting defining: smart/EventNazi = 0x22688c4
reading decrypting defining: smart/UnblockedEvent = 0x22688c8
reading decrypting defining: smart/EventRedirect = 0x22688cc
reading decrypting defining: java/awt/Canvas$AccessibleAWTCanvas = 0x22688d0
reading decrypting defining: smart/EventNazi$KeySender = 0x22688d4
reading decrypting defining: smart/Client$1 = 0x22688d8
reading decrypting defining: smart/Client$2 = 0x22688dc
reading decrypting defining: java/awt/Canvas = 0x22688e0
reading decrypting defining: smart/ClientStub = 0x22688e4
reading decrypting defining: smart/BlockingEventQueue = 0x22688e8
Classes unpacked, loaded, and reflected
Using preallocated image swap area(s)
Registration Response: 168
JVM Garbage Collection Invoked
Java Initilized - SMART Starting
Applet Loader Parsed
Using jar: http://world63.runescape.com/gamepack9+QoRyo1Dqwn8uK50jcjeNg9PZT1YuTI
_581578.jar
Applet Parameters Forwarded
Setting up Frame
Client INIT
GET PARAM: 0=>IjGJjn4L3q5lRpOR9ClzZQ
GET PARAM: -1=>QlwePyRU5GcnAn1lr035ag
GET PARAM: 30=>false
GET PARAM: 20=>lobby4.runescape.com
GET PARAM: 4=>1103
GET PARAM: 6=>0
GET PARAM: 25=>-1368233968
GET PARAM: 32=>2305889253677765860
GET PARAM: 15=>wwGlrZHF5gKN6D3mDdihco3oPeYN2KFybL9hUUFqOvk
GET PARAM: 8=>.runescape.com
GET PARAM: 22=>false
GET PARAM: 10=>null
GET PARAM: 23=>false
GET PARAM: 11=>true
GET PARAM: 2=>
GET PARAM: 13=>0
GET PARAM: 1=>0
GET PARAM: 26=>0
GET PARAM: 24=>true,false,0,43,200,18,0,21,354,-15,Verdana,11,0xF4ECE9,candy_bar
_middle.gif,candy_bar_back.gif,candy_bar_outline_left.gif,candy_bar_outline_righ
t.gif,candy_bar_outline_top.gif,candy_bar_outline_bottom.gif,loadbar_body_left.g
if,loadbar_body_right.gif,loadbar_body_fill.gif,6
GET PARAM: 12=>true
GET PARAM: 33=>
GET PARAM: 28=>0
GET PARAM: 7=>null
GET PARAM: 3=>9+QoRyo1Dqwn8uK50jcjeNg9PZT1YuTI
GET PARAM: 21=>63
GET PARAM: 29=>
GET PARAM: 27=>0
GET PARAM: 31=>null
GET PARAM: 16=>false
GET PARAM: 17=>false
GET PARAM: 9=>38
GET PARAM: 14=>
GET PARAM: 18=>false
GET PARAM: 5=>47274
Client START
Client WAITING
Client Fully Initialized
Loading plugin LibSmartRemote32 at C:\Simba\Plugins\
Plugin LibSmartRemote32 already loaded: 1
EIOS Paired
Incrementing pairing refcount
EIOS requested image buffer
formWriteln: Please Wait.. Smart Is Currently Loading..
Replacing Canvas Drawing Surface
Disabeling Events
Starting Image Transfer
SMART Enabled
Init Sequence Dispatched
Transfer Thread Entered
SMART Disabled
Replacing Canvas Drawing Surface
Disabeling Events
Starting Image Transfer
SMART Enabled
Transfer Thread Entered
formWriteln: Successfully executed.
EIOS Unpaired
Paired thread terminated: reset
Then at other times it displays:

Plugin libsmartremote32 already loaded: 0
Plugin irokiplugin already loaded: 1
Plugin libsmartremote32 already loaded: 0
The DLL "libsmartremote" doesn't set a memory manager.
Plugin irokiplugin already loaded: 1
The DLL "irokiplugin" doesn't set a memory manager.
formWriteln: Compiled successfully in 1046 ms.
formWriteln: SRL Compiled in 15 msec
./Plugins/smartremote32.exe
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
Failed to pair - No client by that ID
formWriteln: Successfully executed.

BenLand100

2012-06-03 01:39:53

Uhh, idk what you're trying to tell me. It looks like it paired to an existing client in the first one, in the second one it spawned a new client, and in the third one it failed to load RS. I've heard that RS is being a little unstable atm, so maybe try again tomorrow.

Edit: It's worth noting that the remote implementation should fail and return if it's unable to pair in a timely manner, it's probably something script side that keeps it going forever.

Flight

2012-06-03 02:17:30

Well it works just fine for me, although I've not tried it with multiple SMARTs opened up. Is that what you were testing, Brandon?

Also, one must remove SRL's SMART-loader from SetupSRL();. Is it just me or are the client parameters different as well?

mormonman

2012-06-03 02:26:18

From: Flight
Well it works just fine for me, although I've not tried it with multiple SMARTs opened up. Is that what you were testing, Brandon?

Also, one must remove SRL's SMART-loader from SetupSRL();. Is it just me or are the client parameters different as well?


Read whole thread….

Brandon

2012-06-05 21:28:22

Don't know where to post this..

Problem:
if I include Misc/Smart.Simba, the function takes way longer to return true.

Solution:
opened Misc/Smart.Simba and commented out "GetColor(X, Y): Integer" Function and it was faster than ever.

Why is this? I'm not the only one this is happening to. Happening to Ashaman as well.

Oh and I also filed an issue on your github that SmartGetDebugDC is missing from LibSmartRemote..


This is what I'm running..

{$I SRL/SRL/Misc/Smart.Simba} //Edited to load LibSmartRemote32.dll
{$I SRL/SRL.Simba}

Function GetSmartParams: TStringArray;
var
Params: TStringArray;
Page: String;
begin
Page := Between('<iframe id="game" src="', '"', GetPage('http://www.runescape.com/game.ws?j=1'));
Params := Explode(',', Page);
Result := Params;
end;

function InitSmart(force_new: boolean): integer;
var
i, count: integer;
Params: TStringArray;
begin
if not force_new then
begin
count:= SmartGetClients(true);
if count > 0 then
begin
for i:= 0 to count-1 do
begin
result:= SmartClientID(i);
if SmartPairClient(result) then
begin
SetEIOSTarget('libsmartremote',IntToStr(result));
exit;
end;
end;
end;
end;

Params:= GetSmartParams;
result:= SmartSpawnClient('./Plugins/', Params[0], Params[1], 765, 503, '', '', '', -1);
SetEIOSTarget('libsmartremote',IntToStr(result));
end;

Function ItemCount: Integer;
var
I: Integer;
begin
For I:= 1 To 28 Do
writeln(ExistsItem(I));
end;

begin
InitSmart(FALSE);

Repeat
ItemCount;
Until(False);
end.

Ashaman88

2012-06-05 22:36:26

+1 same as brandon.

When I don't have the function commented out, certain functions take wayyyy longer. For example detecting inventory is full in our LRC miner was taking a good 6-7 seconds and in Smurgs herb script, it was taking almost 10 seconds to realize bank screen was open.

Comment out that function and it all works even faster than 6.9

BenLand100

2012-06-05 23:22:35

If getColor is slow while using EIOS then the problem is in Simba, because it should just be returning the value in the array locally. File a bug report with Wizzup's Simba git and hopefully get it looked at before 0.99 released.

Brandon

2012-06-05 23:30:53

From: BenLand100
If getColor is slow while using EIOS then the problem is in Simba, because it should just be returning the value in the array locally. File a bug report with Wizzup's Simba git and hopefully get it looked at before 0.99 released.



KK I'll go do that now but what about: https://github.com/BenLand100/SMART/issues/6

That's the SmartGetDebugDC.. Can't draw on smart without it or is there another way?

WeeJazzah

2012-06-06 06:09:25

I'm a noob at this stuff but can i get any help on where to place these files?

Wizzup?

2012-06-06 08:00:55

From: BenLand100
If getColor is slow while using EIOS then the problem is in Simba, because it should just be returning the value in the array locally. File a bug report with Wizzup's Simba git and hopefully get it looked at before 0.99 released.


I doubt there's a problem in Simba. Isn't the whole point of EIOS that they no longer need wrappers around SMART functions? For example, GetColor override should ALWAYS be commented out when using EIOS; the script should just let Simba do what it does best and just provide it with an EIOS target.

Ezio Auditore da Firenze

2012-06-06 08:37:39

Damn, my Smart wont work I've loaded Runescape up with its own client, and it works there, but when I switch to Smart I get "Runescape has been updated! Please reload this page." Even though I've done it four times.

Fixed: Cleared cache, reloaded with rs client, and changed Smart_Server numbers.

BenLand100

2012-06-06 11:16:24

From: Brandon
KK I'll go do that now but what about: https://github.com/BenLand100/SMART/issues/6

That's the SmartGetDebugDC.. Can't draw on smart without it or is there another way?

Okay, I just assumed you had read the first post, but I guess that wasn't clearly a priority. As wizzup mentioned there is no longer any need for any wrapper functions or overrides when using EIOS (if you're using 7.1, you should be using EIOS). So, remove those. I.E. you don't need smart.simba anymore.

As far as your bug report, check your bug report, I commented on it. The whole point of posting them there is so I can be notified when people comment on them and not have to check back here (which I'm prone not to do). Be patient, I'm a busy person, and right now I'm at a conference in Anaheim so I don't have much time for deving SMART.

Flight

2012-06-08 22:07:00

From: BenLand100
You'll have to actually give some details for me to answer that first bit.
As far as the loading URL goes, that is ALL on the SRL side of things. I've been not-so-subtly hinting that the way SRL does it now is blatantly wrong, but no one has really taken any initiative to fix it.


I wonder could we not just remove the actual loading of SMART from SRL (while keeping the override functions/procedures) and have it loaded (with your example InitSmart) in the script itself? That's what I've had to do but it's a bit annoying having to disable SMART loading in SRL after each SRL update.

Brandon

2012-06-08 22:55:51

From: Flight
I wonder could we not just remove the actual loading of SMART from SRL (while keeping the override functions/procedures) and have it loaded (with your example InitSmart) in the script itself? That's what I've had to do but it's a bit annoying having to disable SMART loading in SRL after each SRL update.



SRL:
https://github.com/SRL/SRL-5/pull/46

Simba:
https://github.com/MerlijnWajer/Simba/issues/117

Join in and help if you can or want to.

krypto100

2012-06-11 22:54:27

damn it
:mad:smart 7.1 doesnt support windows 8:mad:

BenLand100

2012-06-11 23:18:12

Umm. There's no reason it shouldn't

Shatterhand

2012-06-18 09:10:53

How can I run more SMART per simba? I get this error when starting the second script.
MakeScreenShot(ScreenShotsPath + 'levelups\');

EDIT: It doesnt want to open new SMART, it starts the second script on the opened SMART.

BenLand100

2012-06-18 19:33:45

From: Shatterhand
How can I run more SMART per simba? I get this error when starting the second script.

EDIT: It doesnt want to open new SMART, it starts the second script on the opened SMART.

SMART doesn't open itself; clearly you're doing something wrong. You need to spawn a new client and pair to it.

Shatterhand

2012-06-19 02:33:40

From: BenLand100
SMART doesn't open itself; clearly you're doing something wrong. You need to spawn a new client and pair to it.

Ive got that simple smart setup in all of my scripts.
Maybe the problem is that these smarts must be different? I mean the server, members etc.
Or do I need a different simba version for it? Ive got 990.

Brandon

2012-06-19 03:26:16

From: Shatterhand
Ive got that simple smart setup in all of my scripts.
Maybe the problem is that these smarts must be different? I mean the server, members etc.
Or do I need a different simba version for it? Ive got 990.


Doesn't work that way anymore. You have to use what he has on the first post or wait on SRL to update.

LibSmart can work that way but not LibSmartRemote.