Ok well alot has changed today, so redoing the first post.
To use the userfunction add startGMDetect() to WP onload or Profile onload.
Code: Select all
<onLoad><![CDATA[
startGMDetect()
]]></onLoad>
Code: Select all
<!-- GM detection options -->
<option name="GMDETECT" value="true" /> -- enables the GM detection userfunction
<option name="GMnearbylogout" value="true" /> -- If a GM is close to the character it will log out.
<option name="PAUSEONGM" value="300" /> -- Pauses when GM whispers for value in seconds. ie 300 = 5 minutes
<option name="RECALL" value="true" /> -- if in combat while pausing it will use recall and whisper/logout
<option name="playerDETECT" value="true" /> -- enables the player detection userfunction
Code: Select all
changeProfileOption("GMDETECT", true); -- no "" if using true/false, just change option name for the other profile options
GMnearbylogout set to true if you want the bot to log out anytime a GM is close to your character, otherwise it will just make a beeping sound. This works independant of the whisper response coding. If a GM is within range, I believe 250 yards, if this is true then it will logout the character.
PAUSEONGM set this to a number value in seconds, if 300 then it is 5 minutes. This will make the bot stop what it is doing and not move for the designated time. After that time it will continue what it was doing. If it gets in combat at any time it will behave depending on the RECALL option. If a GM has messaged in the last 1 minute before pause finishes then it will pause again.
RECALL If PAUSEONGM has a value and in combat and RECALL is set to true then the bot will use the skill recall and then after using recall successfully it will whisper GM and logout, if false then it will just keep fighting and try to pause. It is very difficult to make the bot kill everything and then do something else without recoding the current fighting code.
I included a way for people to test this function without needing a GM. Line 6 has
Code: Select all
testcharname = "Charname"
Also please make sure to open the userfunction_gmmonitor.lua and edit the response text to something different. If all bots reply the same then there isn't much point to the function.
I am talking about line 25-30 which is a table of response texts
Code: Select all
[1] = "Sorry, got to go",
[2] = "Im just logging off, sorry.",
[3] = "My favourite show is about to start. See ya.",
[4] = "Daughter just got hurt I need to go sorry",
[5] = "Sorry mum is yelling I need to log",
[6] = "Dad said not to talk to anyone and now I have to go =(",
As always many thanks to Admin and Rock5 =)
-------Installation instructions -------
place file in your rom-bot rom/userfunctions folder
V 6.5 has following player detection (new proifle option)and improved log creation with the userfunction logInfo()
http://www.solarstrike.net/phpBB3/viewt ... =27&t=4009
V 5.0 First patch of chapter V
V 3.0P for private server, set player lvl to 100 max.
V 2.2 Made it ignore Newbie Pet, Might need multi language support for the varying names.
V1.8 Made more friendly for log next character, Call function in WP onload only.
A WP purely for testing that you have event monitoring funtional.
Can be any character even brand new and you don't need any extra code in profile for it to work, just run bot with this waypoint file. If you don't currently have an addon to give the os.time() function in game then you will need an addon like d303fix
http://www.curse.com/addons/rom/d303fix/451968
This is a sound file for the GM nearby detection, when a GM is close it will make a beeping sound, unless you have GMnearbylogout set to true in which case it will just logout and not play the sound. If you can do testing on this function I would appreciate it, I have been testing it for around 8 hours and altering code as I felt necessary.
All you need is to change line 6 and have the ability to have 2 characters online at the same time and you can test all aspects of this function.
If you get the can't find file alarm.wav error then you might need this
here
--=== example ===--
Code: Select all
function gmnearby()
_pause = 30 -- 30 seconds
_time = os.time()
cprintf(cli.yellow,"Paused for GM detected, hold down (".. getKeyName(settings.hotkeys.STOP_BOT.key)..") to stop the pause..\n")
repeat
rest(2000)
_pause = _pause - 2
print(_pause.." seconds remaining.")
until os.time() - _time >= _pause or keyPressed(settings.hotkeys.STOP_BOT.key)
print("Bot resumed.")
end
using yrest() will not stop the bot from doing any actions in the gmnearby() loop, you need to use rest() and because of this keypresses arn't registerd while in the 2 second loop, so if you want to leave the pause loop you need to hold down the STOP_BOT key so that it is pressed when the loop finishes which is every 2 seconds.
--=== New following player detection ===--
You can edit the timer settings at the top of the userfunction
-- this is for monitoring players who may be following you.
local ignoreplayertime = 30
-- time in seconds when alarm will be sounded for a player "following" you
local clearplayertime = 60
-- time in seconds for players to be removed from table
-- when the ignoreplayertime time is reached it will play the alarm sound
-- if you want your own code performed then create a function named beingfollowed() and that code will be done instead.
-- ignores whispers by characters in the friends table, the names must be exact.
local friends = {"someone","someoneelse","whoever"}
There is also a new profile option to enable player following detection.
Code: Select all
<option name="playerDETECT" value="true" /> -- enables the player detection userfunction
--=== Added ===--
Need to rewrite this page, becoming a big mess of new added things lol