Hi, I'm trying to put together a bot that stands at the auction house and runs to the mailbox when it comes in. I'm having some trouble just getting the bot to recognize when the mail comes in (via event monitor checking). I am currently using the sleep() function and I think that is part of the problem - it seems to override just about everything. However I don't want to use a function like yrest() because I want him to just stand and wait for incoming mail. Can anyone point me in the right direction? Here's what I have written so far:
<onLoad>
function DetectMail()
repeat
local time, moreToCome, msg = EventMonitorCheck("SystemMsgLog", "1")
if msg ~= nil then
if string.find(msg,"New mail") then
DEFAULT_CHAT_FRAME:AddMessage("new mail detected");
end
end
until moreToCome == false
end
function startMailDetect()
unregisterTimer("mailinc");
printf("mailinc detection started\n");
EventMonitorStart("SystemMsgLog", "CHAT_MSG_SYSTEM");
registerTimer("mailinc", secondsToTimer(5), DetectMail);
end
startMailDetect()
</onLoad>
This is the waypoint file I load initially upon starting my bot:
<waypoints>
<!-- # 1 --><waypoint x="-427" z="-6002" y="21">
<!-- # 2 --><waypoint x="-1275" z="-5847" y="65">
player:sleep();
</waypoint>
ANY HELP WILL BE GREATLY APPRECIATED, THANKS!
Mail bot help
Re: Mail bot help
If you want to stand at the action house and wait for mail, I would just create a loop at that waypoint checking for mail. I wouldn't create a timer unless you want it checking mail while doing something else.
I would start the event monitor in the onload
Then at the waypoints...
This should wait until it recieves the "New Mail" message then continue to the next waypoint to collect mail.
I would start the event monitor in the onload
Code: Select all
<onLoad>
EventMonitorStart("SystemMsgLog", "CHAT_MSG_SYSTEM");
</onLoad>
Code: Select all
<waypoint near auction house>
repeat
local Found = false
repeat
local time, moreToCome, msg = EventMonitorCheck("SystemMsgLog", "1")
if msg ~= nil then
if string.find(msg,"New mail") then
DEFAULT_CHAT_FRAME:AddMessage("new mail detected");
Found = true
end
end
until moreToCome == false
yrest(5000) -- pause between checks
until Found == true
</waypoint>
Code: Select all
<waypoint near mailbox>
UMM_TakeMail()
</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
-
- Posts: 5
- Joined: Fri Nov 11, 2011 1:14 am
Re: Mail bot help
Thanks Rock5, I've been reading alot of your posts. If you could help out with the error i'm seeing, i'd appreciate it.
After running that script as you suggested in the waypoint file, I see this error:
call igf_events_Frame1's OnEvent, line: [string "?"]:25: attempt to index global 'os' (a nil value)
I'm checking my igf_events.lua file and nothing seems amiss. Do you have any idea?
After running that script as you suggested in the waypoint file, I see this error:
call igf_events_Frame1's OnEvent, line: [string "?"]:25: attempt to index global 'os' (a nil value)
I'm checking my igf_events.lua file and nothing seems amiss. Do you have any idea?
-
- Posts: 5
- Joined: Fri Nov 11, 2011 1:14 am
Re: Mail bot help
It's a little embarrassing to crawl back here again but I am at wit's end. I keep getting this interface execution error: call igf_events_Frame1's OnEvent, line: [string "?"]:25: attempt to index global 'os' (a nil value)
I have reduced my config to just the EventMonitorStart() function at a waypoint. As soon as it executes, any system message (not just mail messages) causes the error to pop up.
<!-- # 1 --><waypoint x="-1275" z="-5847" y="65">
EventMonitorStart("SystemMsgLog", "CHAT_MSG_SYSTEM");
yrest(30000);
</waypoint>
HELP!!
I have reduced my config to just the EventMonitorStart() function at a waypoint. As soon as it executes, any system message (not just mail messages) causes the error to pop up.
<!-- # 1 --><waypoint x="-1275" z="-5847" y="65">
EventMonitorStart("SystemMsgLog", "CHAT_MSG_SYSTEM");
yrest(30000);
</waypoint>
HELP!!
Re: Mail bot help
Is that an in game error? The 'os' functions were removed from the game awhile back. You need to install an addon that enables them again. I use d303fix
http://rom.curseforge.com/addons/d303fix/
I believe there are still a few addons that require the 'os' time functions so it's a good idea to get it.
http://rom.curseforge.com/addons/d303fix/
I believe there are still a few addons that require the 'os' time functions so it's a good idea to get it.
- 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
-
- Posts: 5
- Joined: Fri Nov 11, 2011 1:14 am
Re: Mail bot help
That addon solved the issue. Yes the error was in-game. Much obliged!
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 0 guests