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 

Port From Site to Eggdrop?

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


Joined: 19 Jul 2010
Posts: 1

PostPosted: Mon Jul 19, 2010 11:10 am    Post subject: Port From Site to Eggdrop? Reply with quote

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
View user's profile Send private message
MIODude
Voice


Joined: 09 Oct 2006
Posts: 32

PostPosted: Sat Jul 31, 2010 9:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Aug 01, 2010 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Eggdrop 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