Guild Donation

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Message
Author
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Guild Donation

#1 Post by lisa » Wed Feb 09, 2011 7:06 am

V 1.43 done by Rickster

I did an update to lisas userfunction.
The idea was, to make the function work, independant from localisation and is based on the idea that itemtypestable.lua is build independant from localised clients ... please report, if this is not.

I tested this version on a german client. As I am not very good in things like coding and testing, this version is released as beta. Please feel free to report any bugs.
The main benefit goes to rock5 and lisa, who helped me in other threads on questions regarding to this topic.

It mainly contains lisas code with following changes:
  • using itemtypestable.lua for localised names
  • searches only backpacks 1-6 for ressources
  • donates woods, ores, herbs
  • minor changes for checking _type and _quality
For usage instructions I will mainly quote lisas first post:

This is a userfunction created for the purpose of donating gathered resources to your guild, inluding quality 8 guild resources from mini games.
It does not cover guild runes / guild stones / guild rubies, it is purely for herb / ore / wood.

Usage:

Code: Select all

	GuildDonate(arg1, arg2, arg3)
  • arg1 is the type of resource "ore", "wood", "herb" or "all"
  • arg2 is the quality "white"(0), "green"(1) "blue"(2), "purple"(3), "orange"(4), "gold"(5)
    You can also use numbers from 0-15 without quotes.
    To use mini game resources use 8 witout quotes.
  • arg3 is if you want to also donate lesser quality "true", defaults to "false"
arg1 and arg2 are mandatory in conjunction!!! You cant use one without the other!
This is, because users have to be sure what they want to donate!

Examples

Code: Select all

GuildDonate()
equals

Code: Select all

GuildDonate("all", 15, "true")
Donates all resources up to quality 15. This includes all ressources, also the mini game resources.

Code: Select all

GuildDonate("ore", "green")
Will donate all Ore of green quality only.

Code: Select all

GuildDonate("herb","blue","true")
Will donate all Herbs of blue & green & white quality.

Code: Select all

GuildDonate("all", "green")
Will donate all resources of green quality only.
userfunction_GuildDonate.lua
V 1.43 by Rickster
(3.79 KiB) Downloaded 367 times
Ric

V 1.44 again by Rickster
same old functions plus added a new function with a table as argument.
example.

Code: Select all

GuildDonateItems({"Guild Stone", "Guild Rune", "Handcrafted Ruby"})
userfunction_GuildDonate.lua
V 1.44 by Rickster
(3.94 KiB) Downloaded 302 times
Last edited by lisa on Tue Jun 21, 2011 1:46 am, edited 3 times in total.
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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Guild Donation

#2 Post by lisa » Thu Feb 10, 2011 9:07 am

Fixed an error that made the quality always be "white"
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

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Guild Donation

#3 Post by rock5 » Thu Jun 09, 2011 2:33 am

I found a bug.

I finally started using this addon. I added it to my logar crafting script. I added "GuildDonate("herb", "green")", "GuildDonate("ore", "green")" and "GuildDonate("wood", "green")" after the relevant crafting.

It didn't donate just the resource specified. It donated all. The problem is line 34. It should be.

Code: Select all

	if _type ~= "Herbs" and _type ~= "Wood" and _type ~= "Ores" then _type = "all" end
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Guild Donation

#4 Post by lisa » Tue Jun 21, 2011 1:47 am

weird I thought I fixed that ages ago, I must have not changed it when I did the last version =(

All fixed now, thanks
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

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Guild Donation

#5 Post by Germangold » Tue Feb 14, 2012 3:16 pm

hey lisa
unfortunately your functions doesnt work anymore for me

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Guild Donation

#6 Post by rock5 » Wed Feb 29, 2012 11:22 am

Does this function still work. Tried to use it today, didn't work.

Edit: Never mind. It works. The resources I was trying to contribute were quality 8. The function defaults to quality 5 or below. So this worked,

Code: Select all

GuildDonate(nil,8)
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Guild Donation

#7 Post by Rickster » Mon Mar 05, 2012 1:38 pm

I have a problem getting this function to work. The file is corectly placed, wehre the other userfunctions are, too.

i use this code iin the wp file

Code: Select all

GuildDonate("all", "purple");
it is completly overrun, no windows open, no mm messages.

am i missing something?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Guild Donation

#8 Post by rock5 » Mon Mar 05, 2012 2:59 pm

Are you sure the items are purple? Where did you get them from?
  • 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

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Guild Donation

#9 Post by Germangold » Mon Mar 05, 2012 3:37 pm

i have problems too
maybe german language wont work

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Guild Donation

#10 Post by Rickster » Mon Mar 05, 2012 6:50 pm

rock5 wrote:Are you sure the items are purple? Where did you get them from?
i am sure. but i also tried

Code: Select all

GuildDonate("all", "purple", "true");
which also does not work. the function is overrun, without anything happening in the game client or any indications in the MM window.

The resources are from Ancient Treasure mini game.
As the AT mini game WP is nearly working perfect now :) ... i also want to automate the guild resource donation. but i would prefer to donate from my own wp file, not from AT.xml

I already told in the AT thread, that i tried to donate only once from rocks AT wp file, until i recognised the need of the donate userfunction ;) ... but with the userfunction it does not donate either :(

but as pointed out, i want to get it workinig in my own wp files.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Guild Donation

#11 Post by lisa » Mon Mar 05, 2012 7:40 pm

I just use this for AT

Code: Select all

			--=== guild donate resources ===--
			inventory:update()
			yrest(2000)
			for slot, item in pairs(inventory.BagSlot) do
				if item.Id == 206590 or item.Id == 206591 or item.Id == 206592 then
					RoMScript("PickupBagItem("..item.BagId..")")
					RoMScript("GCB_GetContributionItem(n)")
					if RoMScript("CursorHasItem()") then
							RoMScript("PickupBagItem("..item.BagId..")")            -- Put it back in the bag
					else
							RoMScript("GCB_OnOK()")
					end	
				end
			end
Haven't updated this userfunction but chances are the IS resources like you get from AT don't come under the type == "Ores", I might get time to update it next week.


I look at this code I did over 9 months ago and think "omg so many things are so wrong in it" lol
Sure it works but it is such a mess in setting out, the print to say it donated happens even if it doesn't donate because the prints are in the wrong places.
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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Guild Donation

#12 Post by Rickster » Mon Mar 05, 2012 8:47 pm

hehe ;) ok, i look forward to it.

the AT resources have the same resource tooltips, than normal wood, ore and herbs (german client)

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Guild Donation

#13 Post by rock5 » Mon Mar 05, 2012 8:55 pm

Well the resources from AT mini game are not "purple". "purple" are level 3 quality such as purple armor and weapons. The AT resources are like item shop items. They are level 8 quality. They might be purplish but not "purple". That's why in the AT script I used "GuildDonate(nil,8)". GuildDonate only supports upto "gold" quality (quality 5) using words; "green", "blue", "purple", "orange" and "gold". Anything higher and you have to use the number.

I hope that has cleared it up for you.
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Guild Donation

#14 Post by Rickster » Mon Mar 05, 2012 8:59 pm

yes, thats fine for me :)
ok, i will try tomorrow, if this works with the ancient treasure resources.

how do you figure out which quality number belongs to a real ingame item color?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Guild Donation

#15 Post by rock5 » Mon Mar 05, 2012 9:42 pm

Rickster wrote:how do you figure out which quality number belongs to a real ingame item color?
Put the item in the first bag slot. Started up the commandline script. Typed in

Code: Select all

print(inventory.BagSlot[61].Quality)
  • 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

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Guild Donation

#16 Post by Rickster » Thu Mar 08, 2012 12:56 pm

it seems that the localisation is not implemented.

i tried to change line 40
from

Code: Select all

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

Code: Select all

if ( _type == "all" and (item:isType("Erz") or item:isType("Kraut") or item:isType("Holz")) ) or 
which are the ressource group names, shown in the german client tooltips.
this works and donates "Erz" and "Holz", but Herbs dont.

As there are many other places with localised words, i dont get the point, where to change what ;)
i remember there was a file in the database folder, which holds these resource group names. is it something we need for it? i cant find it anymore.

Germangold
Posts: 276
Joined: Thu Oct 22, 2009 3:58 am

Re: Guild Donation

#17 Post by Germangold » Thu Mar 08, 2012 6:29 pm

Code: Select all

[3] = { Name = "Materialien",
		[1] = { Name = "Holz" },
		[2] = { Name = "Kräuter" },
		[3] = { Name = "Rohmaterialien" },
		[4] = { Name = "Fertigungsrunen" },
		[5] = { Name = "Verarbeitete Güter" },
		[0] = { Name = "Erz" },
	},
is guess

"Kräuter" or "Kr\195\164uter" should work

Rickster
Posts: 291
Joined: Sun Oct 24, 2010 4:23 pm

Re: Guild Donation

#18 Post by Rickster » Fri Mar 09, 2012 1:40 am

I did an update to lisas userfunction.
The idea was, to make the function work, independant from localisation and is based on the idea that itemtypestable.lua is build independant from localised clients ... please report, if this is not.

I tested this version on a german client. As I am not very good in things like coding and testing, this version is released as beta. Please feel free to report any bugs.
The main benefit goes to rock5 and lisa, who helped me in other threads on questions regarding to this topic.

It mainly contains lisas code with following changes:
  • using itemtypestable.lua for localised names
  • searches only backpacks 1-6 for ressources
  • donates woods, ores, herbs
  • minor changes for checking _type and _quality
For usage instructions I will mainly quote lisas first post:

This is a userfunction created for the purpose of donating gathered resources to your guild, inluding quality 8 guild resources from mini games.
It does not cover guild runes / guild stones / guild rubies, it is purely for herb / ore / wood.

Usage:

Code: Select all

	GuildDonate(arg1, arg2, arg3)
  • arg1 is the type of resource "ore", "wood", "herb" or "all"
  • arg2 is the quality "white"(0), "green"(1) "blue"(2), "purple"(3), "orange"(4), "gold"(5)
    You can also use numbers from 0-15 without quotes.
    To use mini game resources use 8 witout quotes.
  • arg3 is if you want to also donate lesser quality "true", defaults to "false"
arg1 and arg2 are mandatory in conjunction!!! You cant use one without the other!
This is, because users have to be sure what they want to donate!

Examples

Code: Select all

GuildDonate()
equals

Code: Select all

GuildDonate("all", 15, "true")
Donates all resources up to quality 15. This includes all ressources, also the mini game resources.

Code: Select all

GuildDonate("ore", "green")
Will donate all Ore of green quality only.

Code: Select all

GuildDonate("herb","blue","true")
Will donate all Herbs of blue & green & white quality.

Code: Select all

GuildDonate("all", "green")
Will donate all resources of green quality only.

Ric
userfunction_GuildDonate.lua
Version 1.41 beta
(3.71 KiB) Downloaded 191 times

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Guild Donation

#19 Post by rock5 » Fri Mar 09, 2012 4:38 am

All in all I'd say its a great job.

My comments:
  • My pet peave. You're like Lisa. You don't indent properly. Grrrr.
    I like the debug mode.
    I like all the extra checks you do.
    I like the use of "elseif". I think Lisa always had trouble using "elseif"s.
    You really should have declared the "item" variable local. It's too common a variable name and might conflict with other userfunctions.
    I've never seen the "cprintf_ex" function before. I wasn't even aware of it. LoL. I'll have to remember that if I ever want mixed color text on one line.
    I'm not sure I like the starting and ending messages. I like to see as few unneccessary messages as possible. What's wrong with just

    Code: Select all

    Donating 5 Maple Wood (Woods)
    This seems pointless

    Code: Select all

    Donating all to guild ...
    Donating 5 Maple Wood (Woods)
    Donation finished.
    Or if this happened

    Code: Select all

    Donating all to guild ...
    There was nothing to donate.
    Donation finished.
  • 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

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Guild Donation

#20 Post by lisa » Fri Mar 09, 2012 9:46 am

rock5 wrote:My pet peave. You're like Lisa. You don't indent properly. Grrrr.
lol that was 9 months ago, I do it much nicer now =)

I haven't had a chance to test it but when you are happy with it I'll add it to first post as a newer version. I really don't get as much time anymore to upgrade or test things =(
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

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests