Forums » General

Non-Plugin Console Target info binds

Feb 07, 2016 skeet112 link
First, before anybody backlashes me for not just using regular plugins, let me start by saying I use Windows RT 8.1 on a Surface, which is locked down (much like an unrooted phone), except there is no way around it. This prevents me from creating and altering folders such as a "plugins" folder in the VO directory.

I am already aware of /alias and /bind commands and have a fair understanding of how they work.

HOWEVER: Being a computer programmer, I can take many of those plugins that I oh so truly love, and convert them into binds using alias and bind commands.

I am interested in creating a bind/macro that will do things similar to TargetBinds, but I'm not sure how to.

What I'd be interested in doing is things like /say_guild Targeting %target% in %sector% at a distance of GetTargetDistance() of GetTargetNation() etc etc etc. As a computer programmer by trade, this would not be hard for me to do at all, if I could just get a nudge in the right direction.

I am unaware of how to convert these lua functions into a usable macro that is built solely in game or in the console, without the use of plugins.

Is there anybody that can give me instructions on how this can be achieved?
Feb 07, 2016 draugath link
There's no way to create macro compatible commands from Lua functions without using Lua.

You mentioned not being able to create the "plugins" directory, but if you can add/modify files in the vendetta directory or "<vendetta>/Settings/<character>" directory, you could manually load the Lua files from there.

If you were willing to try and write plugins line by line into a variable via the console, you could save them to a System Notes files and load them manually that way.
Feb 08, 2016 skeet112 link
Yes, that's exactly what I'm trying to do, is use the console to write the code line by line, give my functions a command, and bind that command to a key, essentially.

I've got an understanding on how to do that except getting information from various sources (I.e. a targeted player for example. If I knew how to get that information, I could enter it into the console and do the aforementioned, to my understanding of the system anyhow.
Feb 08, 2016 joylessjoker link
windows sucks.
Feb 08, 2016 draugath link
VO API http://www.vo-wiki.com/racecar2
/consoletoggle -- opens the console

And actually the more I think about the more I think it is not possible to inject random data into an alias string on the fly (ie %target%, %sector%)

Your best bet is probably to use system notes to store your plug-ins and then load them manually.
Feb 08, 2016 skeet112 link
Thanks Draugath! I'll be playing with it and I will report any results I come up with here!
Feb 08, 2016 skeet112 link
Okay, here's where I am with this.

I've figured out that you actually -can- execute lua function in the VO console. In theory, since I'm locked out of my VO directory from making changes, theoretically, the following should work.

/lua dofile("c:\\plugins\\targetbinds\\main.lua")

The dofile lua function has the ability to load and execute lua code, and allows you to choose from where you load that information. However, whenever I execute the command, I get the following:

Cannot open c:\plugins\targetbinds\main.lua: Invalid Argument.

I think I'm on the right path here, but again, need a nudge in the right direction.
Feb 08, 2016 draugath link
dofile() automatically starts at the vendetta directory and can only look at files inside that directory and within it's subdirectories.
Feb 08, 2016 Pizzasgood link
This post may be slightly more than a nudge, so if you don't want spoilers just ignore...

That's why draug was suggesting you could write the plugin content into system notes files via console; system notes are stored in the settings folder, within a folder named the same as your character (these are per-character, not per-account). You could probably test using something like this:

/lua SaveSystemNotes("print 'hello world'; print 'goodbye world';", 1234567)
/lua dofile("settings/skeet112/system1234567notes.txt")

The 1234567 bit is just an arbitrary number; pick something memorable that is large enough that it won't conflict with real in-game system IDs. And you'd replace the 'skeet112' with whatever your character's name is, of course.