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 

need some help on a script

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


Joined: 26 Jun 2007
Posts: 17

PostPosted: Thu Feb 19, 2009 9:49 pm    Post subject: need some help on a script Reply with quote

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


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Fri Feb 20, 2009 1:17 am    Post subject: Reply with quote

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


Joined: 26 Jun 2007
Posts: 17

PostPosted: Sat Feb 21, 2009 12:32 am    Post subject: ok what is wrong with this line??? it aint working for me.. Reply with quote

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


Joined: 26 Jun 2007
Posts: 17

PostPosted: Sat Feb 21, 2009 12:32 am    Post subject: Reply with quote

on its own is what i meant
Back to top
View user's profile Send private message
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Sat Feb 21, 2009 2:46 am    Post subject: Reply with quote

I wouldn't call anyone stupid Sad
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
View user's profile Send private message Send e-mail
redwolf
Voice


Joined: 26 Jun 2007
Posts: 17

PostPosted: Sun Feb 22, 2009 12:49 pm    Post subject: is a timer cmd Reply with quote

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


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Feb 22, 2009 1:07 pm    Post subject: Reply with quote

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