| View previous topic :: View next topic |
| Author |
Message |
ven000m Voice
Joined: 28 Mar 2008 Posts: 1
|
Posted: Fri Mar 28, 2008 12:28 pm Post subject: [quakenet] auto add/remove chanlev for users |
|
|
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
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  |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Mar 31, 2008 8:55 am Post subject: |
|
|
| Quote: | proc pub:ticket {nick uhost hand chan text} {
set who [lindex $args 0]... | This that should be | Code: | | set who [lindex $text 0] |  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Mar 31, 2008 12:12 pm Post subject: |
|
|
| 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] |  |
This that should be | Code: | | set who [lindex [split $text] 0] |  |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Mar 31, 2008 2:42 pm Post subject: |
|
|
hehehe didn't think it was needed when $text was used.  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Mar 31, 2008 4:41 pm Post subject: |
|
|
| TCL_no_TK wrote: | hehehe didn't think it was needed when $text was used.  |
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 |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
|
| Back to top |
|
 |
|