Pages: [1]
  Print  
Author Topic: New command  (Read 11165 times)
cowberrian
Nub


Cakes 1
Posts: 8


« on: December 20, 2016, 09:47:19 PM »

Hello peeps!
What I'm trying to achieve is define a command that would connect me to some server when entered in console.

This is my first thought:
Code:
set _someservername "connect someserveraddress"
But when I enter "_someservername" in consile I get: _someservername is "connect _someserveraddress", the default
Ok. If I bind somekey "vstr _someservername", it is working as expected.
So I try 
Code:
set someservername "vstr _someservername"
But this one yields: someservername is "vstr _someservername", the default

Please advise on this matter Smiley
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #1 on: December 21, 2016, 01:07:37 AM »

If you want a one-key command, I suppose you may try simply
Code:
bind <key> connect <serveraddress>
However IIRC binded keys do work only when you are actually playing, not from menu.

If you want something to be written in console (to be used also when not playing), but to do not write the full server address each time, I can guess something like
Code:
set <variable> "connect <serveraddress>"
then
Code:
vstr <variable>
should work.

As example, in case you use "serv1" as variable and 127.0.0.1:27960 as serveraddress:
Code:
set serv1 "connect 127.0.0.1:27960"
then
Code:
vstr serv1

Note: Maybe using "seta" instead of "set" for setting the variable and then using "/writeconfig" should allow to store your user-created variable to your configuration, to do not have to recreate it each time you open OpenArena. It's years I don't try that, I'm not sure it works (however I suppose it should).
Alternatively, you may add the set <variable> "connect <serveraddress>" command to your autoexec.cfg file, to automatically re-create the variable each time you launch OpenArena.

Other alternatives:
1) Putting the "connect <serveraddress>" command into a .cfg plain text file in your baseoa folder, and then invoke that .cfg file with "exec <filename>" or "exec <filename.cfg>". (While "vstr" is the command to "run" a variable containing commands, "exec" is the command to "run" text files containing commands and variables.)
2) Creating a new shortcut in your OS to OpenArena executable, adding "+connect <serveraddress>" after its path... something like
Code:
"C:\Games\OpenArena\openarena.exe" "+connect 127.0.0.1:27960"
That would automatically connect to the specified server on startup.
3) Using Favorites: (DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Favorites

Note: I haven't actually tried these right now, I may have done some small imprecision.

See also: (DO NOT LINK) h t t p s : / / openarena . wikia . com/wiki/Command_console
« Last Edit: December 21, 2016, 02:06:54 AM by Gig » Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
cowberrian
Nub


Cakes 1
Posts: 8


« Reply #2 on: December 21, 2016, 01:35:25 AM »

Thanks for your dedication, man! Smiley I am indeed writing it in autoexec which for me is even less hassle then favorites from game menu, and wiki doesn't have the answer that is why asking here.
So you are saying that there is no possibility to invoke this from console without preceding it with vstr or exec? Because I'd love to compact it into a single word Smiley

Edit: Oh and binding it won't do because I have a heap of addresses and one keyboard will not be enough. Besides, informative commands are easier to memorize. I'm an unix guy, cli is my type of tool.
« Last Edit: December 21, 2016, 01:50:41 AM by cowberrian » Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #3 on: December 21, 2016, 01:50:29 AM »

So you are saying that there is no possibility to invoke this from console without preceding it with vstr or exec? Because I'd love to compact it into a single word Smiley
Shorter command I can think about is "vstr a" or "exec a" (with "a" being a variable or a .cfg file, respectively)...

There are many things I don't know, maybe someone else may know some other trick. However typing 6 characters (including the space) does not seem a big price...
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
cowberrian
Nub


Cakes 1
Posts: 8


« Reply #4 on: December 21, 2016, 01:53:36 AM »

K then. Vstr will do for now. Thanks for support, man!
Logged
Gig
In the year 3000
***

Cakes 45
Posts: 4394


WWW
« Reply #5 on: December 21, 2016, 02:09:08 AM »

You're welcome.
Logged

I never want to be aggressive, offensive or ironic with my posts. If you find something offending in my posts, read them again searching for a different mood there. If you still see something bad with them, please ask me infos. I can be wrong at times, but I never want to upset anyone.
Pages: [1]
  Print  
 
Jump to: