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 

[quakenet] auto add/remove chanlev for users

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ven000m
Voice


Joined: 28 Mar 2008
Posts: 1

PostPosted: Fri Mar 28, 2008 12:28 pm    Post subject: [quakenet] auto add/remove chanlev for users Reply with quote

Hell0 fellas.

I wanted to ask for a tcl script:

okay lets go:


1) When i type !ticket <nickname> the eggdrop should do: /msg Q chanlev #BamsUnholyUnion <nickname> +av , at the same time he should message in the active channel: Thanks for using our Service, you can now join #BamsUnholyUnion for 5 Minutes!.

Well.., after 4 Minutes, the bot should notice the <nickname> with: Your Ticket is in the last Minute! Pay for a Lifetime Ticket.

After 5 Minutes, the Bot should message in #BamsUnholyUnion: <nickname>, your Ticket was deleted (Reason: Test Time Expierence)

After this the Bot should do that: /msg Q chanlev #BamsUnholyUnion <nickname> -av



DONE:)

REALLY BIG THANKS, I NEED THIS SCRIPT Very Happy



EDIT:

Code:
bind pub o|o !ticket pub:ticket
proc pub:ticket {nick uhost hand chan text} {
     set who [lindex $args 0]
     putserv "MODE $chan +v $who"
     putquick "PRIVMSG $chan :Thanks for using our Service $who, you can now join #BamsUnholyUnion for 5 Minutes!"
     putquick "PRIVMSG Q :chanlev #BamsUnholyUnion $who +av"
     timer 4 [list putserv "NOTICE $who :Your Ticket is in the last Minute! Pay for a Lifetime Ticket"]
     timer 5 [list (putquick "PRIVMSG #BamsUnholyUnion :$who, your Ticket was deleted (Reason: Test Time Expierence)) && (putquick "PRIVMSG Q :chanlev #BamsUnholyUnion $who -av)]
}


doesnt work Neutral
Back to top
View user's profile Send private message
TCL_no_TK
Owner


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

PostPosted: Mon Mar 31, 2008 8:55 am    Post subject: Reply with quote

Quote:
proc pub:ticket {nick uhost hand chan text} {
set who [lindex $args 0]...
This that should be
Code:
set who [lindex $text 0]
Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Mar 31, 2008 12:12 pm    Post subject: Reply with quote

TCL_no_TK wrote:
Quote:
proc pub:ticket {nick uhost hand chan text} {
set who [lindex $args 0]...
This that should be
Code:
set who [lindex $text 0]
Smile

This that should be
Code:
set who [lindex [split $text] 0]
Smile
Back to top
View user's profile Send private message
TCL_no_TK
Owner


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

PostPosted: Mon Mar 31, 2008 2:42 pm    Post subject: Reply with quote

hehehe didn't think it was needed when $text was used. Razz
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Mar 31, 2008 4:41 pm    Post subject: Reply with quote

TCL_no_TK wrote:
hehehe didn't think it was needed when $text was used. Razz

It's needed whenever you want to use list manipulation on a string. Split converts the string into a list, as well as protecting (escaping) special characters.
Code:
# string -> split -> 1st word
set data [lindex [split $text] 0]
# args -> 1st parameter group -> split -> 1st word
set data [lindex [split [lindex $args 0]] 0]

Both of these accomplish the same thing within a procedure.

$args (special reserved token in tcl) enters the procedure as a list, but not a normal list (it's a list of sublist's actually). It is made to allow several binds (irregardless of parameters) to use the same procedure. Depending on where you place $args in the procedure header determines what parameters it will 'swallow' as arguments (hence its name args). Don't use it unless you need it and fully understand it.
For a better understanding of this behavior see "A point worthy of note about args" by "Peterre". It covers this exact scenario discussed above.

$text enters the procedure as a standard string variable. It's contents should (read this as must) always be split prior to using list commands.
Back to top
View user's profile Send private message
TCL_no_TK
Owner


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

PostPosted: Tue Apr 01, 2008 12:44 pm    Post subject: Reply with quote

Thanks Smile
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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