-
Posts
821 -
Joined
-
Last visited
-
Feedback
100%
Posts posted by lisabe96
-
-
You would use a rectangle for that. Something along the lines of:
public static final Rectangle BUTTON_AREA = new Rectangle(413,388,58,70); // (x,y,width,height) @Override public void mouseClicked(MouseEvent event) { int x = event.getX(); int y = event.getY(); if (BUTTON_AREA.contains(x,y)) { powerfishing = !powerfishing; displayImage = powerfishing ? powerImg : normalImg; } } @Override public void mouseMoved(MouseEvent event) { int x = event.getX(); int y = event.getY(); tooltip = BUTTON_AREA.contains(x,y); }
I feel like it's a bit overkill here as I have no other similar situations and only have to check twice.
However you'd be right if you said it's a more proper way of doing it
-
No, you're is checking if "please wait" has already been clicked, and if so try to click continue... You're using the wrong method.
Then what's the right one?
-
public boolean isPendingContinuation() { if (this.inDialogue()) { int IIiiiiIiii = this.IIiiiiIiii(IIiiIiIIII); if (IIiiiiIiii > 0) { if(this.widgets.getWidgetContainingText(IIiiiiIiii, new String[]{"to continue", "please wait..."}) != null) { return true; } return false; } List<RS2Widget> matching = this.widgets.containingText(new String[]{"to continue", "please wait..."}); if (matching != null && !matching.isEmpty()) { IIiiIiIIII.add(Integer.valueOf((matching.get(0)).getRootId())); return true; } } return false; }
Apparently osbot's logic is flawing then because it doesn't work half of the time, while frostbug's solution does all the time
-
IsPendingContinuation() returns true iff it finds "to continue" or "please wait..." so your logic is flawed here.
What do you mean exactly?
-
Sounds like a bug with the continuation method; perhaps the dialogues are different on tutorial island
try something like this instead
List<RS2Widget> diag = getWidgets().containingText("Click here to continue"); if(!diag.isEmpty()) { diag.get(0).interact(); }
It's weird, it sometimes works and sometimes not.
Ill try your solution.
Edit:
Seems to be working this way, thanks!
-
if (script.getDialogues().inDialogue()) { if (script.getDialogues().isPendingContinuation()) { script.getDialogues().clickContinue(); break; } }
When I log the code,
It says that I'm in a dialogue, but not that there's pending continuation.
With other words, I'm stuck as it doesn't continue the dialogue.
Am I missing something?
-
instead of this boolean
if (x > 413 && x < 471 && y > 388 && y < 458) {
you could grab the position of the click. Use the shape of your button and see if the click is within the shape. be sides that your good.
The image is transparent, and I don't want users to have to click inside the fish, that would be a bad
case of UI handling. It has to work when they click the area around it as well.
-
@Override public void onStart() { getBot().addMouseListener(this); try { normalImg = ImageIO.read(new URL("https://i.imgur.com/tXYml3w.png")); powerImg = ImageIO.read(new URL("https://i.imgur.com/LVpXu5C.png")); displayImage = normalImg; } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } @Override public void mouseClicked(MouseEvent event) { int x = event.getX(); int y = event.getY(); if (x > 413 && x < 471 && y > 388 && y < 458) { powerfishing = !powerfishing; displayImage = powerfishing ? powerImg : normalImg; } } @Override public void mouseMoved(MouseEvent event) { int x = event.getX(); int y = event.getY(); tooltip = x > 413 && x < 471 && y > 388 && y < 458; } @Override public void onPaint(Graphics2D graphics) { Graphics2D g = (Graphics2D) graphics; g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF)); if (displayImage != null) { graphics.drawImage(displayImage, 420, 400, null); } if (tooltip) { g.setColor(Color.BLUE); g.drawString("Click to " + (powerfishing ? "disable" : "enable") + " powerfishing.", 311, 15); } }
Got it all working perfectly
Thanks, code posted for people looking for this in the future
-
2
-
-
Drawing a button is of course just g.drawX(...) in onPaint. Next, you basically just implement MouseListener (or extend MouseAdapter) and tell osbot you want to receive mouse events bot.addMouseListener(yourListener). Then you implement mouseClicked(MouseEvent e), e has a property which gives you the location of the click, you can use this to determine if the click was within the bounds of your button.
Oh so it's basically just default java implementation, I was expecting something more complex built into the API.
Thanks I think i can figure it out
-
1
-
-
I think you meant to post this
-
1
-
-
I have only 1 option for the user to chose and it's kinda ridiculous to make a GUI for that,
so I'd like to draw a toggle button to the game screen and handle it when it's clicked by the user.
I have no experience what so ever with this, how would I go about implementing this?
-
-
and i'm telling you it's not lol. think about your parents, they are probably not very techy. they dont know where the hell the startupfolder is or how to locate it, but they might want x program or x file to start when windows boots.
and there are a lot of people that don't know how to locate the windows startup folder, because they simply never heard of it. sure you and i and a lot of people here are understanding with windows, but a lot of people aren't, keep that in mind
Fair enough I guess
-
did you even read the post? i litteraly said that, and that it's so easy, but not everyone knows how to, this program is dedicated to people that dont know a lot about windows
No offense, sure you learned some things and enjoy making stuff without purpose, because so do I.
But if you can't drag a shortcut into a folder you wont be able to use this program either :p
This is uber useless
-
Or just copy shortcut to your windows start-up folder?
-
The latest, 2.4.33
Latest is .36 check main page
-
Simply amazing, not a lot more you can say about this
-
- Fixed an issue where when out of bars it would keep trying to smith anyways.
- Added anti-pattern and pseudo anti-ban options.
- Tweaked some things
- Can be started anywhere, any time (will go get utilities on it's own)
I would love to push this to the SDN but lack the rsgp for a 2 hour proggy
If anybody could help me out with a proggy that'd be great!
-
FYI, in this case. If the interface is null, it's also not visible.
if(w != null) getKeyboard().typeString("5"); else log("Widget not found");
will also work.
Don't kill me when I'm wrong but with isVisible(); I'm assuming it's actually visible on the screen.
This means that the widget might not be null, but because of e.g. lag it's not visible instantly yet.
So checking if it's visible would be a good thing over only checking if it's not null.
-
2
-
-
Smiths any type of bar into items.
Checks for better items on level-up.
Uses the fast & close Varrock West location.
No worries when you were in a rush and forgot to put a hammer in your inventory.
The bot will get it out of your bank for you.
Got different kinds of bars? No problem either, if you toggle "continuation" mode,
the bot auto-switches bars until all the bars in your bank are done.
If you only want to do one type of bar, just use "specific" mode.
Current version: 1.1
Put the downloaded JAR inside "c:\Users\YOUR_USER\osbot\scripts\" and refresh your scripts list in your client.
As always, report any bugs so I can fix them.
If anybody could post a longer proggy that'd be great. I'm too poor for long smithing sessions
-
2
-
-
RS2Widget w = getWidgets().get(162, 31); if (w == null) { log("Widget not found"); break; } if (w.isVisible()) { getKeyboard().typeString("5"); }
Works perfectly, thanks for the help guys
-
No offense, but shouldn't scripter 1 be able to at least know how to use widgets?
Use sure, thinking about it is another thing
As this is dialogue related to me I was thinking dialogues and not widgets.
Will try to get it working with widgets in a bit
-
How would I handle inputting an amount when you click the X-option.
The dialogues class didn't bring me any solution, neither did configs and I don't really know where else to look.
-
the enum is entirely redundant
Not at all as not all banks are in the API and some are a bit off.
But I read that the next API update will have those fixed
Edit: well right now in OP's case it is indeed
RQ Tutorial Island Completer
in Others
Posted · Edited by lisabe96
- Completes tutorial island for you -
- Randomizes character appearance for "less bot like look" -
- Uses webwalking & random interaction choices to avoid patterns -
- Picks up progress anywhere (so you can start the bot at any time) -
- Finished in 7 minutes! -
- Now turns off music! -
Version 2.5
Click here to download!
Place the downloaded jar in "c:\Users\YOUR_USER\osbot\scripts\"
If you find any bugs, please report them so I can fix them.