Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
<c> cmdalias

 
Post new topic   Reply to topic Printable version
 View previous topic  <c> togglespec Post :: Post <py> elim  View next topic  
Author Message
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Jul 20, 2005 4:12 pm    Post subject: <c> cmdalias Reply to topic Reply with quote

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:
Code: Show/Hide

; 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 39 time(s)

Source

cmdalias.c - 3.38 KB
File downloaded or viewed 53 time(s)
Back to top
View users profile Send private message Add User to Ignore List AIM Address
CypherJF
I gargle nitroglycerin


Gender:Gender:Male
Joined: Aug 14 2003
Posts: 2582
Location: USA
Offline

PostPosted: Wed Jul 20, 2005 7:29 pm    Post subject: Reply to topic Reply with quote

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. icon_wink.gif
_________________
Performance is often the art of cheating carefully. - James Gosling
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Wed Jul 20, 2005 9:31 pm    Post subject: Reply to topic Reply with quote

the sg_compat module takes care of most of them. Namely, the following ones:

Code: Show/Hide
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
View users profile Send private message Add User to Ignore List AIM Address
Chambahs
Power attack
Power attack


Joined: Jun 19 2005
Posts: 820
Offline

PostPosted: Wed Jul 20, 2005 9:53 pm    Post subject: Reply to topic Reply with quote

God bak, you own more and more everyday
Back to top
View users profile Send private message Add User to Ignore List
phong
Seasoned Helper


Gender:Gender:Male
Joined: Jul 19 2005
Posts: 154
Offline

PostPosted: Thu Jul 21, 2005 7:51 pm    Post subject: Reply to topic Reply with quote

can you put together a makefile? or an idea tongue.gif
Back to top
View users profile Send private message Add User to Ignore List Send email
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 416 page(s) served in previous 5 minutes.

phpBB Created this page in 0.477070 seconds : 32 queries executed (80.6%): GZIP compression disabled