| Mouse Trail | |
|
|
Author | Message |
---|
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Mouse Trail Wed Mar 09, 2011 11:35 pm | |
| This method can be used to create a mouse trail. Imports: - Code:
-
import com.rsbuddy.script.methods.Mouse; import com.rsbuddy.script.task.LoopTask; import com.rsbuddy.script.util.Timer; import java.awt.*; In your variable declaration - Code:
-
private Timer[] mt = { new Timer(50), new Timer(50), new Timer(50), new Timer(50), new Timer(50), new Timer(50) }; Point[] mp = { new Point(0, 0), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Point(0, 0), new Point(0, 0) }; Anywhere (as a class ofc) - Code:
-
public class TrailTask extends LoopTask { public int loop() { for (int i=0;i<6;i++) { if (!mt[i].isRunning()) { mp[i] = Mouse.getLocation(); mt[i].reset(); sleep(50); } } return 0; } } In your onStart() - Code:
-
TrailTask mt = new TrailTask(); getContainer().submit(mt); In your onRepaint() - Code:
-
for (int j=0;j<6;j++) { //instead of using Mouse.getLocation(), use //mp[j] g.drawLine((mp[j].x - 8), (mp[j].y), (mp[j].x + 8), (mp[j].y)); // ^ draws a simple line } Enjoy.
Last edited by b0xb0x on Sun Mar 13, 2011 10:27 am; edited 3 times in total | |
|
| |
TaffTech Administrator
Posts : 72 Join date : 2011-02-27
| Subject: Re: Mouse Trail Wed Mar 09, 2011 11:40 pm | |
| And yet again, another awesome method by b0xb0x xD Come on IRC or something once in a while though!
Last edited by TaffTech on Wed Mar 09, 2011 11:44 pm; edited 1 time in total | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Mouse Trail Wed Mar 09, 2011 11:43 pm | |
| - TaffTech wrote:
- And yet again, another awesome method by b0xb0x xD
Come on IRC or something once in a while though! I haven't lately just because it's so distracting and my time is limited again with school (including sports and driving, excluding homework) taking up 12 hours every day, leaving me with a mere 2 or 3 hours for scripting. And thanks for the compliment | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Mouse Trail Wed Mar 09, 2011 11:44 pm | |
| - TaffTech wrote:
- And yet again, another awesome method by b0xb0x xD
Come on IRC or something once in a while though!
Edit: I'm getting an error. Timer(int, actionListener) in Timer cannot be applied to Timer(int) D: You must be c&p'ing incorrectly somewhere because I've got it working | |
|
| |
TaffTech Administrator
Posts : 72 Join date : 2011-02-27
| Subject: Re: Mouse Trail Wed Mar 09, 2011 11:45 pm | |
| - b0xb0x wrote:
- TaffTech wrote:
- And yet again, another awesome method by b0xb0x xD
Come on IRC or something once in a while though! I haven't lately just because it's so distracting and my time is limited again with school (including sports and driving, excluding homework) taking up 12 hours every day, leaving me with a mere 2 or 3 hours for scripting. And thanks for the compliment Yeah, I think the script was using another Timer class instead of the com.rsbuddy.util.Timer one xD | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Mouse Trail Wed Mar 09, 2011 11:46 pm | |
| - TaffTech wrote:
- Yeah, I think the script was using another Timer class instead of the com.rsbuddy.util.Timer one xD
Easy fix | |
|
| |
Silent Fang Member
Posts : 1 Join date : 2011-03-12
| Subject: Re: Mouse Trail Sat Mar 12, 2011 4:51 pm | |
| | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Mouse Trail Sun Mar 13, 2011 6:15 am | |
| Doesn't seem to be working, I'm getting a crap-ton of errors. Still, thanks for the contribution | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Mouse Trail Sun Mar 13, 2011 8:49 am | |
| - Remo wrote:
- Doesn't seem to be working, I'm getting a crap-ton of errors. Still, thanks for the contribution
Possible you are forgetting the imports? Editing method code now to say what imports are required. | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Mouse Trail Sun Mar 13, 2011 9:39 am | |
| - b0xb0x wrote:
- Remo wrote:
- Doesn't seem to be working, I'm getting a crap-ton of errors. Still, thanks for the contribution
Possible you are forgetting the imports? Editing method code now to say what imports are required. That's weird. It says that the imports can't be found. | |
|
| |
b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: Mouse Trail Sun Mar 13, 2011 9:55 am | |
| - Remo wrote:
- b0xb0x wrote:
- Remo wrote:
- Doesn't seem to be working, I'm getting a crap-ton of errors. Still, thanks for the contribution
Possible you are forgetting the imports? Editing method code now to say what imports are required. That's weird. It says that the imports can't be found. Is your IDE hooked up correctly? | |
|
| |
Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: Mouse Trail Sun Mar 13, 2011 10:05 am | |
| - b0xb0x wrote:
- Remo wrote:
- b0xb0x wrote:
- Remo wrote:
- Doesn't seem to be working, I'm getting a crap-ton of errors. Still, thanks for the contribution
Possible you are forgetting the imports? Editing method code now to say what imports are required. That's weird. It says that the imports can't be found. Is your IDE hooked up correctly? "Hooked up"? Well, RSBuddy.jar is the referenced Java archive file, but maybe it's 1.0.9. Let me try with 1.12 EDIT: Yep, that worked | |
|
| |
Sponsored content
| Subject: Re: Mouse Trail | |
| |
|
| |
| Mouse Trail | |
|