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.

Simple trigger script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
n
noobie10111
Voice
Posts: 1
Joined: Tue Sep 23, 2014 12:20 am

Simple trigger script

Post by noobie10111 »

Hey all, I'm really new to this

I have my eggdrop up and running thankfully

I'm looking for a script so if someone types !ts it prints back the ip of my ts server, e.g. 244.244.244.244

It could be anything really just so I can get the syntax for a simple trigger response

I've browsed through alot of the pages but can't find anything

Would really appreciate the help, thanks
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Post by Get_A_Fix »

The answers you seek are inside the eggdrop directory, inside doc. It's a file called tcl-commands.doc - which explains all of the commands and events you can use. Have a read of this and this?
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
w
willyw
Revered One
Posts: 1200
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Check out:

http://suninet.the-demon.de/04.htm
http://suninet.the-demon.de/041.htm

and
(from Get-A-Fix's link) :
http://www.eggheads.org/support/egghtml ... html#binda

Hint -
see: bind pub

I hope this helps.
Let us know how you do.
A
AlphaTech
Voice
Posts: 12
Joined: Wed Jul 23, 2014 1:07 am
Location: New York, USA

Reply

Post by AlphaTech »

heres a simple script that does exactly what you want :)

Code: Select all

#set what you want the command to be below.
set command !example_command

#set what you want it to say below
set message Sample Message

#No need to edit below this line
bind pubm - "$command" my_simple_script
proc my_simple_script {nick uhost handle chan text} {putquick "privmsg $chan :$message"}
Don't forget to edit those variables up there! Once your done just put it in a .tcl file a drop it in your scripts directory. In your eggdrop.conf add that .tcl file and your done! Enjoy!
User avatar
Get_A_Fix
Master
Posts: 206
Joined: Sat May 07, 2005 6:11 pm
Location: New Zealand

Re: Reply

Post by Get_A_Fix »

Just a couple of things;
Firstly, the set command is fine, but with set message, you'd want to brace your text string with "" .. like

Code: Select all

set message "this is a message text"
Secondly, for a pub bind, the proper arguments are

Code: Select all

{nick uhost hand chan arg} {
Instead of using "" in the bind, you can just do

Code: Select all

${command}
You also forgot to declare the message as a global var, within the proc, otherwise it will error as $message can't be read.

Code: Select all

global message
or you can not declare, like you did, and call it using

Code: Select all

$::message
You're still learning, so it's good to try many different methods then find what works best.
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.
Post Reply