Jump to content

Recommended Posts

Hi, in LUA its sadly not possible to change the settings of wrobot. So I need a C# routine that

heallist="113509,80610,80618,65499,43523,43518,34062,22019,65517,22895,65516,8076,65515,8075,65500,1487,1114,1113,5349"

- search the Item numbers in heallist in the bags and give me the highest found.

- translate the number to the localist name (english, german, french, ...)

- and last but no least set the wrobot settings

wManager.wManagerSetting.CurrentSetting.FoodPercent = 60
  and
wManager.wManagerSetting.CurrentSetting.FoodName = <translated food>

(not sure if i get the right setting names)

 

Sense of this: To start the regeneration via fightclass with a self casted food (Mage)

Link to comment
https://wrobot.eu/forums/topic/4088-c-search-in-bags-and-change-settings/
Share on other sites

Hello,

                            var foodName = Lua.LuaDoString<string>(@"
                                                                    local foodId = {113509,80610,80618,65499,43523,43518,34062,22019,65517,22895,65516,8076,65515,8075,65500,1487,1114,1113,5349}

                                                                    local cid = 0;
                                                                    local maxCount = 0;

                                                                    for i, id in ipairs(foodId) do
                                                                        local c = GetItemCount(id);
                                                                        if c > maxCount then
	                                                                    maxCount = c;
	                                                                    cid = id;
                                                                        end
                                                                    end

                                                                    if cid <= 0 then
                                                                        return "";
                                                                    end
                                                                   
                                                                    local name = GetItemInfo(cid);

                                                                    return name;
                                                                    ");
                            if (!string.IsNullOrWhiteSpace(foodName))
                            {
                                wManager.wManagerSetting.CurrentSetting.FoodPercent = 60;
                                wManager.wManagerSetting.CurrentSetting.FoodName = foodName;
                            }

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...