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.

[quakenet] auto add/remove chanlev for users

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
v
ven000m
Voice
Posts: 1
Joined: Fri Mar 28, 2008 12:18 pm

[quakenet] auto add/remove chanlev for users

Post by ven000m »

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 :D



EDIT:

Code: Select all

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

Post by TCL_no_TK »

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

Code: Select all

set who [lindex $text 0]
:)
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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

Code: Select all

set who [lindex $text 0]
:)
This that should be

Code: Select all

set who [lindex [split $text] 0]
:)
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

hehehe didn't think it was needed when $text was used. :P
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

TCL_no_TK wrote:hehehe didn't think it was needed when $text was used. :P
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: Select all

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

Post by TCL_no_TK »

Thanks :)
Post Reply