register a new command

These are old archives. They are kept for historic purposes only.
Post Reply
hibbert
Posts: 35
Joined: Sat Apr 16, 2005 10:30 am

register a new command

Post by hibbert »

Hi,
i know some IRC commands like /join #Channel etc.
Is it possible to register own commands like /my_command stuff

I have an Eggdrop on my server, but every time i have to type /msg botname my_command stuff.

is there a way to register my own command an send the result (stuff) to my eggdrop?

i hope you understand what i want to do ;)
I hope you understand my bad english :wink:
SpaceDoG
Posts: 301
Joined: Mon Feb 27, 2006 5:44 am
Contact:

Post by SpaceDoG »

hibbert
Posts: 35
Joined: Sat Apr 16, 2005 10:30 am

Post by hibbert »

ok thanks for the link. I tried this one here:

Code: Select all

alias "myalias" {
      target "hibbert";
      type services;
   };
now i get a private chat.
what have i done...?
i typed:
/myalias bla
and received:
bla
is there any way to received the /myalias too? (as text)

example:
i type:
/myalias test
and i want to receive:
/myalias test
or
myalias test

or could i send a string with the text?
example:
i type:
/myalias test
i want to receive:
user xyz typed: test

and is there a way to get the nick of the user who has sent the text?

a lot of questions ;) i hope anyone can help me :lol:

hibbert
I hope you understand my bad english :wink:
SpaceDoG
Posts: 301
Joined: Mon Feb 27, 2006 5:44 am
Contact:

Post by SpaceDoG »

Well it's not gonna be a service. It's gonna be a normal message then the bot will see it as user xyz typed: test like you wanted.
hibbert
Posts: 35
Joined: Sat Apr 16, 2005 10:30 am

Post by hibbert »

ya ok, now i have the text the user entered.

now to my plan:
i want to register some commands and send each of them to my eggdrop.
now my eddgrop must know which command the user has used, and who it was ;)

example:
user x txped: /myAlias1 bla
user y typed: /myAlias1 juhuu
user x typed: /myAlias2 muh

now the eggdrop should recognize:
user x used myAlias1 with the text bla
user y used myAlias1 with the text juhuu
user x used myAlias2 with the text muh

is that possible?
thanks so far...
hibbert
I hope you understand my bad english :wink:
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Post by Jobe »

Yes it is possible.

See http://www.vulnscan.org/UnrealIRCd/unre ... aliasblock for information on how to use an alias block. Including how you can construct an alias block.

Alias blocks work at the IRCd, so are efectivly translated to say for example a PRIVMSG to the target of the alias with the parameter value being the message format sent. So it would still appear as if youd typed /msg BOTNICK MESSAGE.
hibbert
Posts: 35
Joined: Sat Apr 16, 2005 10:30 am

Post by hibbert »

Jobe1986 wrote:Yes it is possible.
fine... :D
Jobe1986 wrote:See http://www.vulnscan.org/UnrealIRCd/unre ... aliasblock for information on how to use an alias block. Including how you can construct an alias block.
i know, from there i have the syntax...
Jobe1986 wrote:Alias blocks work at the IRCd, so are efectivly translated to say for example a PRIVMSG to the target of the alias with the parameter value being the message format sent. So it would still appear as if youd typed /msg BOTNICK MESSAGE.
yes i already get an privmsg, but i want to know which alias the have used, because i only get the text an not the alias-name

and when i try this little one here

Code: Select all

alias "muh" {
      target "hibbert";
      type normal;
	  parameters "muh %-1";
   };
i get this errormessage in putty while starting the server:
unrealircd.conf:225: Unknown directive 'alias::parameters'
so can anyone give me please an example how to get the users inputtext, the users nick and the aliasname?

thanks again.
I hope you understand my bad english :wink:
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Post by Jobe »

Try using the following instead:

Code: Select all

alias "muh" {
	format ".+" {
		target "hibbert";
		type "normal";
		parameters "muh %1-";
	};
	type command;
	spamfilter "yes";
};
hibbert
Posts: 35
Joined: Sat Apr 16, 2005 10:30 am

Post by hibbert »

hi...
ohh yes that's what i was looking for.

thanks for your great help.

hibbert
I hope you understand my bad english :wink:
Post Reply