This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

need some help on a script

Help for those learning Tcl or writing their own scripts.
Post Reply
r
redwolf
Voice
Posts: 17
Joined: Tue Jun 26, 2007 11:24 pm

need some help on a script

Post by redwolf »

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
}
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

I'll take it from the msg_ name that this is a message command? Try

Code: Select all

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"
r
redwolf
Voice
Posts: 17
Joined: Tue Jun 26, 2007 11:24 pm

ok what is wrong with this line??? it aint working for me..

Post by redwolf »

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
}
r
redwolf
Voice
Posts: 17
Joined: Tue Jun 26, 2007 11:24 pm

Post by redwolf »

on its own is what i meant
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

I wouldn't call anyone stupid :(

Code: Select all

putquick "MSG ChanServ :register $chan newskin channel is closed"
return 1
}
The command MSG is a mIRC command* it should be PRIVMSG

Code: Select all

putquick "PRIVMSG ChanServ :register $chan newskin channel is closed"
return 1
}
r
redwolf
Voice
Posts: 17
Joined: Tue Jun 26, 2007 11:24 pm

is a timer cmd

Post by redwolf »

is there a timer cmd for a eggdrop tcl, so that the bot will join then 20 seconds later register the channel?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

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: Select all

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
Post Reply