| View previous topic :: View next topic |
| Author |
Message |
W33dman Voice
Joined: 19 Jul 2010 Posts: 1
|
Posted: Mon Jul 19, 2010 11:10 am Post subject: Port From Site to Eggdrop? |
|
|
Hello all,
First let me say thank you for Eggdrop! Just got it up and running yesterday and having lots of fun with it...the options are endless.
Now my website has a built in option to connect to the eggdrop and use it to announce things on the site in IRC. I am just not sure what port to specify and tell it connect to eggdrop with as their are a few different options and so far the ports I have tried did not seem to work.
Thanks
W33dman |
|
| Back to top |
|
 |
MIODude Voice
Joined: 09 Oct 2006 Posts: 32
|
Posted: Sat Jul 31, 2010 9:22 pm Post subject: |
|
|
You should create a separate script for that function, and you want to specify the listen port in that script
| Code: |
listen xxxx script botlisten
set password "password"
proc botlisten {idx} {
control $idx botlisten2
}
proc botlisten2 {idx args} {
set args [string map { "\\" "" } $args]
set args [join $args]
set password1 [lindex [split $args] 0]
set message [join [lrange [split $args] 1 end]]
if {[string match $::password $password1]} {
putnow "PRIVMSG #channel :$message"
} else {
putlog "Unauthorized person tried to connect to the bot"
}
}
|
like that. Where XXXX is the port. Make it different than any port you are loading in your eggdrop config. The website would telnet the data to the port defined in this script |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Aug 01, 2010 3:03 pm Post subject: |
|
|
A comment on the posted code:
Avoid using the name "args" for proc arguments, as it is handled in a different manner. Basically, it will accept 0 or more parameters, each provided as a list entity - whereas normal argument names only takes one.
In the case of control, the command/proc is always called with two parameters - idx and text - so there is no need for args here. Further, using commands such as string map on a list is a bad idea, as this might very well break the (delicate) list structure.
I'd recommend something like this:
| Code: | proc botlisten2 {idx text} {
set params [split $text]
set password1 [lindex $params 0]
set message [join [lrange $params 1 end]]
... |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|