What do i do? When i select the second option of an npc, the walking packet is being called as well.
I was doing something with fishing, and i had to stop the fishing when you walked, but oh well, you walk when you click it, so you cant actually fish, what i did to get over the problem was to Schedule a task in 2 ticks, and then compare the coordinates where i started fishing with the actual coordinates, if they had changed you would stop fishing (By saying stop fishing i mean to set the flag to false)
But... there's a catch, if you run fast enough right after you are no longer fishing and fast enough before the loop fishing task checks if you are still fishing and you manage to click another fishing spot, you'd be fishing that spot and the one you were fishing already, because when the task checked if you were fishing you had managed to start fishing again. I'm trying to explain the best i can.
So basically the problem is that a flag called isFishing sets to false so you can fish another spot, and you manage to start fishing from another spot real fast, then the task that checks if you are fishing (To give you the fish, experience and bla bla bla) isn't stopped
Here is the task that loops to give you fish, and checks every tick to see if you are still fishing:http://pastebin.com/jQADXrCz
(Paste bin fudgeed the formatting)
Here is the method called in the walking packethttp://pastebin.com/WE2h3hhP