Page 2 of 10

Re: Rock5's Fusion Control Functions

Posted: Wed Sep 28, 2011 8:35 am
by rock5

Code: Select all

function Fusion_MakeMaxStones(_beltNameOrId, _beltTierLevel)
------------------------------------------------
-- Makes maximum mana stones taking into account
-- the number of charges and mana stones you
-- already have. Assumes you will have enough
-- belts/items and Random Fusion Stones.
-- Accepts arguments:
--    _beltNameOrId = name or id of the item to use
--                "all" uses all items, no whitelist
--                defaults to "Gold-wrapped Belt"
--    _beltTierLevel = the tier level stone the
--                     belt/item makes - defaults to 3
-------------------------------------------------

Re: Rock5's Fusion Control Functions

Posted: Wed Sep 28, 2011 9:57 am
by gloover
yes, I've read this too.

can u give an example code on how to fuse for exapmle 9 stones and 9 belts -> 9 stones tier 4 -> 3 stones tier 5-> 1 stone tier 6 and send this to another character.

I've 8 characters on one account, getting 13 charges the bot write this in a file

Code: Select all

	local charges = RoMScript("GetMagicBoxEnergy()");
	if charges >= 13 then
	local filename = getExecutionPath() .. "/logs/charges.log";
		local file, err = io.open(filename, "a+");
		if file then
			file:write(" Character name: " ..player.Name.. ". \tDate: " .. os.date() .. ". \tCharges gained: "..charges".\n")
			file:close();
		end
	end;
so is it possible automatically to buy belts + fusion stones and send them to all characters, which are listed in this file?

Re: Rock5's Fusion Control Functions

Posted: Wed Sep 28, 2011 10:27 am
by rock5
The second argument is the tier level stone the item would make. In this case Excellent Belts make tier 4 stone. The function needs to know this so it can do it's calculations properly. So it would be,

Code: Select all

Fusion_MakeMaxStones(227502, 4)
You don't specify how many to make. It just makes the maximum mana stones possible.
gloover wrote:so is it possible automatically to buy belts + fusion stones and send them to all characters, which are listed in this file?
Yeh but it would be pretty complicated. You would need to read each line, parse out the name, check to see if you have enough belts and fusion stone, go and buy some if not and send them if you do.

Re: Rock5's Fusion Control Functions

Posted: Fri Sep 30, 2011 6:00 am
by gloover
Ok, I did it! thanx a lot guys.

Last question: "fusion" has an option "clearbag", so how can I clear the bag, excepting manastones, fusionstones AND Phirius Cons, with the bot?

Re: Rock5's Fusion Control Functions

Posted: Fri Sep 30, 2011 12:02 pm
by rock5
I'm not familiar with that option because I never used it but it looks like you can use. "Fusion_ClearBag(_playerlevel, _maxslots)". _playerlevel is the character level. I don't know why it needs that. And _maxslots is the number of slots you want to check. _maxslots is optional and defaults to all available slots.

So from the bot, if you want to check all slots you could use

Code: Select all

RoMScript("Fusion_ClearBag(" .. player.Level .. ")")
It looks like it doesn't throw away fusion or mana stones but it might Coins. To add it to the save list go to line 57 of "fusion.lua" and add the Phirius Token Coin id 203038 to the "saveitem" list or before using ClearBag execute

Code: Select all

RoMScript("table.insert(Fusion.SaveItem,203038)")
Make sure you have the latest version of "fusion" as a few fusion and mana stone ids were added.

Re: Rock5's Fusion Control Functions

Posted: Sat Oct 01, 2011 6:07 am
by gloover
Yea, thank u very much rock.

I've edit the fusion.lua to

Code: Select all

		SaveItem =	{
					203571,		-- Brown Horse (1 Day)
					201853,		-- Peers Paket
					227502,		-- Excellent Belt
					203038,		-- Phirius Coins
					},
Have also modified the lua and kicked out the checking of player.level < 10 (security reason).
callin with the Romscript Fusion_ClearBag() now works fine for me.

thx again!

Trouble with Fusion addon?

Posted: Tue Oct 18, 2011 12:11 am
by rock5
I was making great progress with my Tier stone making script when i discovered there seems to be a bug with the Fusion addon. Every time I open the Fusion interface by clicking the fusion button on the transmutor dialog and then try to change character or go to the character selection screen or even log off, it crashes the game. And I mean EVERY time.

Does anyone else experience the same problem?

The thing I don't understand is, just showing the interface actually 'does' nothing. Besides showing the interface, no code is run when the Fusion button is clicked and there is no 'OnShow' code. So I'm at a loss as to what is different or what changes when showing the interface and when not showing the interface.

If anyone has addon experience and can figure it out Let us know.

Re: Rock5's Fusion Control Functions

Posted: Tue Oct 18, 2011 12:34 pm
by gloover
Jep, rock - have the same problem, after using fusion, the game crashes by changing a char or even when you close the game. (Critical Error) It seems to be a problem with this addon - same issue (crashes) if you try to use the addon manually.

Re: Rock5's Fusion Control Functions

Posted: Wed Nov 02, 2011 4:34 pm
by OneofMany
Would it be possible, to send a character 20 weapons lvl67 and send them too a character
The bot will have too:
buy random fusion stones and start tiering

cuz i get an error when running this in my script:

Code: Select all

local tobuy = Fusion_NumberToBuy(20)
    local stonename = RoMScript("TEXT('Sys202999_name')")
    repeat
		local fscount = inventory:getItemCount(202999)
		if fscount >= tobuy then break end
        player:openStore("Odeley Prole");
        inventory:storeBuyItem(stonename, tobuy - fscount)
        yrest(10000)
    until false
	Fusion_MakeMaxStones()
and i get this error:
10:33pm - .../rom/userfunctions/userfunction_Fusion_Functions.lua:42: attempt to
perform arithmetic on field '?' (a nil value)

Or is this function just not working yet?

Re: Rock5's Fusion Control Functions

Posted: Wed Nov 02, 2011 10:59 pm
by rock5
gloover wrote:Jep, rock - have the same problem, after using fusion, the game crashes by changing a char or even when you close the game. (Critical Error) It seems to be a problem with this addon - same issue (crashes) if you try to use the addon manually.
Try updating to Fusion v1.05. Should be fixed now.
OneofMany wrote:and i get this error:
10:33pm - .../rom/userfunctions/userfunction_Fusion_Functions.lua:42: attempt to
perform arithmetic on field '?' (a nil value)
Have you updated to the latest Fusion? If so the fusion userfunctions need to be updated.

Your error is caused because you didn't read the instructions for Fusion_NumberToBuy(_beltTierLevel).

Code: Select all

--    _beltTierLevel = the tier level stone the
--                     belt makes - defaults to 3

Re: Rock5's Fusion Control Functions

Posted: Thu Nov 03, 2011 1:57 am
by OneofMany
But, before i go bump my head cuz i didnt see something again. Can i just make tier stones from the drops i get in Grafu Castle easy?

its far more cheaper to just farm gc easy and send the weapons on to all characters. and after that let them upgrade them (only green and blue items)

also what i understood from the code was,

Fusion_NumberToBuy is how many of the stones i would like to buy, and i want to buy 20, but what i read now is that its part of the math how many to buy, for how many items you got in backpack...

So now it runs, i got 25 items in bp that can make a t4 item. but buys only 15 stones?
Ill look into the code and try some more :) think i can work this out :)

Re: Rock5's Fusion Control Functions

Posted: Thu Nov 03, 2011 2:56 am
by OneofMany
Rock, u are a genius. :) nvm my last post :) got it working now!

Re: Rock5's Fusion Control Functions

Posted: Thu Nov 03, 2011 2:57 am
by rock5
If you want to but 20 stones, just buy 20 stones.

Code: Select all

player:openStore("npcname")
store:buyItem("Random Fusion Stone",20)
Personally, I just buy/send 9 belts and stones per 13 charges. Keeps their inventory neat with no left over t4s or t5s. Just t6s and higher.

But here is a run down of the fusion functions.

Fusion_NumberToBuy(_beltTierLevel)
Like the description says, "Calculates minimum number to buy for belts and fusion stones to use up all your charges." So if you have 10 charges, for example, it will return 8. Because with 8 items you would use up 8 charges then merge 3 and 3 together to use up the last 2 charges. It also takes into account what mana stones the character might already have. eg. say you have 3 t4 mana stones and 10 charges, then it would return 7. That's 7 charges to fuse the 7 items, 1 charge to merge those first 3 mana stones and 2 charges to merge 6 of the other 7. You would only use this if you want the character to use up all it's charges the most efficient way such as if you level new characters to level 10, use their 10 charges then discard them.

Fusion_NumberToMake(_beltTierLevel)
List basically just makes a table of values to populate the fusion "number to make" buttons. I looks at the amount of charges you have and manastones you have and calculates what number to put in each box. Works well but assumes you have enough items and fusion stones to use up all the charges so it is only useful after using the function above to buy the correct number of items. You wouldn't use this yourself. It is used by 'Fusion_MakeMaxStones'.

Fusion_MakeMaxStones(_beltNameOrId, _beltTierLevel)
This, again, assumes you have enough items and stones to use up all your charges and sets the exact values to fuse everything. This function doesn't work with the curent version of fusion. It needs to be updated.

Fusion_Config(setting, value)
This just allows you to change the fusion config settings

BuyItemByName(itemname, num)
This is obsolete. Use 'store:buyItem' instead.

Because I don't make the maximum possible anymore, I actually don't use any of these functions. I should probably add some new basic functions.

Re: Rock5's Fusion Control Functions

Posted: Thu Nov 03, 2011 8:01 am
by OneofMany
Ok, i got the tiering done, but now.....

I want to make an excellent belt and a puri into a mana stone.

I found that, if the puri is still in itemshop backpack, it wont work, even not manual, must be the fusion addon then???

If i put the puri into the normal backpack, it works.

Question: How can i put all puris that exist in item shop backpack into the normal one?

Searched some on the forum. couldnt find a descent answer to it.

Re: Rock5's Fusion Control Functions

Posted: Thu Nov 03, 2011 8:27 am
by rock5
If you try the fusion addon manually and it can't use puris in item shop bag then it would be a limitation of the addon.

To move all puris to the normal backpack try

Code: Select all

repeat
    local puri = inventory:findItem("Purified Fusion Stone","itemshop")
    if puri then 
        puri:moveTo("bags")
    end
until puri == nil

Re: Rock5's Fusion Control Functions

Posted: Thu Nov 03, 2011 8:31 am
by OneofMany
Thnx Rock, u've been a great help allways!

what i see in the fusion thing, and it does not concern me but. It allways opens the fusion addon twice ? is that normal?

Re: Rock5's Fusion Control Functions

Posted: Mon Nov 14, 2011 12:09 pm
by gloover
Hey rock,

is it possible to set the function to fuse only to manastones e.a. tier 8?

The character get for exapmle 9 tier7 manastones. So, if this character have more then 3 charges, it will be fused to one manastone tier9. How or what (which settings) to change, so that the bot doing only manastones tier8 and not higher?

thx in advance!

Re: Rock5's Fusion Control Functions

Posted: Mon Nov 14, 2011 1:36 pm
by rock5
I'm thinking of adding some more general purpose functions. That will deffinately need to be an option. Maybe I'll look into it tomorrow.

Re: Rock5's Fusion Control Functions

Posted: Mon Nov 14, 2011 2:36 pm
by Rickster
Hello,

I just tried to use fusion again, after a long break and discovered it not working anymore.

Fusion is v1.05 and i have fusion control functions 0.2.
I already got it working a time ago, but now it refuses to work and mm displays:
Opening Transmutor and Fusion frames.
but nothing happens.

Transmutor and fusion frame opens, but no numbers are filled in and fusion doesnt start.
rock5 wrote:Fusion_MakeMaxStones(_beltNameOrId, _beltTierLevel)
This, again, assumes you have enough items and stones to use up all your charges and sets the exact values to fuse everything. This function doesn't work with the curent version of fusion. It needs to be updated.
Does this mean fusing with the bot does actually not work?
Because I don't make the maximum possible anymore, I actually don't use any of these functions. I should probably add some new basic functions.
how do you manage it to use fusion with the bot?

Greetz
Ric

Re: Rock5's Fusion Control Functions

Posted: Mon Nov 14, 2011 4:24 pm
by gloover
rock5 wrote:I'm thinking of adding some more general purpose functions. That will deffinately need to be an option. Maybe I'll look into it tomorrow.
I'd really appreciate that. thank u in advance rock!