Improve code for the elfs daily quest

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
loki61
Posts: 2
Joined: Mon Nov 01, 2010 7:57 am

Improve code for the elfs daily quest

#1 Post by loki61 » Mon Nov 01, 2010 8:14 am

My code :

Code: Select all

<waypoint x="31419" z="5721" >
		
		rest( 1500 )
		changeProfileOption("HARVEST_TIME", 10);
		player:target_Object(112976, 8000);
		
							
		</waypoint>
Bug sometimes because my bot go away whitout the good item.
I'l like to modify this code to make my bot harvest until he got the good item. (the bot got in his backpack the item id 204839 before and when he do a good harvest it become item id 204840)

runensammler
Posts: 13
Joined: Mon Apr 06, 2009 6:20 am

Re: Improve code for the elfs daily quest

#2 Post by runensammler » Mon Nov 01, 2010 12:28 pm

Hi.
Try this code instead

Code: Select all

while 1 > inventory:getItemCount(204840) do
	player:target_Object(112976,500);
	yrest(100);
end;

loki61
Posts: 2
Joined: Mon Nov 01, 2010 7:57 am

Re: Improve code for the elfs daily quest

#3 Post by loki61 » Mon Nov 01, 2010 1:36 pm

it seems to work, thanks you very much for this fast reply.

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

Re: Improve code for the elfs daily quest

#4 Post by swietlowka » Tue Nov 02, 2010 2:45 am

it happedns that the bot stops there for no reason, i used a loop that check if the q is done and if not the target again

runensammler
Posts: 13
Joined: Mon Apr 06, 2009 6:20 am

Re: Improve code for the elfs daily quest

#5 Post by runensammler » Tue Nov 02, 2010 3:04 pm

swietlowka wrote:it happedns that the bot stops there for no reason, i used a loop that check if the q is done and if not the target again
I do the same - but i check if the questitem is there and if not i repeate ;)

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Improve code for the elfs daily quest

#6 Post by Germangold » Thu Nov 04, 2010 4:31 pm

This is my countinous daily farming subroutine..
replace QUESTNAME with the corresponding questname in your native language, for german folks it would be Wachstumshilfe
no idea yet how to start the script One time do finish all characters in one account (8x) in a row without any additional logging etc.. i was looking into autologin but dont works for me..


Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
	<!-- #  1 --><waypoint x="31847" z="4592" tag ='Main'>
			
			local dqCount, dqPerDay = RoMScript("Daily_count()");
			if 10 > dqCount then	
				queststate = getQuestStatus("QUESTNAME");
				if queststate == "complete" then
					-- Complete quest
					player:target_NPC("Blinsik");
					sendMacro("CompleteQuest()"); yrest(2000);
					-- Accept quest
					player:target_NPC("Blinsik");
					sendMacro("AcceptQuest()"); yrest(2000);
					--__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));	
				else
					-- Accept quest
					player:target_NPC("Blinsik");
					sendMacro("AcceptQuest()"); yrest(2000);
				end
			else
				player:logout();
			end
	</waypoint>
	<!-- #  2 --><waypoint x="31812" z="4849">	</waypoint>
	<!-- #  3 --><waypoint x="31415" z="5720" tag = "Item">
			queststate = getQuestStatus("QUESTNAME")
			if queststate == "incomplete" then
					player:target_Object(112976,500);
				yrest(3000);
				__WPL:setWaypointIndex(__WPL:findWaypointTag("Item"));
			end
	</waypoint>
	<!-- #  4 --><waypoint x="31878" z="4692">	</waypoint>
	<!-- #  5 --><waypoint x="31843" z="4593">	</waypoint>
</waypoints>

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

Re: Improve code for the elfs daily quest

#7 Post by swietlowka » Fri Nov 05, 2010 8:56 am

if you share your ill share my ;)

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="RUN">
	<onLoad>
	 levelupSkills1To10(); 
   repeat questname=RoMScript("TEXT('Sys422340_name')"); yrest(500) until questname
   changeProfileOption("HARVEST_DISTANCE", 30)
   </onLoad>
		<!-- #  1 --><waypoint x="31841" z="4593" tag="start"> 
		repeat dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()") until dailyQuestCount and dailyQuestsPerDay
          if (dailyQuestsPerDay - dailyQuestCount) > 0 then
            player:target_NPC("Blinsik"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
            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)
              loadPaths("tier"); -- First script
            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"> 	player:target_Object(112976,7000,true);
	    repeat queststate = getQuestStatus(questname); yrest(500) until queststate
        if queststate == "complete" then
          __WPL:setWaypointIndex(__WPL:findWaypointTag("return"));
        else __WPL:setWaypointIndex(__WPL:findWaypointTag("pick"));
      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="31846" z="4860">	</waypoint>
	<!-- # 18 --><waypoint x="31923" z="4686">	</waypoint>
	<!-- # 19 --><waypoint x="31932" z="4642">	</waypoint>
	<!-- # 20 --><waypoint x="31897" z="4620">  </waypoint>
	<!-- # 21 --><waypoint x="31841" z="4593"> 	
	player:target_NPC("Blinsik"); yrest(1000); sendMacro("CompleteQuest()"); yrest(2000);
      </waypoint>
  <!-- # 21 --><waypoint x="31841" z="4593"> 
          repeat dailyQuestCount, dailyQuestsPerDay= RoMScript("Daily_count()") until dailyQuestCount and dailyQuestsPerDay
          if (dailyQuestsPerDay - dailyQuestCount) == 0 then
                  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)
              loadPaths("tier"); -- First script
           else
      	__WPL:setWaypointIndex(__WPL:findWaypointTag("start"));
      	end
  </waypoint>
 	<!-- #  1 --><waypoint x="31839" z="4590" tag="poczta">	</waypoint>
	<!-- #  2 --><waypoint x="31756" z="4364">	</waypoint>
	<!-- #  3 --><waypoint x="31797" z="4160">	</waypoint>
	<!-- #  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>
		<!-- #  1 --><waypoint x="31800" z="3686" tag="gtf">	</waypoint>
	<!-- #  2 --><waypoint x="32283" z="3279">	</waypoint>
	<!-- #  3 --><waypoint x="32221" z="3212">	</waypoint>
	<!-- #  4 --><waypoint x="32133" z="3168">	</waypoint>
	<!-- #  5 --><waypoint x="31789" z="3147">	</waypoint>
	<!-- #  6 --><waypoint x="31599" z="2673">	</waypoint>
	<!-- #  7 --><waypoint x="31390" z="2369">	</waypoint>
	<!-- #  8 --><waypoint x="31233" z="2203">	</waypoint>
	<!-- #  9 --><waypoint x="31080" z="2144">	</waypoint>
	<!-- # 10 --><waypoint x="30946" z="2146">	</waypoint>
	<!-- # 11 --><waypoint x="30810" z="2152">	</waypoint>
	<!-- # 12 --><waypoint x="30396" z="2174">	</waypoint>
	<!-- # 13 --><waypoint x="30060" z="2410">	</waypoint>
	<!-- # 14 --><waypoint x="29712" z="2803">	</waypoint>
	<!-- # 15 --><waypoint x="29607" z="2988">	</waypoint>
	<!-- # 16 --><waypoint x="29329" z="3804">	</waypoint>
	<!-- # 17 --><waypoint x="29180" z="4202">	</waypoint>
	<!-- # 18 --><waypoint x="29057" z="4414">	</waypoint>
	<!-- # 19 --><waypoint x="28747" z="4671">	</waypoint>
	<!-- # 20 --><waypoint x="28403" z="4791">	</waypoint>
	<!-- # 21 --><waypoint x="27989" z="4428">	</waypoint>
	<!-- # 22 --><waypoint x="27952" z="4234">	</waypoint>
	<!-- # 23 --><waypoint x="28075" z="4149">	</waypoint>
	<!-- # 24 --><waypoint x="28360" z="4005">	</waypoint>
	<!-- # 25 --><waypoint x="28433" z="3735">	</waypoint>
	<!-- # 26 --><waypoint x="28409" z="3525">	</waypoint>
	<!-- # 27 --><waypoint x="28338" z="3466">	</waypoint>
	<!-- # 28 --><waypoint x="28126" z="3436">	</waypoint>
	<!-- # 29 --><waypoint x="27910" z="3417">		player:target_NPC("Sidklaw");
		sendMacro("ChoiceOption(1);"); yrest(5000);
	</waypoint>
	<!-- # 32 --><waypoint x="4407" z="-3621">	</waypoint>
	<!-- # 33 --><waypoint x="4536" z="-3557">	</waypoint>
	<!-- # 34 --><waypoint x="4747" z="-3532">	</waypoint>
	<!-- # 35 --><waypoint x="4836" z="-3559">	</waypoint>
	<!-- # 36 --><waypoint x="4984" z="-3661">	</waypoint>
	<!-- # 37 --><waypoint x="5208" z="-3831">	</waypoint>
	<!-- # 38 --><waypoint x="5278" z="-3929">	</waypoint>
	<!-- # 39 --><waypoint x="5239" z="-4016">	</waypoint>
	<!-- # 40 --><waypoint x="5322" z="-4131">	</waypoint>
	<!-- # 41 --><waypoint x="5399" z="-4203">	</waypoint>
	<!-- # 42 --><waypoint x="5452" z="-4266">	</waypoint>
	<!-- # 43 --><waypoint x="5510" z="-4349">	</waypoint>
	<!-- # 44 --><waypoint x="5538" z="-4415">	</waypoint>
	<!-- # 45 --><waypoint x="5526" z="-4433">		player:target_NPC("Lehman"); yrest(1000);
      sendMacro("OnClick_QuestListButton(1, 1)"); yrest(1000); sendMacro("AcceptQuest()"); yrest(2000);
      player:target_NPC("Lehman"); yrest(1000); sendMacro("OnClick_QuestListButton(3, 1)"); yrest(1000); sendMacro("CompleteQuest()"); yrest(2000);
	</waypoint>
	<!-- # 45 --><waypoint x="5535" z="-4425"> sendMacro("UseSkill(1,2)"); yrest(5000);</waypoint>
	<!-- #  1 --><waypoint x="31954" z="3278">	</waypoint>
	<!-- #  2 --><waypoint x="31976" z="3443">	</waypoint>
	<!-- #  3 --><waypoint x="31942" z="3507">	</waypoint>
	<!-- #  4 --><waypoint x="31880" z="3560">	</waypoint>
	<!-- #  5 --><waypoint x="31784" z="3614"> __WPL:setWaypointIndex(__WPL:findWaypointTag("spow"));	</waypoint>
	
	
</waypoints>

Jengoso
Posts: 20
Joined: Sun Oct 24, 2010 5:05 am

Re: Improve code for the elfs daily quest

#8 Post by Jengoso » Fri Nov 05, 2010 3:55 pm

Would you mind giving me a little assistance on this one?
I havent done any daily quest botting before.
What I did was that i copied swietlowka:s code, made a new waypointdocument and pasted it in. However i get a nil value when i get to the crystal.
Same goes for Germangolds text, he runs to the questgiver and then gets a nilvalue.

Jengoso
Posts: 20
Joined: Sun Oct 24, 2010 5:05 am

Re: Improve code for the elfs daily quest

#9 Post by Jengoso » Fri Nov 05, 2010 4:07 pm

Please ignore my previous post, I accidentally tried it on a rombot that wasnt fully updated. Embarrassing...But the script works great for me too, thank you swietlowka

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Improve code for the elfs daily quest

#10 Post by Germangold » Sat Nov 06, 2010 10:45 pm

i have always error

Code: Select all

pawn.lua 274, error reading CPawn:Update()
svn 516 tried and tried 517..

Jengoso
Posts: 20
Joined: Sun Oct 24, 2010 5:05 am

Re: Improve code for the elfs daily quest

#11 Post by Jengoso » Sun Nov 07, 2010 4:53 am

Actually I have another question, when running Swietlowkas script it works well most times, but sometimes the bot misses to harvest the crystal (the harvesting gets cancelled) and then he just stands there. I then have to manually harvest it to get the bot going again. And sometimes the bot also swim in a very "robotic" way, he kind of jumps up and down in the water. This stops once he reaches land and only occurs once like ever 5th pickup or so, and always only during the swim back from the crystal. Am I doing something wrong?

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

Re: Improve code for the elfs daily quest

#12 Post by rock5 » Sun Nov 07, 2010 9:32 pm

Jengoso wrote:Actually I have another question, when running Swietlowkas script it works well most times, but sometimes the bot misses to harvest the crystal (the harvesting gets cancelled) and then he just stands there. I then have to manually harvest it to get the bot going again. And sometimes the bot also swim in a very "robotic" way, he kind of jumps up and down in the water. This stops once he reaches land and only occurs once like ever 5th pickup or so, and always only during the swim back from the crystal. Am I doing something wrong?
That's because the target_Object command is not set properly. Seeing as there is a check for the quest, it should only target once so it shouldn't be using the 3rd argument. By using the third argument it assumes it it an item that disappears so it ignores it on the next scan. If you don't use the 3rd argument it wont ignore it and should work fine. You don't even need the 2nd argument anymore because target_Object waits for the casting bar to disappear now.

Code: Select all

   <!-- # 12 --><waypoint x="31419" z="5728" tag="pick">    player:target_Object(112976);
  • 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

Jengoso
Posts: 20
Joined: Sun Oct 24, 2010 5:05 am

Re: Improve code for the elfs daily quest

#13 Post by Jengoso » Mon Nov 08, 2010 4:33 am

Works fine now. You are the best Rock! Thank you

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

Re: Improve code for the elfs daily quest

#14 Post by swietlowka » Mon Nov 08, 2010 4:38 am

u could easily make the bot run smother in the water just record the path and replace it ;)
if u do that upload your tweake code plox ;)

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

Re: Improve code for the elfs daily quest

#15 Post by mayainverse » Sat Jan 15, 2011 3:10 am

hm. i saw what rock posted but couldnt find that part of code exactly in the waypoint file u listed. did you edit your post after? because i still get the hanging up when it fails to collect object

so like only first 20% of your waypoint file is the daily. what is the part with mailbox for and the whole extra if player lvl > 10 thingused for?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Improve code for the elfs daily quest

#16 Post by lisa » Sat Jan 15, 2011 3:41 am

mayainverse wrote:hm. i saw what rock posted but couldnt find that part of code exactly in the waypoint file u listed. did you edit your post after? because i still get the hanging up when it fails to collect object

so like only first 20% of your waypoint file is the daily. what is the part with mailbox for and the whole extra if player lvl > 10 thingused for?
The line is there, did you scroll down?
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: Improve code for the elfs daily quest

#17 Post by mayainverse » Sat Jan 15, 2011 4:50 am

Code: Select all

 <!-- # 12 --><waypoint x="31419" z="5728" tag="pick">    player:target_Object(112976,7000,true);
       repeat queststate = getQuestStatus(questname); yrest(500) until queststate
        if queststate == "complete" then
          __WPL:setWaypointIndex(__WPL:findWaypointTag("return"));
        else __WPL:setWaypointIndex(__WPL:findWaypointTag("pick"));
      end
they player:target_Object(112976,7000,true) is different then what rock posted so i am assuming hewent back and edited his post after the fact.

where can i get the loadprofile:tiering sounds nice tohave.

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

Re: Improve code for the elfs daily quest

#18 Post by swietlowka » Sat Jan 15, 2011 4:57 am

profile tiering is a default one but named for purpose of that script, i made there an onload event to easily start with the waypoint "poczta" for the bot to run on start there and take all mail, i was suppose to add fusion control and resend made stone to my main but i left the project...

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

Re: Improve code for the elfs daily quest

#19 Post by mayainverse » Sat Jan 15, 2011 5:14 am

so then i should delete everything after the daily quest section?

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

Re: Improve code for the elfs daily quest

#20 Post by swietlowka » Sat Jan 15, 2011 2:45 pm

not if u want to use it somehow

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests