PDA

View Full Version : "If walker = stuck, go to label?" Corym Port hope help needed



antoneds
02-13-2013, 02:02 AM
Hey there.
I have just finished making my first script at coryms - port hope. It works more or less perfectly with only one problem.. There is these occasional bothunters who ropes you up the hole which makes the walker stuck. I have put special areas to prevent this but if the bothunter is patient he WILL always succeed to rope me up.

So my question is - is there a way to make a script for "if walker stuck = go to label x"?

If not, is there a way to make the walker search through my nodes until it eventually find one which is close enough? Because when the walker is stuck it only searches for a few couple of nodes before it gives up.

I hope there is someone else with the same dilemma out there, I would gladly take any advise to make a more stable walker/script at coryms.

Thanks in advance :)

atef201080
02-13-2013, 03:42 AM
do a check like the way you check the potions, i think this would work..

antoneds
02-13-2013, 08:15 AM
Okay
But how do I know where to put this check? As I have now idea around which node I will become stuck. :s

bkeener101
02-13-2013, 09:44 AM
I haven't really looked at the capabilities of Xenobot, but is it possible to have an lua loop that is something like this:


while true do{
local position = currentPosition
wait(15000)
if(currentPosition == position) then
walker.goTo("escape")
end
end

Basicly, check every 15 seconds if your position has changed. If not, then go to label "escape"

EDIT:
After looking at some functions, I think this MIGHT work. Test it before thinking it will save your life.


while (true) do
local pos = Self.Position()
wait(10000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) == 0 then
Walker.Goto("escape")
end
end


Of course, this would only work if you get stuck on the same floor as "escape:" and if it is reachable.

antoneds
02-13-2013, 06:51 PM
Thanks alot for the feedback!
I'll give it a shot :)

bkeener101
02-13-2013, 06:55 PM
I tested this on one of my characters. Saved it as positionChecker.lua and ran it, and got myself purposely stuck. After a few seconds of being stuck, my walker jumped to the label I set it to, so it worked for me. Only issue was I got myself stuck in a place where that label was unreachable(another floor) So this will only work if the label you set it to can be reached.

Xeromex
02-13-2013, 09:11 PM
I tested this on one of my characters. Saved it as positionChecker.lua and ran it, and got myself purposely stuck. After a few seconds of being stuck, my walker jumped to the label I set it to, so it worked for me. Only issue was I got myself stuck in a place where that label was unreachable(another floor) So this will only work if the label you set it to can be reached.
maybe use something like,
if pos.z = 7
Goto(escape7)
elseif pos.z = 8
Goto(escape)
etc. Etc.


typed on my phone xd

antoneds
02-13-2013, 11:26 PM
Alright bkeener. I really really appreciate it, and it'll help me alot. Atm im only running the first floor at coryms - doing 70-85k/h on a level 70, so it works perfectly because only place the walker might get stuck is on the surface. :) Hope this might help someone else who have the same problem!

antoneds
02-13-2013, 11:50 PM
Found an issue though.. If im being effectively pushed - the "go to label" thing won't work, cause the walker belives im moving on my own. Any suggestions?

bkeener101
02-14-2013, 10:11 AM
Found an issue though.. If im being effectively pushed - the "go to label" thing won't work, cause the walker belives im moving on my own. Any suggestions?

Hm, I'll give it some thought. I'm sure there's a way, but not the way I was doing it. If someone is pushing you, eventually im sure they would stop long enough for the function to catch it

antoneds
02-14-2013, 06:54 PM
Perhaps it might work, although if the delaytimer is to short - it will go to the "escape-label" when im hunting. Cause sometimes when surrounded by 4-6 coryms it takes my knight to long to kill and loot em :p Anyhow, haven't had the walker stuck the latest 30h~ so its not a huge issue anymore. I'll just stick to the alarm and play semi-afk until im a bit higher level :)

bkeener101
02-15-2013, 10:19 AM
You can change the delay to whatever you want :) Just edit the "wait(xxxx" part. 1000 = 1 second. so 30000 = 30 seconds

chmielsen
02-07-2014, 06:35 PM
sometimes bot stop when he have to rope or shovel or just enter the hole, how i can remove this ?? its posibble to sth like : if stuck go previous stand/node/rope etc??