Re: Improve code for the elfs daily quest
Posted: Fri Jan 21, 2011 12:01 pm
yes could you post that? would take like 10 hours to do it manually on all char
MicroMacro home
https://www.solarstrike.net/phpBB3/
Code: Select all
<!-- # 4 --><waypoint x="31776" z="3608" tag="skrzynka"> yrest(1000); player:target_Object("Mailbox",1000); yrest(1000); UMM_TakeMail (); yrest(10000);
if( player.Level >= 10 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("AT"));
end
</waypoint>
<!-- # 6 --><waypoint x="31797" z="4160" tag="spow"> </waypoint>
<!-- # 7 --><waypoint x="31756" z="4364"> </waypoint>
<!-- # 8 --><waypoint x="31839" z="4590">__WPL:setWaypointIndex(__WPL:findWaypointTag("start")); </waypoint>
<!-- # 4 --><waypoint x="31775" z="3623" tag="AT">
local ATQ= RoMScript("CheckQuest(421457);");
if ATQ == 0
then
__WPL:setWaypointIndex(__WPL:findWaypointTag("gtf"));
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("spow"));
end
</waypoint>
Code: Select all
<onLoad>
__WPL:setWaypointIndex(__WPL:findWaypointTag("poczta"));
</onLoad>
Code: Select all
yrest(1000); player:target_Object("Mailbox",1000); yrest(1000); UMM_TakeMail (); yrest(10000);
if( player.Level >= 10 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("AT"));
end
Code: Select all
yrest(3000); player:target_Object("Mailbox",3000); UMM_TakeMail ();
if( player.Level >= 10 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("AT"));
end
Code: Select all
yrest(3000); player:target_Object("Mailbox",3000,true,true); UMM_TakeMail ();
if( player.Level >= 10 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("AT"));
end
Why doesn't UMM_TakeMail not work? What happens? Which mailbox are you using? When you click the mailbox, if a dialog opens with an option to "Open mailbox" such as at Logar and Elven Island then you'll have to include a Choicoption step.mayainverse wrote:well the AT thing works thank god that would take forever to manually do it. good work with this way point. I cant get the umm_takemail thing towork but thats not a big deal to do manually.
Code: Select all
player:target_Object("Mailbox",1000);
RoMScript("ChoiceOption(1)"); yrest(1000)
UMM_TakeMail() -- You shouldn't need a pause here because the function only returns once it's finished
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
levelupSkills1To10();
questname=RoMScript("TEXT('Sys422340_name')")
changeProfileOption("HARVEST_DISTANCE", 30)
</onLoad>
<!-- # 1 --><waypoint x="31847" z="4589" tag ='start'>
local dqCount, dqPerDay = RoMScript("Daily_count()");
if 10 > dqCount then
queststate = getQuestStatus("Helping Them Grow");
if queststate == "complete" then
-- Complete quest
player:target_NPC("Blinsik");
sendMacro("CompleteQuest()"); yrest(1200);
-- Accept quest
player:target_NPC("Blinsik");
sendMacro("AcceptQuest()"); yrest(1200);
--__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
else
-- Accept quest
player:target_NPC("Blinsik");
sendMacro("AcceptQuest()"); yrest(1200);
end
else
sendMacro("}LoginNextToon=true;a={")
sendMacro("Logout();"); yrest(3*60*1000) -- wait 3m for next character to load
-- Re-initialize player
player = CPlayer.new();
settings.load();
settings.loadProfile("tiering"); -- Profile name
yrest (4000)
end
</waypoint>
<!-- # 2 --><waypoint x="31897" z="4620"> </waypoint>
<!-- # 3 --><waypoint x="31932" z="4642"> </waypoint>
<!-- # 4 --><waypoint x="31923" z="4686"> </waypoint>
<!-- # 5 --><waypoint x="31846" z="4860"> </waypoint>
<!-- # 6 --><waypoint x="31814" z="4993"> </waypoint>
<!-- # 7 --><waypoint x="31784" z="5096"> </waypoint>
<!-- # 8 --><waypoint x="31718" z="5227"> </waypoint>
<!-- # 9 --><waypoint x="31644" z="5373"> </waypoint>
<!-- # 10 --><waypoint x="31561" z="5508"> </waypoint>
<!-- # 11 --><waypoint x="31472" z="5638"> </waypoint>
<!-- # 12 --><waypoint x="31419" z="5728" tag="pick"> while 1 > inventory:getItemCount(204840) do
player:target_Object(112976,500);
yrest(1000);
end
</waypoint>
<!-- # 11 --><waypoint x="31472" z="5638" tag="return"> </waypoint>
<!-- # 12 --><waypoint x="31561" z="5508"> </waypoint>
<!-- # 13 --><waypoint x="31644" z="5373"> </waypoint>
<!-- # 14 --><waypoint x="31718" z="5227"> </waypoint>
<!-- # 15 --><waypoint x="31784" z="5096"> </waypoint>
<!-- # 16 --><waypoint x="31814" z="4993"> </waypoint>
<!-- # 17 --><waypoint x="31849" z="4845"> </waypoint>
<!-- # 18 --><waypoint x="31833" z="4798"> </waypoint>
<!-- # 19 --><waypoint x="31813" z="4738"> </waypoint>
<!-- # 20 --><waypoint x="31799" z="4687"> </waypoint>
<!-- # 21 --><waypoint x="31781" z="4631"> </waypoint>
<!-- # 23 --><waypoint x="31850" z="4590">
player:target_NPC("Blinsik"); yrest(1000); sendMacro("CompleteQuest()"); yrest(1200);
</waypoint>
<!-- # 23 --><waypoint x="31850" z="4590">
repeat dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()") until dailyQuestCount and dailyQuestsPerDay
if (dailyQuestsPerDay - dailyQuestCount) == 0 then
sendMacro("}LoginNextToon=true;a={")
sendMacro("Logout();"); waitForLoadingScreen()
-- Re-initialize player
player = CPlayer.new();
settings.load();
settings.loadProfile("tiering"); -- Profile name
yrest (4000)
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
end
</waypoint>
</waypoints>
Code: Select all
waitForLoadingScreen()
Code: Select all
yrest(3*60*1000)
Code: Select all
<option name="QUICK_TURN" value="false" />
Code: Select all
<option name="QUICK_TURN" value="true" />
Code: Select all
yrest(3*60*1000)
and
waitForLoadingScreen()
It doesn't matter what direction you are facing when targeting. The reason it works when you do it twice is because you go too fast the first time so it doesn't get a chance to accept the quest. Just add about 1000ms pause between the complete and accept and it should work. Thats around line 16.Tamyra wrote:They are the same thing, but it causes the bot to do a minute shift somehow which has helped to clear the NPC.
Quick turn should have no affect on your script (except run a bit faster becasue it turns faster). I personally always use quickturn because it runs more smoothly and I think it looks less bottish.Tamyra wrote:Also what effect will changing the setting in the profile from
Code:
<option name="QUICK_TURN" value="false" />
Do a search. That's the 3 minute pause added after the logout command. Just replace it with the 'waitForLoadingScreen()' command and the bot should continue as soon as the loading screen clears instead of waiting the whole 3 minutes.Tamyra wrote:Lastly, where do the lines of codefit in? I'd sure love for them to start faster.Code: Select all
yrest(3*60*1000) and waitForLoadingScreen()
Code: Select all
repeat questname=RoMScript("TEXT('Sys422340_name')"); yrest(500) until questname
Code: Select all
questname=RoMScript("TEXT('Sys422340_name')")
Code: Select all
<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
repeat questname=RoMScript("TEXT('Helping Them Grow')"); yrest(250) until questname -- ie. "An Easy Lay?"
repeat npcname=RoMScript("TEXT('Blinsik')"); yrest(250) until npcname -- ie. "Jenna Miller"
settings.profile.options.QUICK_TURN = true;
</onLoad>
<!-- # 1 --><waypoint x="31856" z="4587" tag="main">
repeat dqCount, dqPerDay = RoMScript("Daily_count()") until dqCount ~= nil
if dqCount == 10 then
sendMacro("}LoginNextToon=true;a={")
sendMacro("Logout();");
waitForLoadingScreen() -- wait Till loaded
setupMacros() -- rechecks macros
end
printf("CharacterName = "..player.Name.. ", Daily quests "..dqCount.. "/10\n");
repeat queststate = getQuestStatus(questname); yrest(250) until queststate
if queststate == "complete" then
-- Complete quest
player:target_NPC(npcname);
sendMacro("CompleteQuest()"); yrest(2000);
-- Accept quest
player:target_NPC(npcname);
sendMacro("AcceptQuest()"); yrest(2000);
__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
elseif queststate == "incomplete" then
if 1 > inventory:getItemCount(204840) then -- Hae puhdistettu ruoka
__WPL:setWaypointIndex(__WPL:findWaypointTag("waterfall"));
else
__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"))
end
else
-- Accept quest
player:target_NPC(npcname);
sendMacro("AcceptQuest()"); yrest(2000);
__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));
end
</waypoint>
<!-- # 2 --><waypoint x="31893" z="4652" tag="waterfall"> </waypoint>
<!-- # 3 --><waypoint x="31819" z="4947"> </waypoint>
<!-- # 4 --><waypoint x="31717" z="5177"> </waypoint>
<!-- # 5 --><waypoint x="31413" z="5719" tag="harvest">
if inventory:getItemCount(204840) == 1 then
__WPL:setWaypointIndex(__WPL:findWaypointTag("skipharvest"));
else
player:harvest(112976);
yrest(6000);
__WPL:setWaypointIndex(__WPL:findWaypointTag("harvest"));
end
</waypoint>
<!-- # 6 --><waypoint x="31750" z="5078" tag="skipharvest"> </waypoint>
<!-- # 7 --><waypoint x="31889" z="4648"> </waypoint>
<!-- # 8 --><waypoint x="31853" z="4598"> </waypoint>
</waypoints>