Page 1 of 1

Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 5:31 am
by ichmagbotsyay
Hey,
i got two questions.

1. Is it possible to change the event after the bot is stuck for the 10th time. Whenever my bot is stuck (most times because he fell into the ground) he tries ten times to get free. After that micromacro pauses. I don't want mm to pause but I want the bot to leave his party and to continue his waypoints.

2. Is it possible to let mm start a new game after the game had a critical error?

Re: Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 8:07 am
by lisa
http://www.solarstrike.net/phpBB3/viewt ... =30&t=2336

I added in a venue for people to customise what happens at stick counter points.
If you create a userfunction and have all or any functions called

Code: Select all

function unStick3()
function unStick6()
function unStick9()
Then that code will be performed at the number, ie 3 will be at 3 unsticks, 6 for 6 and 9 for 9. If you don't have a user function with any of these names then it will do what it always does.

Re: Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 8:48 am
by ichmagbotsyay
OK, I made userfunctions to do something special when the bot gets stuck... but does it reset the stuck counter?

I want my bot to leave it's party so it gets ported out of the instance and then reset the number of times it got stuck. Because if it doesn't reset that number, it will just do the special action once, if I set it to "unStick5()" for example, because the next time it gets stuck it would try to call "unStick6()", which I haven't modified. How do I reset it, or does it do so on it's own, if I give it a custom "unStick5()" ?

Re: Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 9:01 am
by lisa
the stucks have a time out, so if you don't get stuck again within the set time in code it resets back to 0. Can't remember off hand the time but pretty sure it is less then 15 seconds.


The code is only set up for the unstick numbers I mentioned, 3 6 9, doing
function unStick5()
won't do anything.

Re: Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 9:12 am
by ichmagbotsyay
oh okay, thank you

Re: Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 9:36 pm
by kanta
So I would create a userfunction called "userfunction_altunstick.lua"? Then within that file I'd do something like?

Code: Select all

function unstick6()
some code
more code
I saw the other thread before but have never understood how to use it exactly.

Re: Special event after being stuck + Auto-restart client

Posted: Sat Sep 03, 2011 9:52 pm
by lisa
you can have the code any place you can place a function, userfunctions folder is one choice. onload of a WP is another

Code: Select all

function unstick6()
sendMacro("LeaveParty()")
waitForLoadingScreen();
sendMacro('InviteByName("Lalasillycharacter")');
__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
end
Something like this in the onload for an instance run, if it gets stuck 6 times then it will leave party, invite some character, then go to the waypoint with the tag "start".

Re: Special event after being stuck + Auto-restart client

Posted: Mon Sep 05, 2011 9:03 pm
by kanta
Thanks Lisa, much appreciated