Improve code for the elfs daily quest

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
mayainverse
Posts: 94
Joined: Tue Dec 21, 2010 3:12 am

Re: Improve code for the elfs daily quest

#41 Post by mayainverse » Fri Jan 21, 2011 12:01 pm

yes could you post that? would take like 10 hours to do it manually on all char

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Improve code for the elfs daily quest

#42 Post by swietlowka » Fri Jan 21, 2011 12:10 pm

oh sorry i implemented that to tier2 check waypiont name AT

mayainverse
Posts: 94
Joined: Tue Dec 21, 2010 3:12 am

Re: Improve code for the elfs daily quest

#43 Post by mayainverse » Fri Jan 21, 2011 11:32 pm

yaw i saw that earlier. how do i trigger it? i have char at lvl 10 but never triesto do anything bot dailies then logs off.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Improve code for the elfs daily quest

#44 Post by swietlowka » Sat Jan 22, 2011 5:17 am

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>
that part should be auto trigered when u go to get mail, at mail box it checks if character is lvl 10+ then check if allready have AT if not goes to varanas...

mayainverse
Posts: 94
Joined: Tue Dec 21, 2010 3:12 am

Re: Improve code for the elfs daily quest

#45 Post by mayainverse » Sat Jan 22, 2011 10:57 am

hmm. my bot doesnt go to the mail box. Oo to fix the thing that where it half the time goes to mail box and half does dailies. it started at mailbox because only it says "xxx is closest waypoint starting there" so i changed the first way point numbers to the 2nd waypoint numbers so that the first one is a bit farther away. I don't think that would break it as the waypoint tag is still there. how do i fix the mailbox part.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Improve code for the elfs daily quest

#46 Post by swietlowka » Sat Jan 22, 2011 11:33 am

Code: Select all

<onLoad>
__WPL:setWaypointIndex(__WPL:findWaypointTag("poczta"));   
</onLoad>
u need this code in the profile (or wayipont, i belive it was changed some time ago to be also available)

mayainverse
Posts: 94
Joined: Tue Dec 21, 2010 3:12 am

Re: Improve code for the elfs daily quest

#47 Post by mayainverse » Sat Jan 22, 2011 1:06 pm

ok i put that into waypoint file at top and the mail waypoint worked but when i tgets at mail box i get

We found Mailbox and will harvest it.
[string " yrest(1000); player:target_Object("..."]:1: attempt to call global 'UMM_TakeMail' (a nil value)


i am guessing you need that mail mod for this to wokr. but I do indeed have that mod installed so I do not know why I get this error.

edit: i deleted the uumtakemail part and i get

failed to compile and run lua code for waypoint #29

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Improve code for the elfs daily quest

#48 Post by swietlowka » Sat Jan 22, 2011 2:10 pm

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
thats the code... im not sure whats causing the error... i did get it some times also,

u can try changing it to:

Code: Select all

yrest(3000);	player:target_Object("Mailbox",3000); UMM_TakeMail (); 	
	if( player.Level >= 10 ) then
        __WPL:setWaypointIndex(__WPL:findWaypointTag("AT"));
	  	end
or

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
maybe that will help...

mayainverse
Posts: 94
Joined: Tue Dec 21, 2010 3:12 am

Re: Improve code for the elfs daily quest

#49 Post by mayainverse » Tue Jan 25, 2011 9:12 am

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.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Improve code for the elfs daily quest

#50 Post by rock5 » Tue Jan 25, 2011 7:23 pm

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.
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.

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
  • 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

mayainverse
Posts: 94
Joined: Tue Dec 21, 2010 3:12 am

Re: Improve code for the elfs daily quest

#51 Post by mayainverse » Wed Jan 26, 2011 1:19 am

it is UMM so i asume this is function for ultimate mail mod to take all mail items then delete the mail?

I have that mod and I just get returns nil every time. what mail box? one in elf starting area ur waypoint goes too. like i said its not a big deal. I would have to use fusion myself anyways also would have to mail to the next character manually too. awsome work tho :) having trouble selling my tiering stones tho as I am in deep dept and no suitable main hand weps on the market atm.

swietlowka
Posts: 316
Joined: Wed Jun 16, 2010 8:16 am

Re: Improve code for the elfs daily quest

#52 Post by swietlowka » Wed Jan 26, 2011 3:32 am

adding what rock said could work, since i have an addon to auto open stores, i did forget to choose option to open te mail box, try it it should work

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Improve code for the elfs daily quest

#53 Post by Tamyra » Wed Mar 02, 2011 11:08 am

Okay, so I got the bot to farm the daily by inserting the ElfDaily.xml waypoint into a default profile I renamed Tiering. However, sometimes when there is someone else at the waterfall crystal gathering item the bot gets a nil response and just stops to try to clear the waypoint instead of trying to gather the item again. I am using swietlowka's waypoint exactly as posted, because I do not know how to edit waypoints except to put the waypoint file name in the profile locations. Also, sometimes after it accepts the quest from the NPC it does not turn around and just stays at NPC w/o going to next waypoint.

I have also downloaded the auto-switch/login addons and put them into the RoM interface folder, however I need a more simplistic way to farm them as I just want to be able to go to daily NPC to collect quest, run the 10 dailies then log off and swap character(has not swapped them yet, not sure what I did wrong there), so as to save time and get as many characters done as possible. I'm not sure how to remove the mail portion, and I do not need to send the bots to Varanas. For now I just want to collect the tokens for a few weeks on a few accounts.

Could anyone maybe post an edited version of the whole waypoint file with the mailbox/Varanas section removed, and maybe explain what I did wrong or am missing to get the characters to log out and swap?

Edit: Does the bot recognize the daily quest from the other 4 quests provided for new character in Elf academy? Is it necessary to clear those first? Will it only select the daily from the list or try to accept the other three quests provided?

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Improve code for the elfs daily quest

#54 Post by Tamyra » Wed Mar 02, 2011 8:13 pm

Okay, I went back and forth trial an error to figure out what I was missing to get this to work, and so far, the bot now gathers until item is in bag, and when all 10 dailies are complete it logs out and into next character. However, it still will not clear the NPC without assistance. Is there any code that will cause the bot to NOT land on top of the NPC when looking for it to complete the quest? Is that in the waypoint file, or is there a way to put another waypoint into the waypoint file after completing the quest but before accepting the new one, so that the bot moves away from the NPC first, that seems to be the only way it will go looking for the NPC again, when I pull the bot away from standing on top of it.

I am still using swietlowka's waypoint, so it kills the bot after the new character is reloaded because it looks for the "tier" path (which I found on page 2 of this thread) but is unable to find the "tier2" path from the "tier" path. Which means after each new character starts, I have to re-type "rom/bot.lua profile:tiering" in order to get it jump started.

Note: it does look like the tier path levels the new characters to level 3, from reading the post and the code (to the best of my ability) but I have yet to get that to work either, and it would be nice to create a new account with 8 new characters and just load the tiering profile and have them clear the lvl 1-3 quests and jump right into dailies. Then reloading the new character right from the completion of those 10 dailies.

Also I still have not figured out how to remove the mailbox portion, and I never know when I load the tiering profile if it is going to send me to the mailbox first or start the daily sequence.

Thank you to anyone who can help me figure this out.

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Improve code for the elfs daily quest

#55 Post by Tamyra » Thu Mar 03, 2011 1:01 pm

Sorry for triple posting... but I wanted to share...

So, I rolled up my sleeves, did some reading on the wiki and on this thread 3 times in detail to see if I could come up with something useful and I managed to create this. It ain't pretty but I did borrow a little from everyone, so thanks to those who added your snippets of code. I even tweaked the waypoints on the return path, so the bot is coming back in behind the NPC via the doorway. It still checks for the item at the waterfall once after correct item is in bag, but I do not mind that so much because at least it is getting the item and ONLY checking once after. The mailbox portion is now gone, so it logs in, does the 10 dailies, logs out swaps to new character and starts up all over again. Note: all the characters have to be standing next to NPC at logout, and above lvl 3 to work properly, as it does not do Elf academy quests.
Edit: Has been edited to add longer pause time and to use some of rock5's suggestions.
Let me know what you think:

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>
Last edited by Tamyra on Thu Apr 07, 2011 12:01 pm, edited 2 times in total.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Improve code for the elfs daily quest

#56 Post by rock5 » Thu Mar 03, 2011 10:51 pm

I think this daily has been discussed before but it's nice to see you adding your contributions.

A couple of observations:
  • Isn't waypoint 1 and 23 effectively the same thing? You should be able to do away with 23 altogether.
  • You can use

    Code: Select all

    waitForLoadingScreen()
    instead of

    Code: Select all

    yrest(3*60*1000)
    for faster starts after loading a new character.
Hope that helps.
  • 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

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Improve code for the elfs daily quest

#57 Post by Tamyra » Thu Mar 03, 2011 11:33 pm

They are the same thing, but it causes the bot to do a minute shift somehow which has helped to clear the NPC. Also what effect will changing the setting in the profile from

Code: Select all

<option name="QUICK_TURN" 		value="false" />
and changing it to

Code: Select all

<option name="QUICK_TURN" 		value="true" />
That might be what fixes my issues with clearing the NPC. The bot has it's back to him, and also the turn just before the turn-in of the quest it pauses for a while unless I turn it to face him. Basically the whole "Targeting of the NPC" there's issues there.

And is there a way to make the bot auto-close the quest turn-in screen? So that the quest can be accepted?

Lastly, where do the lines of code

Code: Select all

yrest(3*60*1000)
and 
waitForLoadingScreen()
fit in? I'd sure love for them to start faster.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Improve code for the elfs daily quest

#58 Post by rock5 » Fri Mar 04, 2011 12:36 am

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.
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.

The problem you have with collecting the item twice is probably also cause by going too fast. Try changing the yrest to 1000.
Tamyra wrote:Also what effect will changing the setting in the profile from
Code:
<option name="QUICK_TURN" value="false" />
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:Lastly, where do the lines of code

Code: Select all

yrest(3*60*1000)
and 
waitForLoadingScreen()
fit in? I'd sure love for them to start faster.
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.

Another thing, I've fixed the RoMScript command so you don't need to do this command like this anymore.

Code: Select all

   repeat questname=RoMScript("TEXT('Sys422340_name')"); yrest(500) until questname
You can just use

Code: Select all

   questname=RoMScript("TEXT('Sys422340_name')")
Also why do you change harvest distance?
  • 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

User avatar
Giram
Posts: 191
Joined: Thu Aug 26, 2010 3:34 pm
Location: Finland

Re: Improve code for the elfs daily quest

#59 Post by Giram » Fri Mar 04, 2011 5:17 am

I thought that i could share my waypoint also. Starts from npc, goes to waterfall and returns. There is checks for nil values and tries again to gather on waterfall if someone was using it and we didn't get it. This is old and there are things that can be done differently but this is working well for me.

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>

Tamyra
Posts: 133
Joined: Tue Feb 01, 2011 6:09 pm

Re: Improve code for the elfs daily quest

#60 Post by Tamyra » Fri Mar 04, 2011 9:35 am

I actually didn't mess with harvesting distance, that was part of the code I grabbed from someone else who posted on the thread. Is there a better coding distance that should help avoid the speed of the gather being too fast?

By the way, thank you for your quick reply, this helps. I'm going to try it out as soon as I get home and post my results as an edit to this post.
Last edited by Tamyra on Sat Mar 05, 2011 9:23 am, edited 2 times in total.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests