Page 1 of 1

LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 4:11 am
by mschmitd
Hi

I use the KS-Script for farming gold sometimes my char stuck in this Ini

normaly the bot automatic logout and kill the client !! but in this case you need only

a Automatic LeaveParty and a new Start from the KS-Script nearly the same as

after Death. Is there a Solution for this Problem ??


Greetings Mike


sry for my bad English

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 4:35 am
by botje

Code: Select all

<onUnstickFailure><![CDATA[
		-- Lua code to execute when MAX_UNSTICK_TRIALS is reached.
		sendMacro("UseSkill(1,2)");
		sendMacro("UseSkill(1,2)");
		waitForLoadingScreen();
		player:sleep();
	]]></onUnstickFailure>
thats what i use for it, im sure you can adept that for your use, its something thats present in every profile btw xd

Botje

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 4:44 am
by mschmitd
@Botje


Thanks for the Code example i think i can use this for my Problem :D


Greetings Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 4:46 am
by botje
your welcome mate :)

Botje

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 5:05 am
by mschmitd
@rock5

<onUnstickFailure><![CDATA[

local zoneid = RoMScript("GetZoneID()")
if zoneid == 107 then -- Shrine of Kalin
RoMScript("SendChatMessage(\"Leave the Ini\",\"PARTY\",0,\"CharName\")") ;
sendMacro("LeaveParty();");
yrest(4000);
waitForLoadingScreen();
player:update();
__WPL:setWaypointIndex(__WPL:findWaypointTag("rerun"));
else -- not in Shrine of Kalin
player:logout(nil,true); -- closes client
end

]]></onUnstickFailure>


Please can you check this Code ?


Greetings Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 5:14 am
by botje
seems fine to me, although i dont know if that would work that way, i would personally just make seperate waypoints for going to shop and back in, but thats just me.

if you make seperate file, you can just loadpath the right one.

Botje

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 5:24 am
by mschmitd
@Botje

I have advanced the code i hope this work

Greetings Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 5:28 am
by botje
to be honest, i never worked with zoneid, so it would be best to ask Rock5.

im just a noob :P

Botje

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 5:32 am
by mschmitd
@Botje

Thanks for your Help :)

Greetings Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 5:54 am
by rock5
No reason why it shouldn't work. You don't need to use "~= 107", it's obsolete. Just use

Code: Select all

if zoneid == 107 then -- Shrine of Kalin
...
else -- Not Shrine of Kalin
...
end

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 6:07 am
by mschmitd
@rock5

Thanks for your quick Answer

I have modified the Code.

Greetings Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 6:56 am
by mschmitd
@rock5

is there a possibility to find out the index of

the stuck-waypoint ?? I will send the number of this Waypoint

to my Party member for debugging, so i later can modified the

Way-Point Script.


Greetings Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 7:18 am
by rock5
mschmitd wrote:is there a possibility to find out the index of the stuck-waypoint ??
Well... "__WPL.CurrentWaypoint" holds the point that it is currently trying to move toward. There is a problem with that as it might change as part of the unstick trials when it tries to go to the last waypoint. Also you don't know how far you are from the last or next waypoint.

What you really want is the actual location that you got stuck. Wouldn't it be better to send the current player coordinates? player.X, player.Z and player.Y?

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 7:35 am
by mschmitd
Yes i think you are right

The current Position of the player is a good idea :D

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 9:31 am
by mschmitd
@rock5

Perhaps you can change the Bot ?

If the bot stucks inside from a Ini you can use the

same like the wall hack userfunktion ? And after

the Char is on the correct Waypoint you can change

back to the normal funktion without the wall hack


Greetings Mike

sry for my bad English

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 9:37 am
by lisa
then the hacks would need to be added into the bot aswell.

The bot is currently set up for people to customise what happens when stuck. there are already a few posts about it. I added in so you can call your own personal functions at 3, 6 and 9 unstick tries.

So for inside instance you can call a function at 3 unsticks to try walk hack and moving to nearest coords. then have another function at 6 so if you get to 6 you can leave party and start again from the outside waypoints.

The options are limitless

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 10:13 am
by mschmitd
@lisa

Thank you for this Information
I will try to implement this in my Profile

Mike

Re: LOGOUT_WHEN_STUCK

Posted: Mon Jul 18, 2011 12:55 pm
by botje
great idea :)

im gonna try that too :P

Botje