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 

Help with event after connect to server

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


Joined: 15 May 2011
Posts: 2

PostPosted: Sun May 15, 2011 2:58 pm    Post subject: Help with event after connect to server Reply with quote

This is working:

Code:
# This is a Tcl script to be run immediately after connecting to a server.
bind evnt - init-server evnt:init_server
bind raw - "432" evnt:nick_invalid

proc evnt:init_server {type} {
  global nick
  putserv "OPER nick operpass"
  putserv "NICK $nick"
  putserv "NS ID nickpass"
  putserv "MODE $nick +BiHqx-sw"
}

proc evnt:nick_invalid {from keyword text} {
  global altnick
  putserv "NICK $altnick"
}


This isnt working:

Code:
# This is a Tcl script to be run immediately after connecting to a server.
bind evnt - init-server evnt:init_server
bind raw - "432" evnt:nick_invalid

proc evnt:init_server {type} {
  global nick botnick
  putserv "OPER nick operpass"
  putserv "NICK $nick"
  putserv "NS ID nickpass"
  putserv "MODE $botnick +BiHqx-sw" # this doesnt works
}

proc evnt:nick_invalid {from keyword text} {
  global altnick
  putserv "NICK $altnick"
}
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Sun May 15, 2011 3:08 pm    Post subject: Reply with quote

Change:
Code:
global nick botnick
To:
Code:
global nick
global botnick

_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun May 15, 2011 3:23 pm    Post subject: Reply with quote

@darkwood:
The latter probably does not work since you've just issued a NICK-command, and the "botnick" variable hasn't been updated yet. Keep in mind that eggdrop isn't multi-threaded, and the "botnick" variable is updated by another binding (catching the response-code of the NICK-command).

@Trixar_za:
Providing multiple variable names to a single global command is just as valid as calling the global command multiple times. Maybe you were thinking of the "variable" command?
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
darkwood
Voice


Joined: 15 May 2011
Posts: 2

PostPosted: Sun May 15, 2011 3:26 pm    Post subject: Reply with quote

@Trixar_za : Not solved the problem
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Mon May 16, 2011 12:53 pm    Post subject: Reply with quote

@nml375 : Actually, I was thinking of a totally different different language because I was playing with a couple of non-standard ones yesterday.

That's the only thing I could see that might be wrong. The only possible explanation then is that botnick hasn't been set yet, which is probably caused by the NICK event. I don't really see the point of doing this at connect. Why change the bot's nick to itself on connect? Why not just remove the NICK $nick part all together?
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
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