You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1

Tuesday, March 4th 2014, 4:01pm

export from lua to file or clipboard?

Is there an (easy?) way to export a long string from an addon/lua to a file or to the clipboard?

Reason: I was reading the Mass Burn thread, and at first I was really confused what was so special about K/W... Obviously, I was looking at long not updated rom wiki K/W elite page... :P Authoritative Deterrence has changed ofc. - at first I did not realize this, lol. :lol:

I think the rom wiki pages are useful, and I did use them long ago a lot to choose my first secondary classes, for example. It is great to see different elites put together on one clear page ... Well it _would_ be great if they were up to date, that is.

I would gladly spend some time to try to update the descriptions of skills and elites on rom wiki, but it would take too long to retype. I looked at charplan internals and I think I understand well enough how it gets the data from the client. So I think I could make a loop to get e.g. elites with their descriptions in chat window (I'm not there yet - I just got fair enough idea by looking at charplan code :) ). But now the question remains: what's the easiest way to get this info out of the client? No point wasting time on other details if I don't see how to do this step, I guess...

(Or: is there some other place where regular and elite skills are described and kept up to date and there is no point trying to update rom wiki?)
>>>> >>>> >>>>
>>>>
>>>> Please, bring back (bound if there is no other option) dias to AH! :thumbsup:
>>>> If you do this we will all love you forever. ;)
>>>>
>>>> >>>> >>>>

2

Wednesday, March 5th 2014, 11:13pm

you could just create and save the inofrmation obtained to a blank .txt file or something. You'd have to know or read up on operations with files (open, write, close, etc.)

Noguai

Beginner

Posts: 5

Location: Germany

  • Send private message

3

Wednesday, March 26th 2014, 11:19pm

In Runes of Magic you cannot write to any file you want. This limitation has been done due to security reasons, just think about what could happen if addons were directly able to manipulate your operating system.

Eventhough that being said you have an way to export your data.
1) SaveVariables
One way would be the SaveVariables, because it's the only file you can store data in. Store your data in a Lua table save that and you will have your data stored to the SaveVariables.lua once you close the client, relog, etc. The client just has to successfully save it, which means no critical errors for you. ;) Whichever way you choose to organize your data, you will have to parse the file, or to manually copy and paste it.

2) Clipboard
The other way would be using the clipboard. But there is one important fact: Yes, you can use http://runesofmagic.gamepedia.com/API:Chat_CopyToClipboard but there is a limitation on the string length you can copy to the clipboard with that. To workaround this, you would have to insert your text into an custom editbox in your ingame gui and manually copy and paste from that.

Of course both is not the ideal way and I also think that there are better methods to get this data, while having more maintainability.