Working with quests, extended edition
Posted: 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:
Pretty basic, and useful when your bot travels between quests. No need to explain, I hope.
To unmount, I use personally
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.
Accepts all quests that the NPC you're talking with can offer. Pretty straightforward. Some short rest is useful at the end.
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).
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.
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.
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.
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".
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 -
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.
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).
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.
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.
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.
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.
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
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();To unmount, I use personally
Code: Select all
CancelBuff(" mount name ");Code: Select all
AcceptAllQuests();
yrest(500);Code: Select all
CompleteQuestByName("Name",x);
yrest(500);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);");Code: Select all
if( player.Level > 4 ) then
__WPL:setWaypointIndex(__WPL:findWaypointTag("circle"))
endCode: Select all
inventory:useItem("Name"); yrest(500);Code: Select all
<!-- # 1 --><waypoint x=" " z=" " y=" " tag="circle" type="TRAVEL">> 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"))
endMight 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"))
endCode: Select all
if queststate ~= "complete" then -- checks if quest is not completeCode: Select all
local questitem = inventory:getItemCount("name") -- item name
if questitem > 9 then -- checks if more than 9
loadPaths("part 2");
endinventory: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);Code: Select all
player:target_Object("name")
yrest(700);Code: Select all
levelupSkill("MAGE_FLAME", 1) -- raises flame lvl by 1Code: Select all
__WPL:setForcedWaypointType("TRAVEL"); 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);
endIf 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