Jump to content

Project First Script! -Help is always welcome!-


Fruity

Recommended Posts

 

     - Does not stop fishing if the fishing spot turns into a whirlpool - how do I detect it is a whirlpool? 

 

Use getFacingID to detect if you're interacting with fishing spot. When false interact with fishing spot, then it should automatically find new fishing spot, if interacting with whirlpool. Nice paint by the way.

  • Like 1
Link to comment
Share on other sites

Use getFacingID to detect if you're interacting with fishing spot. When false interact with fishing spot, then it should automatically find new fishing spot, if interacting with whirlpool. Nice paint by the way.

 

Thanks just got home not long ago ill have a basha t it now. and thanks alot =)

Link to comment
Share on other sites

- Randomly stops fishing, will be working fine for like 20mins but then stops working. also when a whirlpool comes it will stop fishing it but then fail to resume. pfft lol

 

You can create a method, public void checkAvailableSpots() which will constantly check whether there are available spots to fish if your player is in the particular fishing area(Presuming you defined an area, FISHING_AREA) and put that method in your loop, put an if statement to make it trigger only when the player is not animating, !myPlayer().isAnimating and is in the FISHING_AREA. If there's a small time gap whilst fishing where the animation goes from the fishing animation back to -1(No animation) then simply put a sleep timer in the method like so:

sleep:{
			Timer timer = new Timer(0);
			while(timer.getElapsed() < 2000L){
				if(!client.getInventory().contains(fishID)){
					break sleep;
				}
			        else if(myPlayer().isAnimating()){
					timer.reset();
				}
		                else{
				     sleep(40);
		                }
			}
		}

Which will trigger if the player has been idle for 2 or more seconds

Link to comment
Share on other sites

- Randomly stops fishing, will be working fine for like 20mins but then stops working. also when a whirlpool comes it will stop fishing it but then fail to resume. pfft lol

 

You can create a method, public void checkAvailableSpots() which will constantly check whether there are available spots to fish if your player is in the particular fishing area(Presuming you defined an area, FISHING_AREA) and put that method in your loop, put an if statement to make it trigger only when the player is not animating, !myPlayer().isAnimating and is in the FISHING_AREA. If there's a small time gap whilst fishing where the animation goes from the fishing animation back to -1(No animation) then simply put a sleep timer in the method like so:

sleep:{
			Timer timer = new Timer(0);
			while(timer.getElapsed() < 2000L){
				if(!client.getInventory().contains(fishID)){
					break sleep;
				}
			        else if(myPlayer().isAnimating()){
					timer.reset();
				}
		                else{
				     sleep(40);
		                }
			}
		}

Which will trigger if the player has been idle for 2 or more seconds

 

alot of thanks for the reply =) once i get home i will have a good at implemting it and hopfully should work!. ill get back to you on how it goes =P

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...