Page 1 of 1

My Guild Contribute isn't working from bot

Posted: Tue Apr 19, 2011 3:53 pm
by MiesterMan
So I wrote a couple of functions in my manualaddon:

Code: Select all

function GetItemBagSlot(_itemName)
	for i=1,180,1 do
		local inventoryIndex, icon, itemName, itemCount, locked, invalid = GetBagItemInfo ( i )
		if itemName == _itemName then
			return inventoryIndex
		end
	end
	return "empty"
end

function GuildContributeItem(_itemName)
	slot = GetItemBagSlot(_itemName)
	PickupBagItem(slot)
	GCB_GetContributionItem()
	GCB_ContributionItemOK(0,0)
end
These work fine when I use them in game like: /script GuildContributeItem("Copper Ore");
That works fine but when I try to use it through the bot it doesn't work. I don't get an error message in game or in the bot so I'm at a loss.

The code in my waypoint is:

Code: Select all

		if( donateMats ) then
			sendMacro("GuildContributeItem("Dusk Orchid");")
			yrest(500)
			sendMacro("GuildContributeItem("Pine Wood");")
			yrest(500)
			sendMacro("GuildContributeItem("Dark Crystal");")
			yrest(500)
		end
		sendMacro("GuildContributeItem("Guild Rune");")
The donateMats variable I set in my profile under onLoad, also no errors.

Re: My Guild Contribute isn't working from bot

Posted: Tue Apr 19, 2011 9:28 pm
by rock5
You can't have double quotes inside double quotes. I'm surprised there wasn't an error.

You can use single quotes in double quotes like this

Code: Select all

        sendMacro("GuildContributeItem('Dusk Orchid');")
or you can use the slash '\' to have it read as a string instead of the end of the quotes

Code: Select all

        sendMacro("GuildContributeItem(\"Dusk Orchid\");")
Both should work.

Re: My Guild Contribute isn't working from bot

Posted: Wed Apr 20, 2011 6:24 am
by MiesterMan
Thank you very much!!! That was maddening.

I can't do it right now cause I just woke up and the server just went down but I believe you. Now that I think of it I don't understand why the bot didn't give some sort of "junk after statement" error. Or does it only do that for messed up xml statements in the waypoint files?

Re: My Guild Contribute isn't working from bot

Posted: Wed Apr 20, 2011 12:06 pm
by lisa
Yeah the things it checks for functions is different to what it checks for WP.

you could always try my old guild donate function

http://www.solarstrike.net/phpBB3/viewt ... =27&t=2207