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

Why doesn't SMART debug stuff like other java bots do?


YoHoJo

2011-05-18 21:37:54

Does SMART have the capability like all other java bots to adtively debug tiles, IDs, Animations, etc of the world around your character?
I just seems like more work to call all of the reflection functions to find the info about the things around you compared to on java bots when you can just toggle on/off certain debugs and just see them right on top the of client. I often just find myself logging into two accounts, one in SMART/SIMBA where I write/test my script, and another in a Java bot with debugs on so I can easily get all of the IDs/Animations/Tiles I need. Can we make it so SMART can do this also? Maybe a plugin or something idk?!

Iamadam

2011-05-18 21:48:51

Benland has said that SMART will never do that intrinsically.
It's possible to write a script to do it though.

YoHoJo

2011-05-18 21:49:27

Well, someone should make a SMART that does? :D It's kind of helpful…

KingKong

2011-05-18 21:49:56

I think there is already something like this in reflection/core/refpaint, it was made by cstrike, theres a thread about it too, but i don't think it has everything that other java bots have.

Flight

2011-05-18 21:55:27

From: KingKong
I think there is already something like this in reflection/core/refpaint, it was made by cstrike, theres a thread about it too, but i don't think it has everything that other java bots have.

Yes, but Smart must be enabled for on-screen painting. Means no using mouse/keyboard.

I agree, this would be very, very helpful. It gets old having to load up a java bot to debug what I need to use in a SRL script.

YoHoJo

2011-05-18 22:16:53

Yeah seems like it should just be an integral part of it, or someone should make something which would work like SMART and be able to do it. It's just a lot easier/efficient to see all the debug right there onscreen.
Hate to be the one crying about it, and I'd try/help do it myself but I have no knowledge on how. I appreciate all of Ben's work and yada yada etc :D.

BenLand100

2011-05-25 12:53:36

From: YoHoJo
Why doesn't SMART debug stuff like other java bots do?


SMART != "Java Bot", problem solved.
But yes, unless you want to have to get a new version of SMART every time the client updates (I, personally, do not have the time to do this) having this functionality built in cannot happen. While I could write a way for people to make graphics callbacks that could be external to the SMART library, I doubt anyone is clever enough to implement something that would use it.

Gu3st...

2011-05-25 13:16:08

From: BenLand100
SMART != "Java Bot", problem solved.
But yes, unless you want to have to get a new version of SMART every time the client updates (I, personally, do not have the time to do this) having this functionality built in cannot happen. While I could write a way for people to make graphics callbacks that could be external to the SMART library, I doubt anyone is clever enough to implement something that would use it.
Can't you add something that searches for the reflection hooks in a folder the user defined, and if it's not found or loginindex = -1 then don't paint? To me it doesn't really seem like there's anything holding you back but laziness / don't care enough to be bothered with minor things like this

BenLand100

2011-05-25 13:27:11

From: Zyt3x
Can't you add something that searches for the reflection hooks in a folder the user defined, and if it's not found or loginindex = -1 then don't paint? To me it doesn't really seem like there's anything holding you back but laziness / don't care enough to be bothered with minor things like this

If it helps you sleep at night, then yes, I am too lazy and don't care enough, however I welcome you to write it yourself. Beyond that, though, there's the issue of it taking more than just a list of hooks to draw things onto the RS screen, and the number of hooks required to do that is non-trivial.

Of course, you seem to have glossed over the more significant statement in that SMART is not a java bot and was not designed to do this.

Gu3st...

2011-05-25 13:36:05

From: BenLand100
If it helps you sleep at night, then yes, I am too lazy and don't care enough, however I welcome you to write it yourself. Beyond that, though, there's the issue of it taking more than just a list of hooks to draw things onto the RS screen, and the number of hooks required to do that is non-trivial.

Of course, you seem to have glossed over the more significant statement in that SMART is not a java bot and was not designed to do this.
I fail to see why java bots are more designed to do this stuff than SMART is

footballjds

2011-05-25 13:41:33

From: Zyt3x
I fail to see why java bots are more designed to do this stuff than SMART is


because the person that designed this didn't design it that way

BenLand100

2011-05-25 13:52:32

From: footballjds
because the person that designed this didn't design it that way

This man is a genius.
From: Zyt3x
I fail to see why java bots are more designed to do this stuff than SMART is

Basically, Java bots have an intrinsically different handling of the graphical end — they don't need the final result and are sufficed to inject directly into the code that renders the client. SMART does not do this, it rather intercepts the drawing commands and duplicates them onto the screen and into the memory for Simba. The debug screen is, at best, a hack I added so people could write to the screen (with the caveat that it will never be as good as they want it to be because SMART's subsystem was not designed to do this). Furthermore, nothing in SMART relies on the client version (SMART can actually run other java applets, but there is no denying that it has a special emphasis on runescape) where as java bots are intimately tied to the internal working of the client, so there is no loss for them to closely integrate with it. SMART, on the other hand, is unique in that it can disintegrate with the client and be stable across many different versions and many major changes. (i.e. I don't have to devote hours each week into keeping it working, which is something I simply do not have the time to do. If I add extra features, people will expect me to maintain them — it was hard enough growing a community to maintain the reflection that is EXTERNAL to smart, much less maintain the internals of SMART itself).

Again, don't grief me for not writing the code if you're not willing/able to do it yourself.

Gu3st...

2011-05-25 15:33:09

From: BenLand100
asically, Java bots have an intrinsically different handling of the graphical end — they don't need the final result and are sufficed to inject directly into the code that renders the client. SMART does not do this, it rather intercepts the drawing commands and duplicates them onto the screen and into the memory for Simba. The debug screen is, at best, a hack I added so people could write to the screen (with the caveat that it will never be as good as they want it to be because SMART's subsystem was not designed to do this). Furthermore, nothing in SMART relies on the client version (SMART can actually run other java applets, but there is no denying that it has a special emphasis on runescape) where as java bots are intimately tied to the internal working of the client, so there is no loss for them to closely integrate with it. SMART, on the other hand, is unique in that it can disintegrate with the client and be stable across many different versions and many major changes. (i.e. I don't have to devote hours each week into keeping it working, which is something I simply do not have the time to do. If I add extra features, people will expect me to maintain them — it was hard enough growing a community to maintain the reflection that is EXTERNAL to smart, much less maintain the internals of SMART itself).

Again, don't grief me for not writing the code if you're not willing/able to do it yourself.
I see… Thanks for explaining it for me :)

Richard

2011-05-25 17:28:56

From: Flight
Yes, but Smart must be enabled for on-screen painting. Means no using mouse/keyboard.

I agree, this would be very, very helpful. It gets old having to load up a java bot to debug what I need to use in a SRL script.


Would it be possible to implement a sort of control panel which controls your player? This way, SMART can stay enabled, you can still "control" your player, and you can have on screen data about items and such. Might be challenging with no multithreading in PS, but surely possible?

Iamadam

2011-05-25 19:05:38

Or you could just enable the debug when you want an id..

Richard

2011-05-25 19:08:03

From: Iamadam
Or you could just enable the debug when you want an id..


Is there a method of returning whether SMART is enabled?

Iamadam

2011-05-25 19:09:17

Eh?
Run a script which paints IDs to screen.
Walk around the area you want.
When you need an ID, click 'enable debug.'

All done :)

Richard

2011-05-25 19:17:33

From: Iamadam
Eh?
Run a script which paints IDs to screen.
Walk around the area you want.
When you need an ID, click 'enable debug.'

All done :)


Would make an awfully crowded screen.
I wouldn't be surprised if it returns an error though, because doesn't disabling SMART change how the canvasing works, and thus the drawing onto the screen? Correct me if I'm wrong.
So if it attempts to draw when SMART is disabled, it might return an exception.

masterBB

2011-05-25 19:25:44

From: Richard
Would make an awfully crowded screen.
I wouldn't be surprised if it returns an error though, because doesn't disabling SMART change how the canvasing works, and thus the drawing onto the screen? Correct me if I'm wrong.
So if it attempts to draw when SMART is disabled, it might return an exception.


No, it doesn't throw an exception. It's just not visible till you enable Smart and Debug.

And your first problem can be resolved with a script like mine Interface debugger. Just use a form with a button when you want to obtain some ids, or want to draw some stuff. That way the screen wouldn't be to crowded.

Flight

2011-05-25 21:54:00

From: Richard
Would it be possible to implement a sort of control panel which controls your player? This way, SMART can stay enabled, you can still "control" your player, and you can have on screen data about items and such. Might be challenging with no multithreading in PS, but surely possible?


I absolutely think that's possible to force user input while Smart's enabled, but I personally don't know how to go about doing so, I've never seen Smart's source. :/ Would it not be possible to make a transparent Smart canvas to print on-screen ID's without having Smart enabled? That's how I'd go about doing it, but I wouldn't know how.

BenLand100

2011-05-25 22:35:16

From: Richard
Is there a method of returning whether SMART is enabled?


SmartIsBlocking(): boolean; //True if smart is "enabled"
SmartSetGraphics(on: boolean) //Turns graphics on/off
SmartSetDebug(on: boolean) //Turns debug canvas on/off

If you all need more methods to access preexisting functionality, I'd be more than happy to add them in. Because of the way drawing is done, currently smart's subsystem must be enabled, but it wouldn't be too hard to make it where debug can be turned on separately. Originally debug was created for on-screen progress reports (before reflection was a big deal), which is why it works the way it does.

Edit: to clarify, it will not return an error, and anything you draw while it is disabled will appear again when you re-enable smart.

Flight

2011-05-25 23:44:38

From: BenLand100
Because of the way drawing is done, currently smart's subsystem must be enabled, but it wouldn't be too hard to make it where debug can be turned on separately.


Would you mind explaining how to do this? I think that's ultimately what we're all requesting anyways.

BenLand100

2011-05-26 00:51:39

From: Flight
Would you mind explaining how to do this? I think that's ultimately what we're all requesting anyways.

It would be easier for me to just do it, I'll see if I have time this weekend. You're welcome to look at the source, though, as I host it on github.

footballjds

2011-05-26 11:39:35

From: BenLand100
If you all need more methods to access preexisting functionality, I'd be more than happy to add them in. Because of the way drawing is done, currently smart's subsystem must be enabled, but it wouldn't be too hard to make it where debug can be turned on separately. Originally debug was created for on-screen progress reports (before reflection was a big deal), which is why it works the way it does..


From: BenLand100
It would be easier for me to just do it, I'll see if I have time this weekend. You're welcome to look at the source, though, as I host it on github.


OMFG, HOLY SHIT
BenLand100 is being nice!
OMFG, haha
<3 youi BenLand100

tom99

2011-05-26 11:57:40

Yea, would be cool you could do that Ben. Might bring us back up to par on features with other java bots.

tom99

2011-05-26 11:59:20

Oops double post, sorry can't find delete button.

Yago

2011-05-26 19:33:43

From: tom99
Oops double post, sorry can't find delete button.


Edit the post then scroll down to delete.