|
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Wed Jul 20, 2005 4:12 pm Post subject: <c> cmdalias |
|
|
|
|
Ever want to make an alias command for different command, without having to make a new module? Well you're in luck! This module will take commands and rename them to other commands which are then processed by the server. For example I could take the "*spec" command and instead of using the default behavior of listing who is speccing someone, it will lock the player in spec by changing the command to "?lock -s". You could also create a command to convienently unlock players from spec by aliasing "*unspec" to "?unlock". You don't need to change the command permissions or anything to use these commands; if the player has access to ?unlock he'll have access to *unspec. Notice that you now can differentiate between * and ? commands. So that while *spec will lock players in spec mode, ?spec will retain it's old functionality.
So how do you use it? At the top of global.conf, put a single line:
Quote: | #include cmdalias.conf |
Then, in the same directory as global.conf, create a file called cmdalias.conf and define your command aliases as follows:
; this file defines command aliases, make sure module cmdalias is loaded or this won't do anything!
[CmdAlias]
;the number of aliases defined
Num=3
From1=*spec
To1=?lock -s
From2=*unspec
To2=?unlock
From3=*boo
To3=*aa Boo!
|
Note that you still don't have the ideal goal of *spec acting as it does in subgame (for bots and such). For that you'll need to create a new command like togglespeclock and alias it with "*spec". But this is a key step forward in doing this.
Some features to be desired are defining the commands on a per arena basis. These aliased commands are done for the entire server. Perhaps moving the settings from global settings to the per arena settings, and using attach to load the settings and unattach to free any data associated with them would work too. However, for now I believe this is fine.
Source attached, you also need to link to util.c somehow (uses hashtables, amalloc, and afree). _________________ SubSpace Discretion: A Third Generation SubSpace Client
sample cmdalias.conf file
cmdalias.conf - 0.23 KB
File downloaded or viewed 40 time(s)
Source
cmdalias.c - 3.38 KB
File downloaded or viewed 55 time(s)
|
|
Back to top |
|
|
CypherJF I gargle nitroglycerin
Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Wed Jul 20, 2005 7:29 pm Post subject: |
|
|
|
|
This I could see as a viable option for helping users migrate from subgame to asss. Now for someone to alias all the possible subgame commands over, and have it come as a default package. _________________ Performance is often the art of cheating carefully. - James Gosling
|
|
Back to top |
|
|
Bak ?ls -s 0 in
Age:25 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Wed Jul 20, 2005 9:31 pm Post subject: |
|
|
|
|
the sg_compat module takes care of most of them. Namely, the following ones:
ALIAS("?recycle", "recyclearena");
ALIAS("?get", "geta");
ALIAS("?set", "seta");
ALIAS("?setlevel", "putmap");
ALIAS("*listban", "listmidbans");
ALIAS("*removeban", "delmidban");
ALIAS("*kill", "kick");
ALIAS("*log", "lastlog");
ALIAS("*zone", "az");
ALIAS("*flags", "flaginfo");
ALIAS("*locate", "find");
ALIAS("*recycle", "shutdown -r");
ALIAS("*sysop", "setgroup sysop");
ALIAS("*smoderator", "setgroup smod");
ALIAS("*moderator", "setgroup mod");
ALIAS("*arena", "aa");
ALIAS("*einfo", "sg_einfo");
ALIAS("*tinfo", "sg_tinfo");
ALIAS("*listmod", "sg_listmod");
ALIAS("*where", "sg_where");
ALIAS("*info", "sg_info");
ALIAS("*lag", "sg_lag"); |
|
|
Back to top |
|
|
Chambahs Power attack
Joined: Jun 19 2005 Posts: 820 Offline
|
Posted: Wed Jul 20, 2005 9:53 pm Post subject: |
|
|
|
|
God bak, you own more and more everyday
|
|
Back to top |
|
|
phong Seasoned Helper
Gender: Joined: Jul 19 2005 Posts: 154 Offline
|
Posted: Thu Jul 21, 2005 7:51 pm Post subject: |
|
|
|
|
can you put together a makefile? or an idea
|
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 262 page(s) served in previous 5 minutes.
|