JackBlonder wrote:Not really. I'll change it.Do you really need to use a second argument?
OK, I'll change this, too.1. RoMScript should be used instead of sendMacro so you don't get so much junk messages and
2. When searching for a quest name, once found it can break from the loop so it stops searching.
[Edit]:
My changed version:What came to my mind though.Code: Select all
function AcceptQuestByName(_name) _name = _name or "All" local questToAccept = _name local questOnBoard = "" local i -- Accept all available quests if (_name == "" or _name == "All" or _name == "ALL" or _name == "all") then printf("We accept all quests\n") for i = 1,RoMScript("GetNumQuest(1)") do RoMScript("OnClick_QuestListButton(1, "..i..")") -- Clicks the quest yrest(100) RoMScript("AcceptQuest()") -- Accepts the quest end -- Accept a quest by quest name else for i = 1,RoMScript("GetNumQuest(1)") do questOnBoard = RoMScript("GetQuestNameByIndex(1, "..i..")") if questOnBoard == questToAccept then RoMScript("OnClick_QuestListButton(1,"..i..")") -- Clicks the quest yrest(100) RoMScript("AcceptQuest()") -- Accepts the quest break end end end end function CompleteQuestByName(_name) _name = _name or "All" local questToComplete = _name local questOnBoard = "" local i -- Complete all available quests if (_name == "" or _name == "All" or _name == "ALL" or _name == "all") then for i = 1,RoMScript("GetNumQuest(3)") do RoMScript("OnClick_QuestListButton(3, "..i..")") -- Clicks the quest yrest(100) RoMScript("CompleteQuest()") -- Completes the quest end -- Complete a quest by quest name else for i = 1,RoMScript("GetNumQuest(1)") do questOnBoard = RoMScript("GetQuestNameByIndex(3, "..i..")") if questOnBoard == questToComplete then RoMScript("OnClick_QuestListButton(3,"..i..")") -- Clicks the quest yrest(100) RoMScript("CompleteQuest()") -- Completes the quest break end end end end
Sometimes there are quests where you have to choose a reward.
Any idea on how to implement this?
accept quest by name
accept quest by name
JackBlonder has been doing some great work, unfortunately I started it in Rock5's todo list so I decided it would be better to continue discussion in a new topic.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: accept quest by name
Thanks lisa.
Here's the userfunction file (is it possible now to name the userfunctions userfunction_xxx.lua instead of addon_xxx.lua?)
Here's the userfunction file (is it possible now to name the userfunctions userfunction_xxx.lua instead of addon_xxx.lua?)
- Attachments
-
- addon_QuestByName.lua
- (1.63 KiB) Downloaded 103 times
Re: accept quest by name
I've been testing this and it works great, just a few things that can be improved on.
1. The text for the quest name needs to be exact in every way. Wondering if we can work on making it work if not exact, like search for partial? So "stolen" would still work for "Stolen Tools" or atleast make it so doesn't need to be caps like "stolen tools"
2. Adding in a printf to print in MM window that the quest has been accepted.
3. Add in a printf for when there is no quest matching text.
4. The accept "All" seems to skip some and gets around half available, maybe add in a small pause after each accept?
Edit, yes you can use userfunction_xxx.lua (not plural) and we actually would prefer it =)
1. The text for the quest name needs to be exact in every way. Wondering if we can work on making it work if not exact, like search for partial? So "stolen" would still work for "Stolen Tools" or atleast make it so doesn't need to be caps like "stolen tools"
2. Adding in a printf to print in MM window that the quest has been accepted.
3. Add in a printf for when there is no quest matching text.
4. The accept "All" seems to skip some and gets around half available, maybe add in a small pause after each accept?
Edit, yes you can use userfunction_xxx.lua (not plural) and we actually would prefer it =)
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: accept quest by name
I've made some modifications.
Furthermore "-" in questnames are ignored. I'll add other special characters later.
Not done yet: Accepting just a part of the questname (like "stolen").
It now tries to accept until queststate is "incomplete" (means accepted)
Happy bug hunting
Every feedback is welcome
The function now accepts "Stolen tools", "stolen tools", "sToLEN tOOlS", etc.1. The text for the quest name needs to be exact in every way. Wondering if we can work on making it work if not exact, like search for partial? So "stolen" would still work for "Stolen Tools" or atleast make it so doesn't need to be caps like "stolen tools"
Furthermore "-" in questnames are ignored. I'll add other special characters later.
Not done yet: Accepting just a part of the questname (like "stolen").
Added.2. Adding in a printf to print in MM window that the quest has been accepted.
Added.3. Add in a printf for when there is no quest matching text.
I changed the routine of accepting and completing.4. The accept "All" seems to skip some and gets around half available, maybe add in a small pause after each accept?
It now tries to accept until queststate is "incomplete" (means accepted)
Happy bug hunting
Every feedback is welcome
- Attachments
-
- userfunction_QuestByName.lua
- (2.98 KiB) Downloaded 107 times
Re: accept quest by name
Very nice work yet again, one flaw with the
If you already have the requirements to hand in the quest then it hangs indefinately. Might need to add in "or complete" aswell.
I just did it like this, works well.
Rock5 any chance we can have this function added to next revision??
Code: Select all
until (getQuestStatus(questOnBoard)=="incomplete")
Code: Select all
until (getQuestStatus(questOnBoard)=="incomplete") or (getQuestStatus(questOnBoard)=="complete")
Rock5 any chance we can have this function added to next revision??
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: accept quest by name
Added this and removed a little copy paste bug.
[Edit]
Word comparison implemented.
Next step: reward selection
Usage:
AcceptQuestByName() --Accept all available quests
AcceptQuestByName("word") --Accept first quest in list with "word" in it's name
CompleteQuestByName() --Complete all available quests
CompleteQuestByName("word") --Complete first quest in list with "word" in it's name
I'll try to implement word compare nowCode: Select all
until (getQuestStatus(questOnBoard)=="incomplete") or (getQuestStatus(questOnBoard)=="complete")
[Edit]
Word comparison implemented.
Next step: reward selection
Usage:
AcceptQuestByName() --Accept all available quests
AcceptQuestByName("word") --Accept first quest in list with "word" in it's name
CompleteQuestByName() --Complete all available quests
CompleteQuestByName("word") --Complete first quest in list with "word" in it's name
- Attachments
-
- userfunction_QuestByName.lua
- (4.19 KiB) Downloaded 125 times
Re: accept quest by name
Awesome work yet again
Tested and works perfectly, I'll be the first to admit it is a lot better then I could have done =)
This might be of interest to you
http://www.theromwiki.com/API:SpeakFram ... uestReward
Tested and works perfectly, I'll be the first to admit it is a lot better then I could have done =)
This might be of interest to you
http://www.theromwiki.com/API:SpeakFram ... uestReward
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: accept quest by name
A few comments I'd like to make on this thread.
1. JackBlonder should have started it. Lisa you should have suggested he start a new thread instead of starting it yourself.
2. It should probably be added to the repo page.
3. The first post should be used for releasing new versions.
I'm not sure what should be done. Should I try moving JackBlonders second post to the top? Should he just start a new thread for his "repo" version? Maybe I could just delete Lisas first post so JackBlonder is first?
1. JackBlonder should have started it. Lisa you should have suggested he start a new thread instead of starting it yourself.
2. It should probably be added to the repo page.
3. The first post should be used for releasing new versions.
I'm not sure what should be done. Should I try moving JackBlonders second post to the top? Should he just start a new thread for his "repo" version? Maybe I could just delete Lisas first post so JackBlonder is first?
- 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
Re: accept quest by name
You are absolutely right Rock5.
I think best way to go forward would be for Jackblonder to create a topic in the userfunctions section and attach his latest file to that post and go from there.
Adding it to the repository is also a very good idea and link it to the new topic in userfunctions section.
I think best way to go forward would be for Jackblonder to create a topic in the userfunctions section and attach his latest file to that post and go from there.
Adding it to the repository is also a very good idea and link it to the new topic in userfunctions section.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
-
- Posts: 99
- Joined: Sat Dec 18, 2010 6:55 am
Re: accept quest by name
No problem. I'll start a new thread and set a link to it here and at the repo page.
Who is online
Users browsing this forum: Ahrefs [Bot] and 3 guests