Functions in Load are not working. Where is the mistake?
Posted: Sat Nov 09, 2013 7:38 pm
Hi everyone,
I am working on a kind of complicated script in order not to get caught by Gamemaster or being observed by to many people.
Unfortunately I am always a kind of a noob. So I tried to read all the posts in order to get more knowledge about this stuff.
to understand each function's purpose ... :
function waitForEventStart()
if there is no Event Clock, bot goes to a place, and come back again in order to refresh the Display.
if the event did not start yet it will check until it does
if the event started it will break the waiting and goes to the next command
doquest()
it will repeat doing a specific order of functions until a message in the zone appeared and than change to the next active channel
quest()
it will get 2 quest. the second quest give an Item which will fulfil the first one.
sometimes , because of Lag etc. the items is not immediately in the bag, therefore it will only complete the first quest if it is complete, if not it will cancel the second quest and try it again.
It will do these quest until a specific message is shown in the Zone Chat.
restTilEvent()
it will rest until a specific time and then goes on with the script
channel()
it will change to the next active channel
people()
it will check how many people are around and pause the script if necessary.
GMdetectionname()
it will check every 10 sec. if these gamemaster are nearby, if they are, bot log out immediately ....Since the the Detection userfunction does not really work anymore. Do not know why.
unStick3()
it will check if I got somewhere stuck. after 3 tries of getting free if will check in what zone the char is. If it is not one of the three it will log out. Can I just put this function into the script or do I need to put it into my profile, since I only want this function when I am doing this script?
The bot should only use the first WP and check first which Zone it is in order to know what to do next. The WPs after that are only needed and should only be used if a function calls for them. Meaning the char should only stay at one point.
Here is my script
Unfortunately like I mentioned I am a noob and it does not work. MM give me following message:
Can someone help me out
?
Thank your for your time and sry for any inconvenience.
I am working on a kind of complicated script in order not to get caught by Gamemaster or being observed by to many people.
Unfortunately I am always a kind of a noob. So I tried to read all the posts in order to get more knowledge about this stuff.
to understand each function's purpose ... :
function waitForEventStart()
if there is no Event Clock, bot goes to a place, and come back again in order to refresh the Display.
if the event did not start yet it will check until it does
if the event started it will break the waiting and goes to the next command
doquest()
it will repeat doing a specific order of functions until a message in the zone appeared and than change to the next active channel
quest()
it will get 2 quest. the second quest give an Item which will fulfil the first one.
sometimes , because of Lag etc. the items is not immediately in the bag, therefore it will only complete the first quest if it is complete, if not it will cancel the second quest and try it again.
It will do these quest until a specific message is shown in the Zone Chat.
restTilEvent()
it will rest until a specific time and then goes on with the script
channel()
it will change to the next active channel
people()
it will check how many people are around and pause the script if necessary.
GMdetectionname()
it will check every 10 sec. if these gamemaster are nearby, if they are, bot log out immediately ....Since the the Detection userfunction does not really work anymore. Do not know why.
unStick3()
it will check if I got somewhere stuck. after 3 tries of getting free if will check in what zone the char is. If it is not one of the three it will log out. Can I just put this function into the script or do I need to put it into my profile, since I only want this function when I am doing this script?
The bot should only use the first WP and check first which Zone it is in order to know what to do next. The WPs after that are only needed and should only be used if a function calls for them. Meaning the char should only stay at one point.
Here is my script
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<waypoints>
<onload>
YourTargetScore = 6000
function waitForEventStart()
repeat
yrest(1000) -- check every second
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if (ScorePE == nil) then
printf("Score is nil, oh no!")
__WPL:setWaypointIndex(__WPL:findWaypointTag("Timer"));
return
end
if Count == 2 and YourTargetScore > ScorePE then break end
until false
local namePE,messagePE,namePH,ScorePE,Count , IsScoreVisible= RoMScript("PE_GetInfo(1)")
if Count ~= 2 or ScorePE >= YourTargetScore then
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home"));
end
end
function doquest()
local endmsg = getTEXT("|cffffff75Regional event has ended successfully!|r")
repeat
yrest(10)
quest()
GMdetectionname()
people()
until getLastWarning(endmsg, 10)
EventMonitorStart("Tug of War Between Two Sides", "WARNING_MESSAGE");
local time, moreToCome, msg = EventMonitorCheck("Tug of War Between two Sides",1)
if msg == endmsg then
local currentchannel = RoMScript("GetCurrentParallelID()")
local newChannel = currentchannel
repeat
newChannel = newChannel + 1
if newChannel > RoMScript("GetNumParalleZones()") then
newChannel = 1
end
until RoMScript("IsZoneChannelOnLine("..newChannel..")") or newChannel == currentchannel
if newChannel ~= currentchannel then
sendMacro("ChangeParallelID("..newChannel..");");
player:rest(30)
local id = RoMScript("GetCurrentParallelID()")
if id ~= newChannel then
RoMScript("ChangeChar(\"current\",nil,"..newChannel..")")
waitForLoadingScreen()
yrest(3000)
end
end
end
function doquest3()
local endmsg = getTEXT("|cffffff75Regional event has ended successfully!|r")
repeat
yrest(10)
quest()
GMdetectionname()
people()
until getLastWarning(endmsg, 10)
end
function quest()
player:target_NPC("xxxxxx");
AcceptQuestByName(xxxxx1);
AcceptQuestByName(xxxxx2);
repeat
queststate = getQuestStatus(xxxxxx1);
if queststate == "complete" then
CompleteQuestByName(xxxxx1);
else
CancelQuest(xxxxx2);yrest(500);
end
until getLastWarning(endmsg, 10)
end
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)
end
function channel()
sendMacro("ChangeParallelID("..newChannel..");");
player:rest(30)
local id = RoMScript("GetCurrentParallelID()")
if id ~= newChannel then
RoMScript("ChangeChar(\"current\",nil,"..newChannel..")")
waitForLoadingScreen()
yrest(3000)
end
end
function people()
if CountPlayers() > 3 then
print("Waiting till it's less crowded")
repeat
yrest(15000)
until 4 > CountPlayers(nil,true)
end
end
function GMdetectionname()
EventMonitorStart("detectGMname", "CHAT_MSG_SYSTEM");
sendMacro("AskPlayerInfo(\'Master\');");yrest(150);
local time, moreToCome, msg = EventMonitorCheck("detectGMname", "1")
if msg ~= nil then
RoMScript("Logout();");
end
EventMonitorStop("detectGMname")
end
registerTimer("GMdetection", secondsToTimer(10), GMdetectionname);function GMdetectionname()
end
function unStick3()
waitForLoadingScreen();
if getZoneId() ~= number(a1) then
RoMScript("Logout();");
waitForLoadingScreen();
if getZoneId() ~= number(a2) then
RoMScript("Logout();");
waitForLoadingScreen();
if getZoneId() ~= number(a3) then
RoMScript("Logout();");
end
end
end
end
</onload>
<!-- # 1 --><waypoint x="-9414" z="-18353" y="932" tag="Home">
if getZoneId() == number(a1) then
waitForEventStart()
doquest()
end
if getZoneId() == number(a2) then
doquest()
end
if getZoneId() == number(a3) then
doquest3()
restTilEvent()
channel()
end
__WPL:setWaypointIndex(__WPL:findWaypointTag("Home));
</waypoint>
<!-- # 2 --><waypoint x="-9397" z="-18357" y="932" tag="Timer">
__WPL:setForcedWaypointType("TRAVEL")
</waypoint>
<!-- # 3 --><waypoint x="-9257" z="-18444" y="904"> </waypoint>
<!-- # 4 --><waypoint x="-9175" z="-18543" y="895"> </waypoint>
<!-- # 5 --><waypoint x="-9065" z="-18758" y="851"> </waypoint>
<!-- # 6 --><waypoint x="-8936" z="-18846" y="863"> </waypoint>
<!-- # 7 --><waypoint x="-8885" z="-18921" y="882"> </waypoint>
<!-- # 8 --><waypoint x="-8885" z="-18920" y="881"> </waypoint>
<!-- # 9 --><waypoint x="-8854" z="-18991" y="905"> </waypoint>
<!-- # 10 --><waypoint x="-8806" z="-19152" y="905"> </waypoint>
<!-- # 11 --><waypoint x="-8592" z="-19389" y="905"> </waypoint>
<!-- # 12 --><waypoint x="-8730" z="-19168" y="907"> </waypoint>
<!-- # 13 --><waypoint x="-8839" z="-19000" y="898"> </waypoint>
<!-- # 14 --><waypoint x="-8960" z="-18804" y="856"> </waypoint>
<!-- # 15 --><waypoint x="-9097" z="-18740" y="851"> </waypoint>
<!-- # 16 --><waypoint x="-9166" z="-18529" y="886"> </waypoint>
<!-- # 17 --><waypoint x="-9269" z="-18424" y="907"> </waypoint>
<!-- # 18 --><waypoint x="-9386" z="-18362" y="931"> </waypoint>
</waypoints>
Code: Select all
7:28am - ...ktop/micromacro ROM/scripts/rom/classes/waypointlist.lua:83: Failed
to compile and run Lua code for waypointlist onLoad event.
Thank your for your time and sry for any inconvenience.