thx for the fast reply.
Since now everything is running more smoothly, I had the chance to discover a few more strange things ....
Code: Select all
function Zonecheck()
local zonestate = getZoneId()
if zonestate == ZONE-ID then
doquest()
people()
__WPL:setWaypointIndex(2);
yrest(3000)
DetectionnameAll()
elseif zonestate == ZONE-ID then
doquest()
people()
__WPL:setWaypointIndex(2);
yrest(3000)
DetectionnameAll()
elseif zonestate == ZONE-ID then
doquest()
people()
__WPL:setWaypointIndex(1);
yrest(3000)
Detectionname3()
1. After the doquest() it should check with people(), how many are around by using this code:
Code: Select all
function people()
if CountPlayers() > 1 then
print("Waiting till it's less crowded")
repeat
yrest(900000)
until 0 > CountPlayers(nil,true)
There were 4 people and nothing happened. I do have the userfunction in my MM. Why Is this code not saying, more than 3 people it should print "Waiting.." and wait 15min?

It ignored this function and went directly to DetectionnameAll().
2. I want the Char to go the the WP 1 or 2 first before it does Detectionname function, but strangely it goes directly to Detectionname and ignores the Waypointindex.... for the background WP 1 is further away than WP 2. It somehow stays at WP 2 even in the last loop.

What went wrong?
3. Detectionname should check for three specific Masters by using this code:
Code: Select all
function DetectionnameAll()
EventMonitorStart("detectMaster", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'Master\');"); yrest(1000);
local found = false
repeat
local time, moreToCome, msg = EventMonitorCheck("detectMaster", "1")
if msg and string.find(msg, ".*%(.*%).*%(.*%).*%(.*%).*%(.*%)") then
RoMScript("Logout();");
break
end
if not found then
channelAll()
break
end
until moreToCome == false
EventMonitorStop("detectMaster")
Today one of the Master was online, so the Search did
not fail , but MM did not Logout the Char, as I want it to. Does the Master have to be nearby to work?

Because the Master was two Zones away.
My thoughts are now, maybe I did something wrong in the Zonecheck() function, since it only do doquest & DetectionnameAll. It is specially important
in the last loop, since Detectionname3 has includes the restTilEvent() function, which seems not to work either, because it just switch immediately the channel. It it because it ignores the Zonecheck??
Code: Select all
function Detectionname3()
EventMonitorStart("detectMaster", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'Nohdrael\');"); yrest(800);
sendMacro("AskPlayerInfo(\'Kiareko\');"); yrest(800);
sendMacro("AskPlayerInfo(\'Lonarhune\');"); yrest(800);
local found = false
repeat
local time, moreToCome, msg = EventMonitorCheck("detectMaster", "1")
if msg and string.find(msg, ".*%(.*%).*%(.*%).*%(.*%).*%(.*%)") then
RoMScript("Logout();");
break
end
if not found then
restTilEvent()
channel()
break
end
until moreToCome == false
EventMonitorStop("detectMaster")
Code: Select all
function restTilEvent()
repeat
yrest(700)
until os.date("*t").min%20 == 10
yrest(10000)
local curtime = os.date("*t")
local curmins = curtime.min
local cursecs = curtime.sec
if curmins > 48 then
curmins = curmins - 47
elseif curmins > 28 then
curmins = curmins - 27
elseif curmins > 8 then
curmins = curmins - 7
else
curmins = curmins + 10
end
local resttime = ((20 - curmins) * 60) - cursecs
print("resting for "..resttime.." seconds")
yrest(resttime*1000)
The timer is written so it should wait until there are 2 min left before the new Event is starting anew. Is that correct?
