Page 1 of 1
CompleteAllQuests() problem
Posted: Wed Oct 22, 2014 11:30 am
by beanybabe
I tried to use CompleteAllQuests() on some pubilc/daily npcs and it would just get stuck.
This is how I tried to use it. So it would complete any open quests, then get more. I went back to ...questbyname for now.
...
player:target_NPC(xxx)
CompleteAllQuests()
AcceptAllQuests()
....
Re: CompleteAllQuests() problem
Posted: Wed Oct 22, 2014 11:49 am
by rock5
Are you using my QuestLogClass userfunction? If so, is it the latest version?
Re: CompleteAllQuests() problem
Posted: Thu Oct 23, 2014 9:54 pm
by beanybabe
I was on ver.5 the current version was .6 was not even aware that was from a user function. here is link if anyone else needs
http://solarstrike.net/phpBB3/viewtopic ... gClass.lua
AT one time I seen someone was working on way to check if user functions were update. Is there some easy way to check all of these? Some that I have may be old.
I'm finally starting to get the code a bit more and able to make more usable scripts.
Re: CompleteAllQuests() problem
Posted: Thu Oct 23, 2014 11:30 pm
by rock5
The QuestLogClass userfunction is not required for using the QuestByName functions. It's main purpose is just to provide more information about quests such as number of goals completed. But the QuestLogClass has a version of getQuestStatus that gets the status from memory. It took a few versions to get this working properly. The QuestByName functions use getQuestStatus so if you have an old version of QuestLogClass then it might cause the QuestByName functions not to work properly.
So I repeat, you don't need the QuestLogClass userfunction unless you need the extra information. I believe the QuestByName functions work correctly with the bots version of getQuestStatus.
As to when to update, it's pretty easy. If you have a problem, see if there is an update. Lisa set up a repository with some common userfunctions but I don't know if she still maintains it
http://solarstrike.net/phpBB3/viewtopic ... 111#p47111. There was also a file repository in the wiki - which was a good idea - but no one ever uses it anymore.
http://www.solarstrike.net/wiki/index.p ... Repository
Re: CompleteAllQuests() problem
Posted: Fri Oct 24, 2014 12:43 pm
by beanybabe
strange on updateing QuestLogClass this stoped working
CompleteQuestByName(####,"public") I used public to stop completed daily problems
AcceptQuestByName(####,"public")
This works though.
CompleteQuestByName(####)
AcceptQuestByName(####,"public")
strange problem.
Re: CompleteAllQuests() problem
Posted: Fri Oct 24, 2014 12:52 pm
by rock5
I think the best solution to do the right quest is to use the quest id. The daily and public use different ids.
Re: CompleteAllQuests() problem
Posted: Sun Oct 26, 2014 4:58 am
by beanybabe
ok i went back to the .5 version the .6 version messes up.
this "wf FjordMadBull swaping.xml" worked in 5. it will set at the quest bulletin board and just loop with .6
I ran a compare between 5 and 6 with notepad++ but that code is to complicated for me to follow yet.
this is a snip of mad bull that it must be affecting.
Code: Select all
function getquest()
quest = questlog:haveQuest(426557, questtype) -- Wanted: "Guargo the Mad Bull"
if quest == false then
repeat
player:target_Object(122806) -- Port Bulletin Board
yrest(100)
AcceptQuestByName(426557)
yrest(200)
until questlog:haveQuest(426557, questtype)
end
end
function completequest()
quest2 = questlog:getQuest(426557, questtype)
if quest2:isComplete() then
repeat
player:target_NPC(122760) -- Chuck Willis
yrest(200)
CompleteQuestByName(426557) -- Wanted: "Guargo the Mad Bull"
until not questlog:haveQuest(426557, questtype)
end
local roundTime = os.time()-restartTime
cprintf (cli.pink,"Time spend for this round: %s Seconds\n",roundTime)
restartTime = os.time()
questsCompleted = questsCompleted + 1
averageTime = (os.time()-time)/questsCompleted
cprintf (cli.yellow,"Average time per round: %s Seconds\n",averageTime)
checkToDoMore()
end