Working with quests, extended edition

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Working with quests, extended edition

#1 Post by Nero » Tue Oct 18, 2011 3:10 am

Seeing as I've been working on automating quests, I've decided to share what I learned with you guys. With that info, you can successfully write about 95% of quests in-game, although automating even a few quests is a huge time-investment, and honestly - it's not really worth it if you want to level some characters up. But if you decide to do so for any particular reason, it should help you with it - and there are quests that are worth automating, such as the ystra package, or even some dailies.

So, lets start!



1. Things you'll need

>working QuestByName userfunction, to be found here http://www.solarstrike.net/phpBB3/viewt ... =27&t=2184
If you use it correctly, you do not need any addons that auto-accept quests etc - this will work by itself.

> common sense



2. Working with quests

There are a few things to use when you want to automate a long sequence of moves - even doing a few quests usually takes ALOT of waypoints, and mistakes find their way in quite often. Do yourself a favor and get Notepad++.

Okay, now for the good things:

Code: Select all

		player:mount();
Pretty basic, and useful when your bot travels between quests. No need to explain, I hope.


To unmount, I use personally

Code: Select all

		CancelBuff(" mount name ");
it requires the userfunction CancelBuff, to be found on rombot wiki under 'functions' - but you could just use some skill or potion and it would work just as well. CancelBuff works for me as I can easily find when I'm unmounting if there's any problem with that.



Code: Select all

		AcceptAllQuests();
		yrest(500);
Accepts all quests that the NPC you're talking with can offer. Pretty straightforward. Some short rest is useful at the end.

Code: Select all

		CompleteQuestByName("Name",x);
		yrest(500);
Completes one quest by specified part of the name (here on the example of 'Name') - you need to write only a part of the whole name - if you had a quest called 'Working with quests', function will work whether you would write ("Working",x); , ("with",x); , ("quests",x); , or even ("work",x); .

This also lets you choose the reward - it's the part after naming the quest ("Name",x), where x is the number of prize that you want to choose (1 is for the first, 2 for the second etc).



Code: Select all

		sendMacro("ChoiceOption(1);");
When talking with NPC, it will choose the first option that there is. Doesn't work on every npc, but works on every 'talk' with NPC I've used it on. If you need to use a few answers in sequence, you should add some rest between it - I use 1,5 sec, as I rarely need it, and one minute of every two hours doesn't really matter to me.


Code: Select all

		if( player.Level > 4 ) then
			__WPL:setWaypointIndex(__WPL:findWaypointTag("circle"))	
		end
Checks whether some argument is true (in this case - if your level is higher than 4), and then reacts accordingly (in this case, going to WP with the tag 'circle'). Might be used to swap equipment, load different waypoint, etc, etc.


Code: Select all

		inventory:useItem("Name"); yrest(500);
This code will use specified item - it can either be used with ("Item name"), or (ID). Short rest for recreational purpose. Might be used to use some kind of a potion, quest item, piece of armor (it will equip it) etc.


Code: Select all

	<!-- #  1 --><waypoint x="   " z="   " y="   "	        tag="circle"		type="TRAVEL">
Two things to learn here.

> tag="circle" - will of course 'tag' waypoint, so that you can go to it later with __WPL:setWaypointIndex(__WPL:findWaypointTag("circle"))

> type="TRAVEL" - will set that particular waypoint to 'travel' type. Also accepts "RUN" or "NORMAL".



Code: Select all

		local queststate = getQuestStatus("name") -- quest name
			if queststate == "complete"   then -- checks if quest is complete
				__WPL:setWaypointIndex(__WPL:findWaypointTag("success"))	
			end
When you add it to waypoint, it will create local 'queststate', whose value will be of getQuestStatus("name"). Next line checks whether that quest is complete, and if it is - it goes to waypoint with tag="success" (of couse, what it does when quest is complete is up to you).

Might check few quests at once -

Code: Select all

		local queststate1 = getQuestStatus("quest1") -- quest name
		local queststate2 = getQuestStatus("quest2") -- quest name
			if queststate1 == "complete"   and   queststate2 == "complete"  then -- checks if both quests are complete
				__WPL:setWaypointIndex(__WPL:findWaypointTag("circle"))	
			end

Code: Select all

if queststate ~= "complete"   then -- checks if quest is not complete
one sign modified, it will check if said quest has any other state than completed. If it is not, you can do another round with loading appropriate tag, sound an alarm or any other code you're interested in.


Code: Select all

			local questitem = inventory:getItemCount("name") -- item name
				if  questitem >  9  	then		-- checks if more than 9
				    loadPaths("part 2");
			end
This code will check if you have the specified number if items with "name" in your inventory. If it does (in this case, if you have more than 9 of them), it returns true and does additional code (in this case - loads waypoint 'part 2').

inventory:getItemCount() accepts either a ("name"), or (ID).



Code: Select all

		changeProfileOption("ANTI_KS", false);
		changeProfileOption("COMBAT_DISTANCE", 50);
		changeProfileOption("MAX_TARGET_DIST", 50);	
		changeProfileOption("LOOT", false);
Few things that you can modify your profile options in the current waypoint (and if I'm not mistaken, it carries onto the next waypoint if it's been loaded with loadPaths() ). In this case, it will set our ANTI_KS to false, make our combat distance and target distance very short, and our bot won't loot killed monsters.


Code: Select all

		player:target_Object("name") 
		yrest(700);
Will target ("name") or (ID) and harvest it, provided they are nearby. Rest after it is just to appear more human-like - bot automatically reserves enough time to gather the specified resource before it goes into code in the next line.


Code: Select all

		levelupSkill("MAGE_FLAME", 1)  -- raises flame lvl by 1
This will raise your "Flame" skill by one level, each time it is used. When you change 1 into 5 - it will level it five times.



Code: Select all

		__WPL:setForcedWaypointType("TRAVEL");	
This code will change all of your following waypoints to 'TRAVEL' type, without the need to add it manually. If you use it in wp#1, but start bot from wp#2 - it won't work. If you do use it in wp#1 to set your waypoints to 'TRAVEL' , it will only change all waypints from wp#2 onwards - waypoint number one will be normal. When you load next waypoint file, the type will go back to normal.

Useful when you need to change type of large amount of waypoints several times over - instead of copying type="TRAVEL' or 'RUN' or 'NORMAL', over and over again, you need only to use it once.



Code: Select all

		if	player:haveTarget() == true	then
			inventory:useItem(ID);		
		end
This will check whether you have target, and if you do - it will do additional code (here, it will use item (ID) from your inventory). There is no possibility of using it in the middle of the battle, unless your WP manually uses player.castSkill() and checks for target's HP every hit.

If you need to use any item on mob, and he has to have HP lower than 50%, you better look up this thread http://www.solarstrike.net/phpBB3/viewt ... tem#p26163. I've never used it personally, but it seems easy enough.


3. Additional useful things and info

Some NPC's can't be targeted via name - you need to use ID's. Also applies to some items. It might, however, be some kind of a problem with special character in their names - alas, I've just used ID's to make it work.

http://www.solarstrike.net/phpBB3/viewt ... =27&t=2849
Here is the cleanbag userfunction. If you can change it to clean additional ID's specified by you (I think I know how it should work with rock5's explanation in the last post, but don't have time right now to attempt it), it should be a great help to delete left-over quest items and random trash.

GMDetect might also be useful, just in case http://www.solarstrike.net/phpBB3/viewt ... =27&t=2516

Also, I've personally found that certain sound notifications are EXTREMELY useful all around when botting, and currently have eight different 'warnings' that I use. If you have any part that needs to be done manually, http://www.solarstrike.net/phpBB3/viewt ... rce#p16903 is your friend (and remember to install OpenAl !)



Well, that's pretty much it. Almost all of it can be found floating around on forums, but I think it's better if it is in one place. Cheers

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

Re: Working with quests, extended edition

#2 Post by lisa » Tue Oct 18, 2011 4:37 am

Looks like a lot of thought and effort went into it, nicely done. Might concider topic name change though, you talk about more then just quests =)
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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Working with quests, extended edition

#3 Post by kanta » Tue Oct 18, 2011 5:55 pm

I've had some issues when turning in quests that when I get to the location of the NPC I need to talk to is not spawned yet. If it takes too long to spawn the bot will move to the next waypoint. I use the following code to avoid this problem.

Getting the quest:

Code: Select all

         player:target_NPC("Michelle Kudd");
         repeat player:target("Michelle Kudd");
         AcceptQuestByName("If I Persevere");
         until getQuestStatus( "If I Persevere" ) == "incomplete"
Turning the quest in:

Code: Select all

      repeat player:target_NPC("Michelle Kudd");
      CompleteQuestByName("If I Persevere");
      until getQuestStatus( "If I Persevere" ) == "not accepted"
Scout/Knight/Rogue 70/66/66

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

Re: Working with quests, extended edition

#4 Post by lisa » Tue Oct 18, 2011 9:16 pm

I see an issue with that, if it is a daily quest and you have done all 10 and not checked to see if your dailies are done it will sit there forever.

If quest isn't a daily and you have already completed it, again it will sit there forever.

Maybe add in a max time and make bot go into pause mode?
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

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Working with quests, extended edition

#5 Post by kanta » Tue Oct 18, 2011 10:03 pm

I hadn't thought of that. It's true, I do use that for my daily script and I have a count check.

Code: Select all

   <!-- #  1 --><waypoint x="-6757" z="43435" y="545">
   __WPL:setForcedWaypointType("NORMAL")
      local dailyQuestCount, dailyQuestsPerDay = RoMScript("Daily_count()");
      if (dailyQuestsPerDay > dailyQuestCount) then
         player:target_NPC("Michelle Kudd");
         repeat player:target("Michelle Kudd");
         AcceptQuestByName("If I Persevere");
         until getQuestStatus( "If I Persevere" ) == "incomplete"
      else
         error("Bot finished", 0);
      end
   </waypoint>
Not sure how to implement a wait timer. I pretty much check code in other waypoints and figure out how something is used then adjust for my own use.
Scout/Knight/Rogue 70/66/66

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

Re: Working with quests, extended edition

#6 Post by lisa » Tue Oct 18, 2011 10:55 pm

for a maxwait time, need to define a maxtime and also the the time before loop is started. It is also good to add in a little rest in any loop, even 500 milliseconds

Code: Select all

local _time = os.time()
local maxwait = 30 -- probably in seconds
repeat
player:target("Michelle Kudd");
AcceptQuestByName("If I Persevere");
yrest(500)
until getQuestStatus( "If I Persevere" ) == "not accepted" or os.time() - _time >= maxwait
so loop will break after 30 seconds, then you need to decide what to do after it breaks =)
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

User avatar
Nero
Posts: 98
Joined: Wed Aug 10, 2011 9:07 am

Re: Working with quests, extended edition

#7 Post by Nero » Wed Oct 19, 2011 1:07 am

Actually, when you target NPC via ID, you can talk to every NPC in-game (as long as you're close to their position), even though they're not visible on your character. Some of them you can interact with, some of them you can't - but it's worth checking out.

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

Re: Working with quests, extended edition

#8 Post by lisa » Wed Oct 19, 2011 1:29 am

Yeah I would use the player:target_NPC if I did code, I just copy pasted from the previously posted code and added in the timer.
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

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

Re: Working with quests, extended edition

#9 Post by rock5 » Wed Oct 19, 2011 1:58 am

kanta wrote: player:target_NPC("Michelle Kudd");
repeat player:target("Michelle Kudd");
AcceptQuestByName("If I Persevere");
until getQuestStatus( "If I Persevere" ) == "incomplete"
You don't need the first "target_NPC". Just the one will do.
  • 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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Working with quests, extended edition

#10 Post by imaginethat » Wed Jan 11, 2012 11:11 pm

Hi
How do you determine if you have already completed a quest.

I am starting to look at creating a few quest files to add to my bot as it goes through the levels.
I can see how you can determine the quest state

Code: Select all

local queststate = getQuestStatus("name")
If quest state is "complete", it means you currently have it in your quest log, and you have fulfilled all quest requirements, ready for hand in..
If quest state is "incomplete", it means you currently have it in your quest log, and you have not yet fulfilled all quest requirements.

What states are there for:
1. not in your quest log, and incomplete
2. not in your quest log, and complete.

Basically I'm trying to determine if I have already done a quest, or should I load a file to go do it.

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

Re: Working with quests, extended edition

#11 Post by rock5 » Thu Jan 12, 2012 12:30 am

There is an in game function for that. Let me see if I can find it.

Here it is
http://www.theromwiki.com/API:CheckQuest

You have to use RoMScript to use it.
  • 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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Working with quests, extended edition

#12 Post by imaginethat » Thu Jan 12, 2012 3:57 am

awesome, thanks Rock5
so the code would look something like this?

Code: Select all

-- Check if quest 'Love Express' has been accepted
_queststate = RoMScript(CheckQuest(123456))
if _queststate == 1 then
   -- Quest has been accepted
elseif _queststate == 2 then
  -- Quest has already been done
else
  -- Still need to accept quest
end
Thanks

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

Re: Working with quests, extended edition

#13 Post by lisa » Thu Jan 12, 2012 4:26 am

close

Code: Select all

_queststate = RoMScript("CheckQuest(123456)")
you need the " " in there
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

imaginethat
Posts: 61
Joined: Sun Jul 10, 2011 10:39 pm

Re: Working with quests, extended edition

#14 Post by imaginethat » Thu Jan 12, 2012 4:54 pm

thanks Lisa, much appreciated

Post Reply

Who is online

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