Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Debug functions #1

Closed
GigiaJ opened this issue Jul 4, 2019 · 15 comments · Fixed by #35 or #36
Closed

[BUG] Debug functions #1

GigiaJ opened this issue Jul 4, 2019 · 15 comments · Fixed by #35 or #36
Assignees
Labels
bug Denotes that this a bug high priority high priority, needs to be done soon normal important or causing difficulty to utilize a feature
Milestone

Comments

@GigiaJ
Copy link
Collaborator

GigiaJ commented Jul 4, 2019

The bot debug classes all fail to work correctly. Likely requiring the client panel and such to be drawn and assigned appropriately.

@GigiaJ GigiaJ added normal important or causing difficulty to utilize a feature bug Denotes that this a bug labels Jul 4, 2019
@GigiaJ GigiaJ self-assigned this Jul 4, 2019
@GigiaJ GigiaJ added the low priority low priority, not important or not an important feature label Jul 25, 2019
@vuurman100
Copy link

Any update about this? trying to make a new gui, but cant find anyway to attach to the paint to the botpanel. same for the paint for on scripts

@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Mar 29, 2020

I'm pretty sure the debug is attached here, but it has been a bit so I forget as to why they're non-functional. I believe it is due to the bot not actually performing the rendering, but I'm certain if that is the case it is FAIRLY easy to work around.
private static String[] constructDebugs() { List<String> debugItems = new ArrayList<String>(); debugItems.add("Hide Toolbar"); debugItems.add("Hide Log Window"); debugItems.add("All Debugging"); debugItems.add("-"); for (String key : DEBUG_MAP.keySet()) { Class<?> el = DEBUG_MAP.get(key); if (PaintListener.class.isAssignableFrom(el)) { debugItems.add(key); } }

Edit: This is simply where the debugs are loaded on, but that doesnt exactly help you.

To clarify, the bot is currently rendering using however RuneLite is doing it. This is because I simply didnt take the time to hook (for lack of a better word) into that and create a fluid way for the API to interact with it. It should be possible to do so, and I will take a go at it tomorrow.

@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Mar 30, 2020

Okay, so while testing this I came across a far more debilitating issue that prevents me from testing further. Scripts currently don't seem to do anything. This includes painting.
I did, however, manage to interact with the client and draw text on it, but since scripts are so broken I couldn't really look further into that.

@vuurman100
Copy link

How did ya draw text to it?
and what do you mean with scripts are broke? havent test much but seems like i can interact with npcs. only like you mention before the turnTo is broke

@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Mar 30, 2020

You're getting scripts made in the testsScript to work and interact with npcs?
As for drawing, I simply called upon the client canvas (can't test in scripts because they don't seem to be working) and directly drew on top of it. Not the best way to go about it and if I can get the scripts functional I'll try adding cleaner solution.

@vuurman100
Copy link

yeay can load script from the testScript folder also .jar and .classes are working for me. interact works, beside that it click to walls ect because the the turnto and onscreen dont work as you know.

but having no problems with loading scripts.

@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Mar 30, 2020

Alright, weirdly enough. Scripts seem to be working, but I have to start the script to login, and then stop it and restart for it to actually execute. That said, I tested whether the script could interact with the panels and client and that seemed to work so after I figure out why the script behaves like that I'll try to make a cleaner solution for drawing on the client.

@GigiaJ GigiaJ added high priority high priority, needs to be done soon and removed low priority low priority, not important or not an important feature labels Mar 30, 2020
@vuurman100
Copy link

good to hear its working for you, would love to see a solution for drawing the debug options.

@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Mar 30, 2020

image

I've managed to get drawing on the screen and tested the FPS function (it isn't properly implemented yet). I'll clean this tidbit up as well as I can and integrate the debug functions properly.
Consistent drawing that refreshes with the client so it is synced

@vuurman100
Copy link

Nice work, cant wait for it so i can at least see my mouse position. and if the debugger works it will make it more easy to rewrite the api, have the feeling the is much changed in the past months

@GigiaJ GigiaJ linked a pull request Mar 31, 2020 that will close this issue
@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Mar 31, 2020

image

Not completely finished, as I believe some debug functions are still a little broken. Several are working though.

Additionally,

This should allow one to create a new listener in a script and add it to the EventManager to draw directly to the screen.

You in theory should be able to draw on the screen with a script doing that.

@vuurman100
Copy link

You are really doing a great job, will try get used to github. so i can make changes also and send pull.

@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Apr 1, 2020

Thanks! Take your time getting used to it and feel free to make changes and pull requests whenever.
I'll certainly appreciate any help I get on this. :)

I've fixed all the TextEvent debug functions. The PaintEvent ones rely on Calculations which appear to be wrong. Hopefully I'll have that fixed soon as well.

@GigiaJ GigiaJ linked a pull request Apr 1, 2020 that will close this issue
@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Apr 1, 2020

All debugs work excluding models, webs, and calc test.
Only models and calc test will cause issues currently.

Mouse can still not be enabled or disable and any debug utilizing models will be broken for now.
Shouldn't affect much, but models won't be outlined.
Hopefully can finish up tomorrow.

@GigiaJ GigiaJ added this to the v1.0.0 milestone Apr 4, 2020
@GigiaJ GigiaJ changed the title Debug functions [BUG] Debug functions Apr 4, 2020
@GigiaJ
Copy link
Collaborator Author

GigiaJ commented Apr 14, 2020

Closed due to changes in GUI, since most were fixed and the GUI is being moved away from this isn't needed anymore.

@GigiaJ GigiaJ closed this as completed Apr 14, 2020
dginovker pushed a commit that referenced this issue Mar 16, 2022
Merge pull request #134 from myzsqn/master
GigiaJ added a commit that referenced this issue Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Denotes that this a bug high priority high priority, needs to be done soon normal important or causing difficulty to utilize a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants