Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# channels for !setup
set setup_chans {#channel1 #channel2}
# dir with profile files
set profiles_dir "profiles"
# location msg
set location_msg "Thanks for taking the time to set up a profile so we may better know you. For the first step you do !location (and area you live)"
# sex msg
set sex_msg "you are ready for the next step which is !SEX-OR type in your sex (male/female) and your D/s position (Top/Bottom, Dom/sub, Master/slave, Sadist, masochist, switch)"
# age msg
set age_msg "you are ready for the next step which is !age"
# describe msg
set describe_msg "now you are ready for the next step which is !describeME type info you want all on one line"
# likes msg
set likes_msg "Great all you have left is likes and limits .... type !mylikes and your likes all on one line."
# limits msg
set limits_msg " Fantastic, now you are ready for the last step which is !mylimits type info you want all on one line"
# end msg
set end_msg "Wonderful and thank you!!!!!! You have completed the last step of your profile. If you would like to view what you entered do !desc NICK , Thanks, have fun!"
##############################################################
bind pub - !setup setup_proc
bind pub - !desc desc_proc
bind msgm - "*" pm_proc
set new_profiles_nicks [list]
if {![file exists $profiles_dir]} {
file mkdir $profiles_dir
}
proc add_entry_to_profile { nick data } {
global profiles_dir
set small_nick [string tolower $nick]
set new_entry [open $profiles_dir/$small_nick a]
puts $new_entry $data
close $new_entry
}
proc lines_number { nick } {
global profiles_dir
set lines_counter 0
set small_nick [string tolower $nick]
if {[file exist $profiles_dir/$small_nick]} {
set fetch_data [open $profiles_dir/$small_nick r]
set lines_counter [llength [split [read $fetch_data] "\n"]]
close $fetch_data
}
if {$lines_counter > 0} {
set lines_counter [expr $lines_counter - 1]
}
return $lines_counter
}
proc setup_proc { nick uhost hand chan arg } {
global new_profiles_nicks location_msg profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
putquick "PRIVMSG $nick :$location_msg"
if {[lsearch $new_profiles_nicks $nick] == -1} {
lappend new_profiles_nicks $nick
}
set small_nick [string tolower $nick]
set new_profile_db [open $profiles_dir/$small_nick w]
close $new_profile_db
}
proc desc_proc { nick uhost hand chan arg } {
global new_profiles_nicks profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
set split_args [split $arg]
set input_nick [string tolower [lindex $split_args 0]]
if {$input_nick != ""} {
if {[file exists $profiles_dir/$input_nick]} {
set read_profile [open $profiles_dir/$input_nick r]
set full_data [read $read_profile]
close $read_profile
set desc_line_by_line [split $full_data "\n"]
putquick "PRIVMSG $nick :$input_nick\'s location is: [lindex $desc_line_by_line 0]"
putquick "PRIVMSG $nick :$input_nick is a: [lindex $desc_line_by_line 1]"
putquick "PRIVMSG $nick :$input_nick\'s age is: [lindex $desc_line_by_line 2]"
putquick "PRIVMSG $nick :$input_nick\'s description: [lindex $desc_line_by_line 3]"
putquick "PRIVMSG $nick :$input_nick\'s likes are: [lindex $desc_line_by_line 4]"
putquick "PRIVMSG $nick :$input_nick\'s limits are: [lindex $desc_line_by_line 5]"
} {
putquick "PRIVMSG $chan :$nick: sorry, $input_nick profile doesn't exist"
}
} {
putquick "PRIVMSG $chan :$nick: use, !desc <nickname>"
}
}
proc pm_proc { nick uhost hand arg } {
global new_profiles_nicks sex_msg age_msg describe_msg likes_msg limits_msg end_msg
set split_args [split $arg]
set cmd_name [string tolower [lindex $split_args 0]]
set cmd_data [join [lrange $split_args 1 end]]
set available_cmds {"!location" "!sex-or" "!age" "!describeme" "!mylikes" "!mylimits"}
if {[lsearch $available_cmds $cmd_name] == -1} {
return
}
if {[lsearch $new_profiles_nicks $nick] != -1} {
switch -- $cmd_name {
"!location" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 0} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$sex_msg"
}
} {
putquick "PRIVMSG $nick :use, !location <info>"
}
}
"!sex-or" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 1} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$age_msg"
}
} {
putquick "PRIVMSG $nick :use, !sex-or <info>"
}
}
"!age" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 2} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$describe_msg"
}
} {
putquick "PRIVMSG $nick :use, !age <info>"
}
}
"!describeme" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 3} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$likes_msg"
}
} {
putquick "PRIVMSG $nick :use, !describeme <info>"
}
}
"!mylikes" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 4} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$limits_msg"
}
} {
putquick "PRIVMSG $nick :use, !mylikes <info>"
}
}
"!mylimits" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 5} {
add_entry_to_profile $nick $cmd_data
set temp_new_profiles_nicks [list]
foreach profile_nick [split $new_profiles_nicks] {
if {($profile_nick != "") && ($profile_nick != $nick)} {
lappend temp_new_profiles_nicks $profile_nick
}
}
set new_profiles_nicks $temp_new_profiles_nicks
putquick "PRIVMSG $nick :$end_msg"
}
} {
putquick "PRIVMSG $nick :use, !mylimits <info>"
}
}
}
} {
putquick "PRIVMSG $nick :You need to type !setup on channel at first"
}
}
putlog "profile.tcl ver 0.1 by tomekk loaded"
Code: Select all
set input_nick [lindex $split_args 0]
Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.2
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# channels for !setup
set setup_chans {#channel1 #channel2}
# dir with profile files
set profiles_dir "profiles"
# dir with teasers
set teasers_dir "teasers"
# location msg
set location_msg "Thanks for taking the time to set up a profile so we may better know you. For the first step you do !location (and area you live)"
# sex msg
set sex_msg "you are ready for the next step which is !SEX-OR type in your sex (male/female) and your D/s position (Top/Bottom, Dom/sub, Master/slave, Sadist, masochist, switch)"
# age msg
set age_msg "you are ready for the next step which is !age"
# describe msg
set describe_msg "now you are ready for the next step which is !describeME type info you want all on one line"
# likes msg
set likes_msg "Great all you have left is likes and limits .... type !mylikes and your likes all on one line."
# limits msg
set limits_msg " Fantastic, now you are ready for the last step which is !mylimits type info you want all on one line"
# end msg
set end_msg "Wonderful and thank you!!!!!! You have completed the last step of your profile. If you would like to view what you entered do !desc NICK , Thanks, have fun!"
##############################################################
bind pub - !setup setup_proc
bind pub - !desc desc_proc
bind pub - !teaser teaser_proc
bind msgm - "*" pm_proc
bind join - "*" do_on_join
set new_profiles_nicks [list]
if {![file exists $profiles_dir]} {
file mkdir $profiles_dir
}
if {![file exists $teasers_dir]} {
file mkdir $teasers_dir
}
proc add_entry_to_profile { nick data } {
global profiles_dir
set small_nick [string tolower $nick]
set new_entry [open $profiles_dir/$small_nick a]
puts $new_entry $data
close $new_entry
}
proc lines_number { nick } {
global profiles_dir
set lines_counter 0
set small_nick [string tolower $nick]
if {[file exist $profiles_dir/$small_nick]} {
set fetch_data [open $profiles_dir/$small_nick r]
set lines_counter [llength [split [read $fetch_data] "\n"]]
close $fetch_data
}
if {$lines_counter > 0} {
set lines_counter [expr $lines_counter - 1]
}
return $lines_counter
}
proc setup_proc { nick uhost hand chan arg } {
global new_profiles_nicks location_msg profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
putquick "PRIVMSG $nick :$location_msg"
if {[lsearch $new_profiles_nicks $nick] == -1} {
lappend new_profiles_nicks $nick
}
set small_nick [string tolower $nick]
set new_profile_db [open $profiles_dir/$small_nick w]
close $new_profile_db
}
proc teaser_proc { nick uhost hand chan arg } {
global profiles_dir teasers_dir profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
set teaser_data $arg
set small_nick [string tolower $nick]
if {[file exists $profiles_dir/$small_nick]} {
if {$arg != ""} {
set new_teaser [open $teasers_dir/$small_nick w]
puts $new_teaser $arg
close $new_teaser
putquick "PRIVMSG $nick :done."
}
} {
putquick "PRIVMSG $nick :at first, you need to make your profile, use !setup"
}
}
proc desc_proc { nick uhost hand chan arg } {
global new_profiles_nicks profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
set split_args [split $arg]
set input_nick [string tolower [lindex $split_args 0]]
if {$input_nick != ""} {
if {[file exists $profiles_dir/$input_nick]} {
set read_profile [open $profiles_dir/$input_nick r]
set full_data [read $read_profile]
close $read_profile
set desc_line_by_line [split $full_data "\n"]
putquick "PRIVMSG $nick :$input_nick\'s location is: [lindex $desc_line_by_line 0]"
putquick "PRIVMSG $nick :$input_nick is a: [lindex $desc_line_by_line 1]"
putquick "PRIVMSG $nick :$input_nick\'s age is: [lindex $desc_line_by_line 2]"
putquick "PRIVMSG $nick :$input_nick\'s description: [lindex $desc_line_by_line 3]"
putquick "PRIVMSG $nick :$input_nick\'s likes are: [lindex $desc_line_by_line 4]"
putquick "PRIVMSG $nick :$input_nick\'s limits are: [lindex $desc_line_by_line 5]"
} {
putquick "PRIVMSG $chan :$nick: sorry, $input_nick profile doesn't exist"
}
} {
putquick "PRIVMSG $chan :$nick: use, !desc <nickname>"
}
}
proc do_on_join { nick uhost hand chan } {
global profiles_dir teasers_dir setup_chans botnick
if {[lsearch $setup_chans $chan] == -1} {
return
}
if {$botnick == $nick} {
return
}
set small_nick [string tolower $nick]
if {[file exists $profiles_dir/$small_nick]} {
putquick "MODE $chan +v $nick"
if {[file exists $teasers_dir/$small_nick]} {
set user_teaser ""
set get_teaser [open $teasers_dir/$small_nick r]
gets $get_teaser user_teaser
close $get_teaser
putquick "PRIVMSG $chan :Teaser for $nick - $user_teaser - to view the full profile type: !desc $nick"
}
}
}
proc pm_proc { nick uhost hand arg } {
global new_profiles_nicks sex_msg age_msg describe_msg likes_msg limits_msg end_msg
set split_args [split $arg]
set cmd_name [string tolower [lindex $split_args 0]]
set cmd_data [join [lrange $split_args 1 end]]
set available_cmds {"!location" "!sex-or" "!age" "!describeme" "!mylikes" "!mylimits"}
if {[lsearch $available_cmds $cmd_name] == -1} {
return
}
if {[lsearch $new_profiles_nicks $nick] != -1} {
switch -- $cmd_name {
"!location" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 0} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$sex_msg"
}
} {
putquick "PRIVMSG $nick :use, !location <info>"
}
}
"!sex-or" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 1} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$age_msg"
}
} {
putquick "PRIVMSG $nick :use, !sex-or <info>"
}
}
"!age" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 2} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$describe_msg"
}
} {
putquick "PRIVMSG $nick :use, !age <info>"
}
}
"!describeme" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 3} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$likes_msg"
}
} {
putquick "PRIVMSG $nick :use, !describeme <info>"
}
}
"!mylikes" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 4} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$limits_msg"
}
} {
putquick "PRIVMSG $nick :use, !mylikes <info>"
}
}
"!mylimits" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 5} {
add_entry_to_profile $nick $cmd_data
set temp_new_profiles_nicks [list]
foreach profile_nick [split $new_profiles_nicks] {
if {($profile_nick != "") && ($profile_nick != $nick)} {
lappend temp_new_profiles_nicks $profile_nick
}
}
set new_profiles_nicks $temp_new_profiles_nicks
putquick "PRIVMSG $nick :$end_msg"
}
} {
putquick "PRIVMSG $nick :use, !mylimits <info>"
}
}
}
} {
putquick "PRIVMSG $nick :You need to type !setup on channel at first"
}
}
putlog "profile.tcl ver 0.2 by tomekk loaded"
Code: Select all
< {AoD}`sdfsdf>
Code: Select all
#
#
#
#
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
#
# channels for !setup
set setup_chans {#taxreligion #EPL #EPL-Staff}
# dir with profile files
set profiles_dir "profiles"
# location msg
set location_msg "Thanks for setting up your profile on QuakeNet's EPL channel. For the first step, set up your location using !location. For example: !location London, UK"
# sex msg
set sex_msg "Next, you will specify your sex using !sex. For example: !sex male"
# age msg
set age_msg "Now we will specify your age using !age. For example: !age 28"
# describe msg
set describe_msg "We use !describeme to set a short description of yourself. For example: !describeme I am the greatest forward you will ever meet."
# team msg
set team_msg "Great all you have left is your favored team and player... use !team for your team. For example: !team Liverpool"
# player msg
set player_msg "Now you are ready for the last step which is !player. For example: !player Ronaldo"
# end msg
set end_msg "Thanks for setting up your profile with QuakeNet's EPL channel. If you would like to view what you entered use !profile NICK , Thanks, have fun!"
##############################################################
bind pub -|- !setup setup_proc
bind pub -|- !profile desc_proc
bind msgm -|- "*" pm_proc
set new_profiles_nicks [list]
if {![file exists $profiles_dir]} {
file mkdir $profiles_dir
}
proc add_entry_to_profile { nick data } {
global profiles_dir
set small_nick [string tolower $nick]
set new_entry [open $profiles_dir/$small_nick a]
puts $new_entry $data
close $new_entry
}
proc lines_number { nick } {
global profiles_dir
set lines_counter 0
set small_nick [string tolower $nick]
if {[file exist $profiles_dir/$small_nick]} {
set fetch_data [open $profiles_dir/$small_nick r]
set lines_counter [llength [split [read $fetch_data] "\n"]]
close $fetch_data
}
if {$lines_counter > 0} {
set lines_counter [expr $lines_counter - 1]
}
return $lines_counter
}
proc setup_proc { nick uhost hand chan arg } {
global new_profiles_nicks location_msg profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
putquick "PRIVMSG $nick :$location_msg"
if {[lsearch $new_profiles_nicks $nick] == -1} {
lappend new_profiles_nicks $nick
}
set small_nick [string tolower $nick]
set new_profile_db [open $profiles_dir/$small_nick w]
close $new_profile_db
}
proc desc_proc { nick uhost hand chan arg } {
global new_profiles_nicks profiles_dir setup_chans
if {[lsearch $setup_chans $chan] == -1} {
return
}
set split_args [split $arg]
set input_nick [string tolower [lindex $split_args 0]]
if {$input_nick != ""} {
if {[file exists $profiles_dir/$input_nick]} {
set read_profile [open $profiles_dir/$input_nick r]
set full_data [read $read_profile]
close $read_profile
set desc_line_by_line [split $full_data "\n"]
putquick "PRIVMSG $nick :\0037Profile for $split_args\003 \002Sex:\002 [lindex $desc_line_by_line 1], \002Age:\002 [lindex $desc_line_by_line 2], \002Location:\002 [lindex $desc_line_by_line 0], \002Supported Team:\002 [lindex $desc_line_by_line 4], \002Favorite Player:\002 [lindex $desc_line_by_line 5], \002Description:\002 [lindex $desc_line_by_line 3]"
} {
putquick "PRIVMSG $chan :$nick: Sorry, $input_nick hasn't used !setup to create a profile."
}
} {
putquick "PRIVMSG $chan :$nick: use, !profile <nickname>"
}
}
proc pm_proc { nick uhost hand arg } {
global new_profiles_nicks sex_msg age_msg describe_msg team_msg player_msg end_msg
set split_args [split $arg]
set cmd_name [string tolower [lindex $split_args 0]]
set cmd_data [join [lrange $split_args 1 end]]
set available_cmds {"!location" "!sex" "!age" "!describeme" "!team" "!player"}
if {[lsearch $available_cmds $cmd_name] == -1} {
return
}
if {[lsearch $new_profiles_nicks $nick] != -1} {
switch -- $cmd_name {
"!location" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 0} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$sex_msg"
}
} {
putquick "PRIVMSG $nick :use, !location <info>"
}
}
"!sex" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 1} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$age_msg"
}
} {
putquick "PRIVMSG $nick :use, !sex <info>"
}
}
"!age" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 2} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$describe_msg"
}
} {
putquick "PRIVMSG $nick :use, !age <info>"
}
}
"!describeme" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 3} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$team_msg"
}
} {
putquick "PRIVMSG $nick :use, !describeme <info>"
}
}
"!team" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 4} {
add_entry_to_profile $nick $cmd_data
putquick "PRIVMSG $nick :$player_msg"
}
} {
putquick "PRIVMSG $nick :use, !team <info>"
}
}
"!player" {
if {$cmd_data != ""} {
if {[lines_number $nick] == 5} {
add_entry_to_profile $nick $cmd_data
set temp_new_profiles_nicks [list]
foreach profile_nick [split $new_profiles_nicks] {
if {($profile_nick != "") && ($profile_nick != $nick)} {
lappend temp_new_profiles_nicks $profile_nick
}
}
set new_profiles_nicks $temp_new_profiles_nicks
putquick "PRIVMSG $nick :$end_msg"
}
} {
putquick "PRIVMSG $nick :use, !player <info>"
}
}
}
} {
putquick "PRIVMSG $nick :You need to type !setup on channel at first"
}
}
putlog "profile.tcl ver 0.1 by tomekk loaded"
zombie_gaz wrote:My request, however, is that !profile defaults to the profile of the person requesting. Right now you have to do a !profile NICK and if you do just !profile you get a message that says you must specify a nick. Is there a way to make it so that just !profile will default to the nick of the person requesting?
Thanks in advance!
Code: Select all
# inside the proc desc_proc
# Change this:
set input_nick [string tolower [lindex $split_args 0]]
# Into this:
if {![string length [set input_nick [string tolower [lindex $split_args 0]]]} { set input_nick $nick }
hmm, i don't get itzombie_gaz wrote:When I use !profile the bot says that I haven't set up a profile. Yet using !profile NICK still works. Could it have something to do with it not recognising case?
EDIT: Yeah... when I change my nick to all lowercase, just !profile brings up my profile (but without my nick showing up in the message like when I use !profile NICK... $split_args).