Page 2 of 5

Re: Rock5's ToDo list

Posted: Tue Dec 07, 2010 9:12 am
by swietlowka
ekhm, i belive its agruments are the npc namem just tryi it ;)

Re: Target Specific Mobs

Posted: Tue Dec 07, 2010 9:56 am
by rock5
jduartedj wrote: How do I tell player:target() to target the result from player:findNearestNameOrId()? does player:target() take any arguments?
player:target() accept an address or pawn. player:findNearestNameOrId() returns an object which is basically the same as a pawn but with less info. What player:target() needs is the address which objects have. So ...

Code: Select all

targetObj = player:findNearestNameOrId(arguments)
player:target(targetObj)
-- or
player:target(targetObj.Address)

Re: Target Specific Mobs

Posted: Tue Dec 07, 2010 10:08 am
by jduartedj
rock5 wrote:
jduartedj wrote: How do I tell player:target() to target the result from player:findNearestNameOrId()? does player:target() take any arguments?
player:target() accept an address or pawn. player:findNearestNameOrId() returns an object which is basically the same as a pawn but with less info. What player:target() needs is the address which objects have. So ...

Code: Select all

targetObj = player:findNearestNameOrId(arguments)
player:target(targetObj)
-- or
player:target(targetObj.Address)

thank you vmuch ! this simplifies many of my scripts xD... and to think it's so simple!

Re: Rock5's ToDo list

Posted: Fri Jan 07, 2011 7:03 pm
by rock5
My work on an updated version of lootBodies and also the chicken egg script has been hampered by a bug in the bot that causes the client to crash. It's taken me ages to figure out.

I've fixed that in 554. The fix may also have fixed other peoples issues with the client occasionally crashing (or may not). So if you are having client crashes, try it out.

With the current lootbodies, I'm aiming at a function that can handle all situations and wont get stuck. It's looking good so far. I'll be releasing it soon. With the way it's working now, I can foresee it could be added to the bot in the future.

With the chicken script I may hold off until I implement buying crafting tools so I can incorporate that as well.

Re: Rock5's ToDo list

Posted: Mon Jan 10, 2011 3:58 am
by lisa
I see moving house is still at 65%, you must have a lot of stuff lol

Re: Rock5's ToDo list

Posted: Mon Jan 10, 2011 6:18 am
by rock5
lisa wrote:I see moving house is still at 65%, you must have a lot of stuff lol
He he. I've moved but I still have a lot of junk there. I wont count the move complete until everything has been cleared away and I can get tenants in there. But there are interruption. For instance I fractured my thumb about 3 weeks ago. Still healing but I'm also lazy so that doesn't help :)

The main reason I have that in my list, just so you know, is so people know why I'm not tackling the bigger projects. When I finish moving I'll have more time.

Re: Rock5's ToDo list

Posted: Mon Jan 10, 2011 8:04 pm
by lisa
I know how you feel, I did same thing to my thumb about 4 years ago, spent 5 weeks playing FFX on PS2 as I couldn't do much else lol

Pet crafting issue at max level

Posted: Tue Jan 11, 2011 3:52 pm
by Alkaiser
Having a problem with pet crafting. A pet has reached max crafting level, and now only produces Ash Wood... though it should still default to the highest level material, right?

Re: Pet crafting issue at max level

Posted: Tue Jan 11, 2011 6:26 pm
by rock5
Alkaiser wrote:Having a problem with pet crafting. A pet has reached max crafting level, and now only produces Ash Wood... though it should still default to the highest level material, right?
This is not related to my list. Please start a new thread.

Re: Rock5's ToDo list

Posted: Wed Feb 02, 2011 2:24 am
by lisa
On the subject of quest by name, it would be possible to do up a huge table that had the values for each quest as to which option it would be depending on the lvl. I think this would work but no way I am spending the next month doing it lol

I notice you can check the actual status of the quest by using it's sys***_name, I wonder if there is a way to use that sys_name in our favour to accept the quest we want??

I notice the memory address changes for quests each time, however the sys***_ name remains the same and always preceeds the actual text in the quest.

Code: Select all

Stolen Tools.Sys420059_name_plural.Stolen Tools.Sys420059_szquest_accept_detail.
It then starts the actual text from the quest which appears when you click the quest.

Lol I just adjusted the memory for the quest text and it showed up. That is an easy way to do a practical joke or funny images.

This might be exactly what we are after, just need to make it into a function.

Code: Select all

http://www.theromwiki.com/API:GetQuestNameByIndex
I'll do some testing, cyclone won't hit my area for a few hours, just gusty winds atm lol

Re: Rock5's ToDo list

Posted: Wed Feb 02, 2011 10:44 am
by JackBlonder
Hey lisa. I followed your link and this is the result.
It accepts quests by name (_name) or all available quests (_all=true)

[Edit]:
Just added a second function to also complete quests.

Code: Select all

function AcceptQuestByName(_name, _all)
	_all = _all or false
	local questToAccept = _name or ""
	local questOnBoard
	
	-- Accepts all available quests
	if (_all == true) then
		for i = 1,sendMacro("GetNumQuest(1)") do
			sendMacro("OnClick_QuestListButton(1, "..i..")") -- Clicks the quest
			yrest(100)
			sendMacro("AcceptQuest()") -- Accepts the quest
		end
	
	-- Accepts a quest by quest name
	else
		for i = 1,sendMacro("GetNumQuest(1)") do
			questOnBoard = sendMacro("GetQuestNameByIndex(1, "..i..")")
			if questOnBoard == questToAccept then
				sendMacro("OnClick_QuestListButton(1,"..i..")") -- Clicks the quest
				yrest(100)
				sendMacro("AcceptQuest()") -- Accepts the quest
			end
		end
	end
end

function CompleteQuestByName(_name, _all)
	_all = _all or false
	local questToComplete = _name or ""
	local questOnBoard
	
	-- Complete all available quests
	if (_all == true) then
		for i = 1,sendMacro("GetNumQuest(3)") do
			sendMacro("OnClick_QuestListButton(3, "..i..")") -- Clicks the quest
			yrest(100)
			sendMacro("CompleteQuest()") -- Accepts the quest
		end
	
	-- Complete a quest by quest name
	else
		for i = 1,sendMacro("GetNumQuest(1)") do
			questOnBoard = sendMacro("GetQuestNameByIndex(3, "..i..")")
			if questOnBoard == questToComplete then
				sendMacro("OnClick_QuestListButton(3,"..i..")") -- Clicks the quest
				yrest(100)
				sendMacro("CompleteQuest()") -- Accepts the quest
			end
		end
	end
end

Re: Rock5's ToDo list

Posted: Wed Feb 02, 2011 7:28 pm
by rock5
Do you really need to use a second argument?

So if you want to accept all you have to do

Code: Select all

AcceptQuestByName(nil, true)
Wouldn't it be better to use just 1 argument like this

Code: Select all

AcceptQuestByName("all")
And then say

Code: Select all

if _name = "all" then
    do all 
else
    do only _name
end

Re: Rock5's ToDo list

Posted: Wed Feb 02, 2011 8:08 pm
by lisa
Nice work jack.


Code: Select all

		player:target_NPC("Logar Bulletin Board");
		AcceptQuestByName("Stolen Tools","")
gets this

Code: Select all

We try to find NPC Logar Bulletin Board:
We successfully target NPC Logar Bulletin Board and try to open the dialog windo
w.
Use MACRO: Executing RoMScript "GetNumQuest(1)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 1)".
Use MACRO: Executing RoMScript "OnClick_QuestListButton(1,1)".
Use MACRO: Executing RoMScript "AcceptQuest()".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 2)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 3)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 4)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 5)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 6)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 7)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 8)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 9)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 10)".
Use MACRO: Executing RoMScript "GetQuestNameByIndex(1, 11)".
With some tidying up I think this would be good addition to the bot.
What you think Rock5
Accept quest by name 95% complete?
lol

Re: Rock5's ToDo list

Posted: Wed Feb 02, 2011 8:12 pm
by rock5
Looking at that output, 2 things are obvious.

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.

BTW. Good to hear it looks like no one was hurt up there.

Re: Rock5's ToDo list

Posted: Thu Feb 03, 2011 2:55 am
by JackBlonder
Do you really need to use a second argument?
Not really. I'll change it.
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.
OK, I'll change this, too.

[Edit]:
My changed version:

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
What came to my mind though.
Sometimes there are quests where you have to choose a reward.
Any idea on how to implement this?

Re: Rock5's ToDo list

Posted: Sat Feb 12, 2011 10:58 am
by lisa
rock5 wrote:Guild function addon to send resources to guild.
This is mostly done :D
Well it does the resources just not the "guild" items

Re: Rock5's ToDo list

Posted: Sat Feb 12, 2011 7:56 pm
by rock5
Why don't you add the other stuff too? Runes and stones use the same method to add I believe. Then it's just a matter of working out the way to add money and rubies. I wouldn't be surprised if it's the same command.

I'll make a comment about your work but I'd still like to create a guild class at some time.

Re: Rock5's ToDo list

Posted: Sat Feb 12, 2011 8:19 pm
by lisa
adding gold is a different RoMScript, it's a very simple script. but reason I didn't add gold was I couldn't see the point in adding an automated gold donaton.

As for the other "guild" items the issue I had was I saw the function usage as basically the same as resources, need an arg for donating all or runes/rubies/stones. I just didn't see it fitting in with the resources for a single function call unless it was for all. I guess if I added another arg to that function to donate all the "guild" items or not then it would work ok.

Re: Rock5's ToDo list

Posted: Sat Feb 12, 2011 9:11 pm
by rock5
Yes I think a function for donating materials should only do that. The other stuff can be added later as different functions.

I thought of something though. What if a user whats to only send 1 type of resource to the guild? Eg. they have a bunch of materials in their inventory but only want to send the Ash Sand they just processed? They should be able to;

Code: Select all

GuildDonate("Ash","green")
Do you agree?

To do this I think all you have to do is change this

Code: Select all

		if ( _type == "all" and (item:isType("Ores") or item:isType("Herbs") or item:isType("Wood")) ) or 
			( _type ~= "all" and item:isType(_type) ) then
to this

Code: Select all

		if ( _type == "all" and (item:isType("Ores") or item:isType("Herbs") or item:isType("Wood")) ) or 
			( _type ~= "all" and item:isType(_type) ) or
			( string.find(item.Name,_type) ) then
Of course there is no way of processing materials automatically yet but there may be in the future. But this could also be used to get rid of those rare materials you can collect so you remain with only the good stuff :)

Re: Rock5's ToDo list

Posted: Thu Mar 24, 2011 4:38 am
by Tsutomu
Suggestion:

A "OnArrived" event would be highly appreciated! It would give a lot of power to the script.
I know that there is a place in each script to put what it should do after coming to the point, BUT
this would be the same generic action for all waypoints.
In scripts with a lot of waypts, it's very annoying putting stuff in every point, this would be very elegant resolvation, for ex.when player wants to check lootBodies(); after arriving on point.

Thank you for great script, wish you only best.
Regards.