Make bot disconnect when slept

International

Moderator: Moderators

guytwo
Plain Yogurt
Plain Yogurt
Posts: 59
Joined: 26 Aug 2011, 04:45
Noob?: Yes

Make bot disconnect when slept

#1 Post by guytwo »

Is there a way to make my bot disconnect when it is slept? I know a status ID exists for being in the sleep state, but how do I get openkore to disconnect when that status is active?

Also, is there a way to make my bot stop completely (not disconnect, but clear the AI queue and switch to manual mode) if it gets slept? I read elsewhere, logging out when getting PM'ed by a GM will result in a ban. What I rather do is reply to the GM with hello and then have to bot completely stop whatever it is doing and remain in manual mode until I come back to manually start it again.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Make bot disconnect when slept

#2 Post by EternalHarvest »

doCommand or macro.
guytwo
Plain Yogurt
Plain Yogurt
Posts: 59
Joined: 26 Aug 2011, 04:45
Noob?: Yes

Re: Make bot disconnect when slept

#3 Post by guytwo »

I was looking through the status txt file and could not find the code for "sleep" status. I can only find one for "deep sleep". The GM casted regular sleep on my bot, so how do I trigger for this type of sleep?

Here is the line in the log file when the GM started sleeping my bot randomly. I know none of the monsters in the zone I was botting can cast sleep and the GM started PM me shortly after a few random sleeps.

Code: Select all

[Jan 4 11:09:09 2012.41] You are now: state: Sleep
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Make bot disconnect when slept

#4 Post by EternalHarvest »

guytwo wrote:You are now: state
STATE_id_handle.txt
statusnametable.txt
guytwo
Plain Yogurt
Plain Yogurt
Posts: 59
Joined: 26 Aug 2011, 04:45
Noob?: Yes

Re: Make bot disconnect when slept

#5 Post by guytwo »

So would the code be something like this?

Code: Select all

doCommand ai clear{
    whenStatusActive bodystate_sleep}
doCommand ai off{
    whenStatusActive bodystate_sleep}
Now how do I write a command to respond to any PM from someone with the words IRO GM in their name with a "hello"? Thanks.
guytwo
Plain Yogurt
Plain Yogurt
Posts: 59
Joined: 26 Aug 2011, 04:45
Noob?: Yes

Re: Make bot disconnect when slept

#6 Post by guytwo »

Is there a way to have openkore run a external batch file based on a trigger event of receiving a private GM chat?
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Make bot disconnect when slept

#7 Post by EternalHarvest »

OpenKore's Utils::launchApp or Perl's system.
guytwo
Plain Yogurt
Plain Yogurt
Posts: 59
Joined: 26 Aug 2011, 04:45
Noob?: Yes

Re: Make bot disconnect when slept

#8 Post by guytwo »

guytwo wrote:So would the code be something like this?

Code: Select all

doCommand ai clear{
    whenStatusActive bodystate_sleep}
doCommand ai off{
    whenStatusActive bodystate_sleep}
Now how do I write a command to respond to any PM from someone with the words IRO GM in their name with a "hello"? Thanks.
Actually, how do I change a config variable (like attackauto) using the above code block? Is there a do command that I use to change attackauto to 0 and reload the config file to make it active?
Cozzie
Spam Generator
Spam Generator
Posts: 499
Joined: 04 Apr 2008, 09:30
Noob?: No
Location: Melbourne, City of beer and awful sushis

Re: Make bot disconnect when slept

#9 Post by Cozzie »

guytwo wrote:
guytwo wrote:So would the code be something like this?

Code: Select all

doCommand ai clear{
    whenStatusActive bodystate_sleep}
doCommand ai off{
    whenStatusActive bodystate_sleep}
Now how do I write a command to respond to any PM from someone with the words IRO GM in their name with a "hello"? Thanks.
Actually, how do I change a config variable (like attackauto) using the above code block? Is there a do command that I use to change attackauto to 0 and reload the config file to make it active?
1. if you want to disconnect (say relog), use:

Code: Select all

doCommand relog {
	whenStatusActive sleep
}
read console commands for other uses. You do not need to reload config after using console commands to change attackAuto as changes are loaded on the fly.
Make Openkore Awesome. Join the team.