| Lots of errors | |
|
|
Author | Message |
---|
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Lots of errors Fri Mar 11, 2011 2:59 pm | |
| So I'm not so used to RSBuddy scripting, more for Powerbot. When I run my script with -dev, I get these errors: My code is available here. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Fri Mar 11, 2011 3:03 pm | |
| Usually the top error will contain a line of your script which has a problem. One thing I noticed looking at your onStart method was that you call your GUI twice. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Fri Mar 11, 2011 3:11 pm | |
| - b0xb0x wrote:
- Usually the top error will contain a line of your script which has a problem.
One thing I noticed looking at your onStart method was that you call your GUI twice. Yes, that worked. Thanks!!! | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Fri Mar 11, 2011 5:17 pm | |
| - b0xb0x wrote:
- Usually the top error will contain a line of your script which has a problem.
One thing I noticed looking at your onStart method was that you call your GUI twice. That worked, but when I run it, it shows my GUI. Then, I hit "Begin", and the GUI shows up again. I hit "Begin" once more and RSBuddy closes. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Fri Mar 11, 2011 5:19 pm | |
| - Remo wrote:
- b0xb0x wrote:
- Usually the top error will contain a line of your script which has a problem.
One thing I noticed looking at your onStart method was that you call your GUI twice. That worked, but when I run it, it shows my GUI. Then, I hit "Begin", and the GUI shows up again. I hit "Begin" once more and RSBuddy closes. Hmm. Post your code. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Fri Mar 11, 2011 5:26 pm | |
| - Remo wrote:
- So I'm not so used to RSBuddy scripting, more for Powerbot. When I run my script with -dev, I get these errors:
My code is available here. There's my code. I've tried changing the startButton actionPerformed to this.dispose();, System.exit(0);, dispose();, none work. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Fri Mar 11, 2011 5:41 pm | |
| You are initializing the GUI twice. Remove your second GUI call. Once you do that, try it again. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Fri Mar 11, 2011 5:51 pm | |
| - b0xb0x wrote:
- You are initializing the GUI twice. Remove your second GUI call. Once you do that, try it again.
The GUI appears once, though when I click begin it just closes. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Fri Mar 11, 2011 6:41 pm | |
| - Remo wrote:
- b0xb0x wrote:
- You are initializing the GUI twice. Remove your second GUI call. Once you do that, try it again.
The GUI appears once, though when I click begin it just closes. Oh. Change this.dispose() to dispose(). By adding "this", you are disposing the whole class, therefore disposing the client GUI as well. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Fri Mar 11, 2011 6:43 pm | |
| - b0xb0x wrote:
- Remo wrote:
- b0xb0x wrote:
- You are initializing the GUI twice. Remove your second GUI call. Once you do that, try it again.
The GUI appears once, though when I click begin it just closes. Oh. Change this.dispose() to dispose(). By adding "this", you are disposing the whole class, therefore disposing the client GUI as well. Did that, the same happens. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Fri Mar 11, 2011 6:51 pm | |
| Do some debugging; add a log("t"); to the start of your loop so we know if it gets to the loop or not. If it gets to your loop, my guess is that you are terminating the JVM with System.exit(0). An alternative to this would be stop(), as that stops the script rather than terminating the JVM. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Fri Mar 11, 2011 7:42 pm | |
| - b0xb0x wrote:
- Do some debugging; add a log("t"); to the start of your loop so we know if it gets to the loop or not. If it gets to your loop, my guess is that you are terminating the JVM with System.exit(0). An alternative to this would be stop(), as that stops the script rather than terminating the JVM.
I think the only thing I need help with is programming the start button. I just need the method to use and maybe then I wouldn't screw up so much. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Fri Mar 11, 2011 8:20 pm | |
| Add a setVisible(false) before this.dispose(). Maybe that will work if the above didn't. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Sat Mar 12, 2011 5:14 am | |
| - b0xb0x wrote:
- Add a setVisible(false) before this.dispose(). Maybe that will work if the above didn't.
Alright, let me try that... | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Sat Mar 12, 2011 5:36 am | |
| | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Sat Mar 12, 2011 5:47 am | |
| | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Sat Mar 12, 2011 8:17 am | |
| | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Sat Mar 12, 2011 8:51 am | |
| - Remo wrote:
- No, so maybe it's a problem in the loop.
Since it never gets to log("t");, the onStart() does not complete. You can remove the main from your GUI class. | |
|
| |
TaffTech Administrator
Posts : 72 Join date : 2011-02-27
| Subject: Re: Lots of errors Sat Mar 12, 2011 4:23 pm | |
| I don't know if this will fix it or not. But I remove this from my GUIs - Code:
-
public void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AirRC().setVisible(true); } }); }
| |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Sun Mar 13, 2011 6:28 am | |
| - TaffTech wrote:
- I don't know if this will fix it or not. But I remove this from my GUIs
- Code:
-
public void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new AirRC().setVisible(true); } }); }
Yeah, b0xb0x told me that. Do you think this code will work? | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Lots of errors Sun Mar 13, 2011 8:54 am | |
| Hmm, idk, try it By the way you have no mouse being drawn, just a new instance of Graphics being rotated constantly :P | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Lots of errors Sun Mar 13, 2011 1:44 pm | |
| - b0xb0x wrote:
- Hmm, idk, try it
By the way you have no mouse being drawn, just a new instance of Graphics being rotated constantly :P I fixed that, yet the script still won't work. How am I supposed to get to scripting if I can't? | |
|
| |
Sponsored content
| Subject: Re: Lots of errors | |
| |
|
| |
| Lots of errors | |
|