|
| | boolean hover(Model model, boolean continueToHover) | |
| | Author | Message |
---|
Salvation VIP
Posts : 15 Join date : 2011-02-28
| Subject: boolean hover(Model model, boolean continueToHover) Thu Mar 24, 2011 2:36 am | |
| With help of other RSBuddy members, just thought I would share - Code:
-
/** * @description hovers a model * @param model, the model to hover or to check for being hovered * @param continueToHover, * true to keep moving the mouse over the model, * false to idle the mouse when already hovering * @return true when model was being hovered already */ private boolean hover(Model model, boolean continueToHover) { for(Polygon p : model.getTriangles()){ if(p.contains(Mouse.getLocation())) { if (continueToHover) Mouse.move(model.getNextPoint()); return true; } } Mouse.move(model.getNextPoint()); return false; } | |
| | | b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: boolean hover(Model model, boolean continueToHover) Thu Mar 24, 2011 6:32 am | |
| Nice! Maybe you could add a timeToHover param so that it moves over the model continuously (and avoid misses due to camera/movement) by creating a Timer of timeToHover and then creating a new Timer instance with that variable as its param. While the timer is running, continue to hover. Actually I'll just make it real quick. - Code:
-
private void hover (Model model, int timeToHover) { Timer t = new Timer(timeToHover); while (t.isRunning()) for (Polygon p : model.getTriangles()) if (!p.contains(Mouse.getLocation())) Mouse.move(model.getNextPoint()); else sleep(Random.nextInt(50, 100)); } Untested but it should work; I'll test it tonight. | |
| | | Salvation VIP
Posts : 15 Join date : 2011-02-28
| Subject: Re: boolean hover(Model model, boolean continueToHover) Thu Mar 24, 2011 11:01 am | |
| i loop this method while waiting for my current ore to be mined, no need for the time if the antiban turns the screen it will put the mouse back | |
| | | TaffTech Administrator
Posts : 72 Join date : 2011-02-27
| Subject: Re: boolean hover(Model model, boolean continueToHover) Thu Mar 24, 2011 4:09 pm | |
| Nice, it comes in handy, especially for mining, + it's good for an antiban... I've been using something like this for a while, but it never came across my mind to share it here xD | |
| | | b0xb0x Administrator
Posts : 130 Join date : 2011-02-25 Age : 28 Location : California
| Subject: Re: boolean hover(Model model, boolean continueToHover) Thu Mar 24, 2011 5:19 pm | |
| | |
| | | Remo Member
Posts : 41 Join date : 2011-03-10
| Subject: Re: boolean hover(Model model, boolean continueToHover) Sat Jun 04, 2011 7:43 am | |
| This already exists in the GameObject class. | |
| | | Sponsored content
| Subject: Re: boolean hover(Model model, boolean continueToHover) | |
| |
| | | | boolean hover(Model model, boolean continueToHover) | |
|
| Permissions in this forum: | You cannot reply to topics in this forum
| |
| |
| |
|