Adding New command
Adding New command
Is there a way you could add in a new code to ..run for so many hr or min then log off or dc ?
Re: Adding New command
The easiest way to do it is in the onLoad section of the waypoint file, add
and then somewhere, maybe at a safe location waypoint or in the onleaveCombat section of your profile or somewhere like that, check if the desired time has passed.
It wont work in the onLoad section if the waypoint file if it's 1 of a set of alternating waypoint files that get loaded and reloaded. In that case you might have to initialize "start_time" in the onLoad section of your profile.
Code: Select all
start_time = os.time()
Code: Select all
if (os.time()-start_time) > 3600 then
logoff()
end
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Adding New command
can't you just change the profile options to suit?
Code: Select all
<option name="LOGOUT_TIME" value="0" /> <!-- in minutes, 0 = timer disabled -->
<option name="LOGOUT_SHUTDOWN" value="false" />
Remember no matter you do in life to always have a little fun while you are at it
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: Adding New command
I think there are too many components to deal with. Do you want it to load the next character or not? Do you want to load a new profile or continue using the same one? Do you want to load a specific profile or the characters default profile? With automatic settings you could logoff anywhere while doing anything, if you do it in the waypoint file you can choose a nice safe place to logoff and include any other checks you might want to do before logging off. Then, of course, there is the fact that it requires Autologin to be installed.
All in all I think it would be more of a hinderance then a help. It's not like the code to relog is that long or complicated. That's what I think anyway.
All in all I think it would be more of a hinderance then a help. It's not like the code to relog is that long or complicated. That's what I think anyway.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Adding New command
so if iam adding these and i have a multi path for the first path i would use
correct
for the other loaded paths off the first file could i use
so when it returns to the orginal path file time will stay constant??
would this work ?
Code: Select all
<onLoad>
start_time = os.time();
</onLoad>
for the other loaded paths off the first file could i use
Code: Select all
<onLoad>
start_time = start_time();
</onLoad
would this work ?
Re: Adding New command
If the first waypoint file loads a second waypoint file and so on and if the first waypoint file eventually gets loaded again then you can't have the start_time = os.time() in the onload section of the first waypoint file because it would get reset every time it gets reloaded.
In that case it would be better to put it in the onload section of the profile so that it only gets set when the profile is loaded which is only when starting the bot or changing characters and reloading the profile.
If you really want to add it to the first waypoint file you could also do something like this;
That way it should only do it the first time it loads the waypoint file.
In that case it would be better to put it in the onload section of the profile so that it only gets set when the profile is loaded which is only when starting the bot or changing characters and reloading the profile.
If you really want to add it to the first waypoint file you could also do something like this;
Code: Select all
if start_time == nil then
start_time = os.time();
end
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Adding New command
please could you give a example ..on how to add it to profile?
i dont like adding it every time to my way points and then part to my profile and if it does not have the onload in the way point it crashes after it reaches this point in time ?
by then iam gone and i just stand there dieing
i dont like adding it every time to my way points and then part to my profile and if it does not have the onload in the way point it crashes after it reaches this point in time ?
by then iam gone and i just stand there dieing
Re: Adding New command
Initialize start_time in profile or waypoint file.
In Profile:Or Waypoint file:
Then at a safe place in your waypoint file check the time:
You can do this at more than one 'safe' waypoint and in multiple waypoint files.
In Profile:
Code: Select all
<onLoad>
start_time = os.time();
</onload>
Code: Select all
<onLoad>
if start_time == nil then
start_time = os.time();
end
</onload>
Code: Select all
<!-- # 10 --><waypoint x="3929" z="3261">
if (os.time() - start_time) > (60*60) then -- greater than 1 hour
player:logout()
error("Done for today. Logging off")
end
</waypoint>
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests