egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reacting to all commands *?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Pauschi
Voice


Joined: 03 Sep 2019
Posts: 2

PostPosted: Tue Sep 03, 2019 11:11 am    Post subject: Reacting to all commands *? Reply with quote

Hello!

my simple script is working so far, unfortunally it only reacts when someone writes !raffle into the chat.

Code:
bind PUB -|- !raffle raffle
proc raffle { nick host hand chan arg } {
putserv "PRIVMSG $chan :!raffle"
}


Can it be triggered with every text what starts with "!" ?

I tried
Code:
bind PUB -|- !* all
but it doesnt work Sad

And it should PRIVMSG to the chan with excatly THAT what was inputted.
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2846

PostPosted: Tue Sep 03, 2019 2:04 pm    Post subject: Reply with quote

Hello,
The PUB binding does not support wildcard characters such as *. For this, you'll have to use the PUBM binding instead.

Keep in mind though, that the syntax for PUBM is slightly different to PUB;
The mask is matched against "#channel text", so you'll probably want to use something like this:
Code:
bind pubm -|- "% !*" raffle

Also, if the command (raffle, in this case) returns 1, the message will not be logged.
Finally, if you've enabled exclusive bindings, this will prevent any PUB binds matching the text-line from actually triggering.

As for responding with the input-text, this is available in the last parameter passed to the function;
Code:
proc raffle {nick host handle channel text} {
  puthelp "PRIVMSG $channel :$text"
}

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Pauschi
Voice


Joined: 03 Sep 2019
Posts: 2

PostPosted: Thu Sep 05, 2019 2:05 am    Post subject: Reply with quote

Thank you sir! Im gonna try it:)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot 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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber