| View previous topic :: View next topic |
| Author |
Message |
darkwood Voice
Joined: 15 May 2011 Posts: 2
|
Posted: Sun May 15, 2011 2:58 pm Post subject: Help with event after connect to server |
|
|
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 |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Sun May 15, 2011 3:08 pm Post subject: |
|
|
Change: | Code: | | global nick botnick | To: | Code: | global nick
global botnick |
_________________ http://www.trixarian.net/Projects |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun May 15, 2011 3:23 pm Post subject: |
|
|
@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 |
|
 |
darkwood Voice
Joined: 15 May 2011 Posts: 2
|
Posted: Sun May 15, 2011 3:26 pm Post subject: |
|
|
| @Trixar_za : Not solved the problem |
|
| Back to top |
|
 |
Trixar_za Op

Joined: 18 Nov 2009 Posts: 143 Location: South Africa
|
Posted: Mon May 16, 2011 12:53 pm Post subject: |
|
|
@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 |
|
 |
|