| View previous topic :: View next topic |
| Author |
Message |
redwolf Voice
Joined: 26 Jun 2007 Posts: 17
|
Posted: Thu Feb 19, 2009 9:49 pm Post subject: need some help on a script |
|
|
i have wrote this for a ircop'ed eggdrop bot, to ease the burden on myself and others, but cant get the proc bind right ( IE right now it says proc name args body) should be like something like "nick host handle channel testes" thats just an example, its running on a 1.6.19 eggdrop
what its suppose to do, is shut down and reregister a channel and lock it down, and stay in the 'said' channel. i have omited the oper line to drop the channel will add that later. But if someone out there can help me, I sure would like the help on this script.
proc msg_closechan {proc name args body}
{
global botnick
set chan [lindex $vars 0]
set curchan [channels]
set why [lrange $vars 1 end]
foreach chann $curchan {
if {[string tolower $chann] == [string tolower $chan]}
{
putserv "NOTICE $nick :I'm already on $chan you lamer"
return 0
}
}
channel add $chan {chanmode "+ntspi"}
putserv "NOTICE $nick :Added $chan to channel list. (!ccs changes modes)"
putserv "MSG chanserv :register $chan passwordhere channel is closed"
return 1
} |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Fri Feb 20, 2009 1:17 am Post subject: |
|
|
I'll take it from the msg_ name that this is a message command? Try | Code: | proc msg_closechan {nick uhost handle text} {
...code here
} | I'd strongly recommend that you read, the tcl-commands.doc(/.html) file in the doc/ folder in eggdrop's directory. or View them online here see "Bind Types" _________________ TCL the misunderstood |
|
| Back to top |
|
 |
redwolf Voice
Joined: 26 Jun 2007 Posts: 17
|
Posted: Sat Feb 21, 2009 12:32 am Post subject: ok what is wrong with this line??? it aint working for me.. |
|
|
i know i aint stupid but i have never coded a eggdrop to register a channel on its on
putquick "MSG chanserv :register $chan newskin channel is closed"
return 1
} |
|
| Back to top |
|
 |
redwolf Voice
Joined: 26 Jun 2007 Posts: 17
|
Posted: Sat Feb 21, 2009 12:32 am Post subject: |
|
|
| on its own is what i meant |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Sat Feb 21, 2009 2:46 am Post subject: |
|
|
I wouldn't call anyone stupid
| Code: | putquick "MSG ChanServ :register $chan newskin channel is closed"
return 1
} | The command MSG is a mIRC command* it should be PRIVMSG | Code: | putquick "PRIVMSG ChanServ :register $chan newskin channel is closed"
return 1
} |
_________________ TCL the misunderstood |
|
| Back to top |
|
 |
redwolf Voice
Joined: 26 Jun 2007 Posts: 17
|
Posted: Sun Feb 22, 2009 12:49 pm Post subject: is a timer cmd |
|
|
| is there a timer cmd for a eggdrop tcl, so that the bot will join then 20 seconds later register the channel? |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 22, 2009 1:07 pm Post subject: |
|
|
Sure, look up the utimer command.
A bit care has to be taken when working with timers though, to prevent remote code execution, so I'll post a working example for ya:
| Code: | | utimer 20 [list puthelp "PRIVMSG ChanServ :register $chan newskin channel is closed"] |
The reason for the list is to parse all variables "now", and yet encapsulate the data in a list to prevent a second evaluation/substitution when the timer triggers. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|