This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Help with this script

Help for those learning Tcl or writing their own scripts.
Post Reply
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Help with this script

Post by darton »

Hello!
When someone in channel writes "!warn Darton", my eggdrop should say: "!page Darton You are warned. The moderator will keep an eye on you now!"
So I made this script:

Code: Select all

bind pub - !warn warn
proc warn {nick uhost hand chan text} {
putquick "PRIVMSG $chan :!page $text You are warned. The moderator will keep an eye on you now!" 
}
This thing works, but it must be pubm and not only pub. With pubm it doesn't work. Can anybody modify this script so that it works with pubm?
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

pubm

Post by DragnLord »

Why do you "need" this to be pubm?
Pubm would return the whole line for $text, not just what comes after the trigger.
Can you show some examples of what you are trying to do with it? The example you gave for pub really wouldn't apply with the way pubm works.
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

OK, my channel is connected to a game which means that everything what is displayed in game is also displayed in the channel. A bot named BRenBot displays everything in the channel. Here is a example what I want to do with my script:
(08:14:44) (@BRenBot) Darton: !warn nick
You see that before the "!warn nick" there is a player name, accordingly a bind to pub wouldn't work. Now I want that my bot ignores everything what is before "!warn". And when somebody writes "!warn nick", my bot should say: "!page nick You are warned. The moderator will keep an eye on you now!"
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

Give this a try (worked for me):

Code: Select all

bind pubm - "*!warn *" warn
proc warn {nick uhost hand chan text} {
set wout [lrange $text 2 end]
putquick "PRIVMSG $chan :!page $wout You are warned. The moderator will keep an eye on you now!"
}
d
darton
Op
Posts: 155
Joined: Sat Jan 21, 2006 11:03 am

Post by darton »

Hey, thank you guy. It works like a charm.
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

glad to help when/where I can for someone that is at least trying
:)
Post Reply