Adding/editing commands.

These are old archives. They are kept for historic purposes only.
Post Reply
chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Adding/editing commands.

Post by chevyman2002 » Sun Nov 14, 2004 3:10 am

I was wondering how to add/edit commands. I thought there was no /umode but learned there was a /umode2.. confused some users so i was going to try to change it.. Not sure if i have to create a Module to do this or what. Thanks for input :)
Your face looks like it was set on fire and put out with an axe ;x.

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Sun Nov 14, 2004 3:33 am

well modifying the code is not supported and adding/changing commands would be doing just that.

There are ways to unload commands that exist without modifying the code which is supported :)

chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Post by chevyman2002 » Sun Nov 14, 2004 4:52 am

ic, so in other words, i won't find help here on adding/editing the commands? ;P | How do you go on about removing them? Although i don't know of any i want to remove, part of the reason im doing all this is the learn as much about all this stuff as i can so.. still interested ;)
Your face looks like it was set on fire and put out with an axe ;x.

katsklaw
Official supporter
Posts: 1124
Joined: Sun Apr 18, 2004 5:06 pm
Contact:

Post by katsklaw » Sun Nov 14, 2004 5:59 am

chevyman2002 wrote:ic, so in other words, i won't find help here on adding/editing the commands? ;P | How do you go on about removing them? Although i don't know of any i want to remove, part of the reason im doing all this is the learn as much about all this stuff as i can so.. still interested ;)
removing some commands are rather easy, simply because they are in the form of modules. take sjoin for example.

If you exchange

Code: Select all

loadmodule "modules/commands.so";
for

Code: Select all

loadmodule "modules/m_*.so";
Then you delete the modules you don't want to use. so if you don't like the /sjoin command .. then delete or rename the m_sjoin.so module.

AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf » Sun Nov 14, 2004 11:54 am

Well, as far as I know, module coding is somewhat supported, that's why this forum exists here, and adding/editing/removing commands can be done through 3rd party modules.
To add a new command, module coders generally use CommandAdd, to remove, CommandDel, and to modify the behaviour of a command, CmdoverrideAdd.

However, CommandDel might not be useful to remove, for example, command UMODE2. This command - among many others - is added with function add_Command that leaves out creating module objects, so you might want to use del_Command, but it will be much more tricky...

Oh, and the best way to learn about module coding is to read the UnrealIRCd source code a lot. :)

codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr » Sun Nov 14, 2004 6:57 pm

If you were to remove/disable UMODE2, you would break Unreal. Unreal relies on this command for propagation of usermodes across servers.
-- codemastr

chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Post by chevyman2002 » Sun Nov 14, 2004 8:01 pm

hmm, ok, thanks much guys :). Now all i need to do is learn how to script all this stuff ;)
Your face looks like it was set on fire and put out with an axe ;x.

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Sun Nov 14, 2004 10:42 pm

Real command aliases are in planning, so if it's just a question of having a UMODE command instead of UMODE2, you can wait until that's done and then just alias UMODE to UMODE2. Aside from that a quick module could easily do it.

chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Post by chevyman2002 » Sun Nov 14, 2004 11:32 pm

Ya, the /umode2 thing isn't a big problem or anything, i can simply tell users how to do that or something. I was debating adding a few very simple commands for services. Like on ConferenceRoom, when you type "/ns" -- it sends "/ns help" rather than "no text to send." Just minor things like that, and might would add a couple commands that i'd like to see that weren't only for U:Lines (such as sqline). Not sure what i'll do yet, for now i may tackle some miscoding on Auspice as /cs close and /ns forbid cause seg faults. Thanks much guys :).
Your face looks like it was set on fire and put out with an axe ;x.

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Sun Nov 14, 2004 11:39 pm

chevyman2002 wrote:Like on ConferenceRoom, when you type "/ns" -- it sends "/ns help" rather than "no text to send."
This is easy to do.

Code: Select all

alias ns {
    format "^$" {
        target "NickServ";
        type services;
        parameters "HELP";
    };
    format "^.+$" {
        target "NickServ";
        type services;
        parameters "%1-";
    };
    type command;
};
Last edited by aquanight on Mon Nov 15, 2004 5:30 am, edited 1 time in total.

chevyman2002
Posts: 62
Joined: Sun Nov 14, 2004 2:55 am
Location: Texas
Contact:

Post by chevyman2002 » Sun Nov 14, 2004 11:58 pm

oh wow.. thanks! :D
Your face looks like it was set on fire and put out with an axe ;x.

AngryWolf
Posts: 554
Joined: Sat Mar 06, 2004 10:53 am
Location: Hungary
Contact:

Post by AngryWolf » Mon Nov 15, 2004 5:20 am

Sorry, aquanight, but that alias will still say "no text to send" if you simply type "/ns" (this checking is hard coded, not configurable), and doesn't have a "type" directive with the value "command", anyway.

aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight » Mon Nov 15, 2004 5:30 am

AngryWolf wrote:Sorry, aquanight, but that alias will still say "no text to send" if you simply type "/ns" (this checking is hard coded, not configurable), and doesn't have a "type" directive with the value "command", anyway.
whoops... but darn... hardcoded text checking? argh :(

Post Reply