JaneR
05-07-2006, 15:09
oyun.conf
#===================== LINE NEEDED FOR LOADCONF ====================#
#! /path/to/eggdrop
#======================= GENERAL BOT SETTINGS ======================#
set username "bots"
set admin "JaneR <caner@hotmail.gen.tr>"
set network "SERVERIP"
set timezone "EST"
set offset "5"
set my-hostname "SERVERIP"
set my-ip "SERVERIP"
#==================== GENERAL BOT LGING OPTIONS ==================#
set max-lsize 0
set quick-ls 0
set l-time 1
set keep-all-ls 0
set switch-lfiles-at 300
set quiet-save 0
set console "mkcobxs"
#================ GENERAL BOT FILE/LOCATION SETTINGS ===============#
set userfile "scripts/log/Oyun.user"
set sort-users 0
set help-path "help/"
set temp-path "/tmp"
set motd "motd"
set telnet-banner "telnet-banner"
#====================== GENERAL BOTNET OPTIONS =====================#
#set botnet-nick "JaneR"
set protect-telnet 0
set dcc-sanitycheck 0
set ident-timeout 5
set require-p 0
set open-telnets 0
set stealth-telnets 0
set use-telnet-banner 0
set connect-timeout 15
set dcc-flood-thr 3
set telnet-flood 5:60
set paranoid-telnet-flood 1
set resolve-timeout 15
#===================== ADVANCED SETTINGS FOR BOT ===================#
#set firewall "proxy:178"
#set nat-ip "127.0.0.1"
#set reserved-port 9076
set ignore-time 0
set hourly-updates 00
set owner "JaneR"
set notify-newusers "$owner"
set default-flags "hp"
set whois-fields "url birthday"
set remote-boots 2
set share-unlinks 1
set die-on-sighup 0
set die-on-sigterm 0
unbind dcc n tcl *dcc:tcl
unbind dcc n set *dcc:set
set must-be-owner 0
unbind dcc n simul *dcc:simul
set max-dcc 50
set dcc-portrange 1024:65535
set enable-simul 1
set allow-dk-cmds 1
#==================== GENERAL BOT MODULE SETTINGS ==================#
set mod-path "modules/"
#==================== GENERAL BOT CHANNEL MODULES ==================#
loadmodule channels
set chanfile "scripts/log/Oyun.chan"
set ban-time 0
set exempt-time 60
set invite-time 60
# set force-expire 0
set share-greet 0
set use-info 1
set global-flood-chan 5:3
set global-flood-deop 5:10
set global-flood-kick 0:0
set global-flood-join 8:30
set global-flood-ctcp 8:30
set global-chanset {
+clearbans +enforcebans
+dynamicbans +userbans
+autoop -bitch
+greet +nodesynch
+statusl -stopnethack
-revenge -secret
-autovoice +cycle
+dontkickops -wasoptest
-inactive +protectfriends
+shared -seen
+userexempts +dynamicexempts
+userinvites +dynamicinvites
}
channel add #oyun {
need-op { putserv "MODE #oyun +o $botnick " }
chanmode "+nt-m"
idle-kick 0
}
set global-chanmode ""
#==================== GENERAL BOT SERVER MODULES ===================#
loadmodule server
set net-type 0
set nick "Oyun"
set realname "Eggdrop Bot"
set init-server { putserv "PRIVMSG nickserv :identify sifre"
}
set servers {
SERVERIP:6667
}
set keep-nick 1
set use-ison 1
set strict-host 0
set quiet-reject 1
set lowercase-ctcp 0
set answer-ctcp 3
set flood-msg 0:0
# how many CTCPs in how many seconds?
set flood-ctcp 0:0
set never-give-up 1
set strict-servernames 0
set default-port 6667
set server-cycle-wait 30
set server-timeout 15
set servlimit 0
set check-stoned 1
set use-console-r 0
set debug-output 0
set serverror-quit 1
set max-queue-msg 300
set trigger-on-ignore 0
set double-mode 0
set double-server 0
set double-help 0
#set use-silence 1
#set check-mode-r 1
loadmodule ctcp
set ctcp-mode 0
loadmodule irc
set bounce-bans 1
set bounce-modes 0
set kick-bus-bans 1
set bounce-bus-bans 1
set max-bans 20
set max-modes 30
set allow-desync 0
set kick-bus 0
set ban-bus 0
set kick-fun 0
set ban-fun 0
set learn-users 0
set wait-split 600
set wait-info 180
set mode-buf-length 200
#unbind msg - hello *msg:hello
#bind msg - myword *msg:hello
unbind msg - ident *msg:ident
unbind msg - addhost *msg:addhost
#bind msg - myidentword *msg:ident
set no-chanrec-info 0
set revenge-mode 1
set bounce-exempts 0
set bounce-invites 0
set max-exempts 20
set max-invites 20
set bounce-bus-exempts 0
set kick-bus-exempts 0
set bounce-bus-invites 0
set kick-bus-invites 0
# set use-exempts 0
# set use-invites 0
set prevent-mixing 1
#set kick-method 1
#set modes-per-line 3
#set use-354 0
#set rfc-compliant 1
#loadmodule transfer
set max-dloads 3
set dcc-block 1024
set copy-to-tmp 1
set xfer-timeout 30
#==================== GENERAL BOT SHARE MODULES ====================#
#loadmodule share
#set allow-resync 0
#set resync-time 900
#set private-owner 0
#set private-global 0
#set private-globals "mnot"
#set private-user 0
#================== GENERAL BOT FILESYSTEM MODULES =================#
#loadmodule filesys
set files-path "/home/TELNETLOGİNismi/filesys"
set incoming-path "/home/TELNETLOGİNismi/filesys/incoming"
set upload-to-pwd 0
set filedb-path ""
set max-file-users 20
set max-filesize 1024
#===================== GENERAL BOT NOTES MODULES ===================#
loadmodule notes
set notefile "scripts/log/Oyun.notes"
set max-notes 50
set note-life 60
set allow-fwd 0
set notify-users 1
set notify-onjoin 1
#==================== GENERAL BOT CONSOLE MODULES ==================#
loadmodule console
set console-autosave 1
set force-channel 0
set info-party 0
#==================== GENERAL BOT WOOBIE MODULES ===================#
#loadmodule woobie
#===================== GENERAL BOT SEEN MODULES ====================#
#loadmodule seen
#==================== GENERAL BOT BLOWFISH MODULES =================#
checkmodule blowfish
#===================== GENERAL BOT ASSOC MODULES ===================#
#loadmodule assoc
#===================== GENERAL BOT WRITE MODULES ===================#
#loadmodule wire
#======================== GENERAL BOT SCRIPTS ======================#
source scripts/alltools.tcl
source scripts/action.fix.tcl
source scripts/userinfo.tcl
source scripts/oyun.tcl
#===================== GENERAL BOT HELP MODULES ====================#
loadhelp scripts/userinfo.help
oyun.tcl dosyası
################################################## ####################
#PLEASE customise the settings before rehashing your bot! #
################################################## ####################
# The full path to the file containing the questions and answers.
# The account the bot runs on must have read access to this file.
set tgqdb "/home/TELNETLOGİNismi/eggdrop/scripts/trivia.questions"
# The full path to the file which tracks the scores. The account
# the bot runs on must have read & write access to this file. If
# the file does not exist, it will be created when needed.
set tgscf "/home/TELNETLOGİNismi/eggdrop/scripts/trivia.skor"
# The full path to the file which records error reports. The
# account the bot runs on must have read & write access to this
# file. If the file does not exist, it will be created when needed.
set tgerrfil "/home/TELNETLOGİNismi/eggdrop/scripts/trivia.errors"
# The name of the channel where the game will be played. The game
# can only be played on one channel.
set tgchan "#oyun"
# How many points to give a person for a correctly answered
# question.
set tgpointsperanswer 1
# The maximum number of hints to give before the question 'expires'
# and the bot goes on to another one. This EXCLUDES the first hint
# given as the question is asked (i.e. the hint which shows no letters,
# only placeholders).
set tgmaxhint 4
# The minimum number of correct answers in a row by one person which
# puts them on a winning streak. Setting this to 0 will disable the
# winning streak feature.
set tgstreakmin 3
# The number of missed (i.e. unanswered, not skipped) questions to allow
# before automatically stopping the game. Setting this to 0 will cause the
# game to run until somebody uses the stop command, or the bot dies, gets
# killed, pings out, or whatever.
set tgmaxmissed 50
# The character to use as a placeholder in hints.
set tghintchar "*"
# The time in seconds between hints.
set tgtimehint 20
# The time in seconds between a correct answer, 'expired' or skipped question
# and the next question being asked.
set tgtimenext 10
# Phrases to use at random when someone answers a question correctly. This must
# be a TCL list. If you don't know what that means, stick to the defaults.
set tgcongrats [list "Bravo" "Başarılar" "İyi gidiyorsun" "Helal sana" "Harikasın sen ya... Soruyu bilen " "başarılar sana " "Göster onlara kim olduğunu " "Zihin gücünüzü iyi kullanın."]
# Phrases to use when the question has 'expired'. Must also be a TCL list.
set tgnobodygotit [list "Soru cevaplayacak kişiler aranıyor... ;)" "Merhaba? Kimse var mı?" "Çok mu zor bu sorular... hadiiii yaparsınız siz ;)" "Yine kaçırdınız... ;)" "Yalnız kaldım sanırım ?" "Top10 listesi çok iyi! Hadi devam... "]
# Phrases to use when the question expired and there's another one coming up.
# Yep, you guessed it... another TCL list.
set tgtrythenextone [list "Hadi görelim sizi..." "Sonraki soru için hazır olun..." "Birinci olabilme ihtimali her zaman vardir... ;)" "Deneyin ve birinci olun..." "Gaming...!"]
# Will the bot show the correct answer if nobody gets it (1) or not (0)?
set tgshowanswer 1
# Use bold codes in messages (1) or not (0)?
set tgusebold 0
# Send private messages using /msg (1) or not (0)?
# If set to 0, private messages will be sent using /notice
set tgpriv2msg 1
# Word to use as /msg command to give help.
# e.g. set tgcmdhelp "helpme" will make the bot give help when someone
# does "/msg <botnick> helpme"
set tgcmdhelp "?"
# Channel command used to start the game.
set tgcmdstart "!basla"
# Flags required to be able to use the start command.
set tgflagsstart -|-
# Channel command used to stop the game.
set tgcmdstop "!asdqdqxcqxqxqxqqxqxqjaner"
# Flags required to be able to use the stop command.
set tgflagsstop -|-
# Channel command used to give a hint.
set tgcmdhint "!ipucu"
# Flags required to be able to use the hint command.
set tgflagshint -|-
# Channel command used to skip the question.
set tgcmdskip "!xcqcxqcqshasdasdhasdhasjaner"
# Flags required to be able to use the skip command.
set tgflagsskip -|-
# Channel command for showing the top 10 scores.
set tgcmdtop10 "!top10"
set tgflagstop10 "-|-"
# /msg command used to reset scores.
set tgcmdreset "!ahsdhayqyqyqxhhxqaxzxajaner"
# Flags required to be able to use the reset command.
set tgflagsreset o|o
# /msg command for looking up somebody's score.
set tgcmdlookup "!skor"
# /msg command for looking up your target.
# (i.e. the person ranked one higher than you).
set tgcmdtarget "!hedef"
# /msg command for reporting errors in questions and/or answers.
set tgcmderror "!hata"
# /msg command to show channel's rules.
set tgcmdrules "!kural"
# Channel's rules.
set tgrules "Coder JaneR!"
# Number of minutes between reminders of how to report errors.
set tgerrremindtime 5
# COLOURS
# The colour codes used are the same as those used by mIRC:
# 00:white 01:black 02:dark blue 07:dark green
# 04:red 05:brown 09:purple 07:orange
# 07:yellow 09,1:light green 10:turquoise 11:cyan
# 09,1:light blue 13:magenta 14:dark grey 15:light grey
#
# Always specify colour codes as two digits, i.e. use "01" for
# black, not "1".
# You can specify a background colour using "00,04" (white text
# on red background).
# To disable a colour, use "".
set tgcolourstart "05" ;#Game has started.
set tgcolourstop "04" ;#Game has stopped.
set tgcolourskip "12" ;#Bezirgan has been skipped.
set tgcolourerr "04" ;#How to report errors.
set tgcolourmiss "10" ;#Nobody answered the question.
set tgcolourqhead "04" ;#Bezirgan heading.
set tgcolourqbody "12" ;#Bezirgan itself.
set tgcolourhint "3" ;#ipucu.
set tgcolourstrk "12" ;#Person is on a winning streak.
set tgcolourscr1 "04" ;#Score of person in first place.
set tgcolourscr2 "12" ;#Score of person in second place.
set tgcolourscr3 "03" ;#Score of person in third place.
set tgcolourrset "04" ;#Scores have been reset.
set tgcolourstend "12" ;#Winning streak ended.
set tgcolourmisc1 "06" ;#Miscellaneous colour #1.
set tgcolourmisc2 "04" ;#Miscellaneous colour #2.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Any editing done beyond this point is done at your own risk! #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#Misc checks & var initialisations
if {![file exists $tgqdb]} {
putlog "\002[file tail [info script]]\002 failed to load: $tgqdb does not exist."
return
}
if {![info exists alltools_loaded]||$allt_version<204} {
putlog "\002[file tail [info script]]\002 failed to load: please load alltools.tcl v1.6 or higher before attempting to use this script."
return
}
if {[llength [split $tgchan]]!=1} {
putlog "\002[file tail [info script]]\002 failed to load: too many channels specified."
return
}
if {![info exists tgplaying]} {set tgplaying 0}
if {![info exists tghintnum]} {set tghintnum 0}
if {![info exists tgmissed]} {set tgmissed 0}
#Binds
bind pub $tgflagsstart $tgcmdstart tgstart
bind pub $tgflagsstop $tgcmdstop tgstop
bind pub $tgflagshint $tgcmdhint tgforcehint
bind pub $tgflagsskip $tgcmdskip tgskip
bind pub $tgflagstop10 $tgcmdtop10 tgshowtop10
# bind join -|- "$tgchan *" tgjoinmsg
bind msg - $tgcmdhelp tggivehelp
bind msg - $tgcmdlookup tgscorelookup
bind msg - $tgcmdtarget tgtargetlookup
bind msg - $tgcmderror tgerror
bind msg - $tgcmdrules tgrulesmsg
bind msg $tgflagsreset "$tgcmdreset" tgresetscores
bind kick - "$tgchan $botnick" tgbotgotkicked
bind evnt - disconnect-server tgbotgotdisconnected
proc tgshowtop10 {nick host hand chan text} {
global tgscores tgchan tgscorestotal
if {[strlwr $chan]==[strlwr $tgchan]} {
tggetscores
if {$tgscorestotal>0} {
if {$tgscorestotal>9} {
set _max 9
} else {
set _max [expr $tgscorestotal-1]
}
set i 0
while {$i<=$_max} {
set _item [lindex $tgscores $i]
set _nick [join [lindex [split $_item ,] 2]]
set _score [join [lindex [split $_item ,] 0]]
if {$i==0} {
append _scores "[tgcolscr1]$_nick $_score"
} elseif {$i==1} {
append _scores ", [tgcolscr2]$_nick $_score"
} elseif {$i==2} {
append _scores ", [tgcolscr3]$_nick $_score"
} else {
append _scores ", [tgcolmisc1]$_nick $_score"
}
incr i
}
tggamemsg "[tgcolmisc1]Top 10 Listesi: $_scores"
} else {
tggamemsg "[tgcolmisc1]Skor Tablosu Boş."
}
}
}
#starts the game if it isn't running.
proc tgstart {nick host hand chan text} {
global tgplaying tgstreak tgchan tgerrremindtime tgerrremindtimer tgmissed
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==0} {
tggamemsg "[tgcolstart]Oyunu Baslatan $nick!"
tgnext
set tgplaying 1
set tgstreak 0
set tgmissed 0
set tgerrremindtimer [timer $tgerrremindtime tgerrremind]
}
return 1
}
}
#stops the game if it's running.
proc tgstop {nick host hand chan text} {
global tghinttimer tgnexttimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin
global tgerrremindtimer
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1} {
tggamemsg "[tgcolstop]Oyunu Durduran $nick!"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
set tgplaying 0
catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}
if {[utimerexists tghint]!=""} {killutimer $tghinttimer}
if {[utimerexists tgnext]!=""} {killutimer $tgnexttimer}
if {[timerexists tgerrremind]!=""} {killtimer $tgerrremindtimer}
}
return 1
}
}
#gives a hint if there is currently a question to answer.
proc tgforcehint {nick host hand chan text} {
global tghinttimer tgnexttimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin
global tgtempnohint tghintmax tghintnum
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1&&[utimerexists tghint]!=""} {
killutimer $tghinttimer
tghint
}
return 1
}
}
#skips the current question if one has been asked.
proc tgskip {nick host hand chan text} {
global tghinttimer tgnexttimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin tgtimenext
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1&&[utimerexists tghint]!=""} {
tggamemsg "[tgcolskip]Soru $nick Tarafından Direkt Olarak Geçildi!"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer
killutimer $tghinttimer
set tgnexttimer [utimer $tgtimenext tgnext]
}
return 1
}
}
#reminds channel how to report errors in questions/answers
proc tgerrremind {} {
global tgerrremindtimer tgerrremindtime botnick tgcmderror
# tggamemsg "[tgcolerr]Unutmayin!: Hatalı gordugunuz sorulari bize bildirmek icin lutfen /msg $botnick $tgcmderror <soru numarasi> \[hata sebebi\] yazınız..."
set tgerrremindtimer [timer $tgerrremindtime tgerrremind]
}
#bot got kicked. stop the game.
proc tgbotgotkicked {nick host hand chan targ text} {
tgquietstop
}
#bot got disconnected. stop the game.
proc tgbotgotdisconnected {disconnect-server} {
tgquietstop
}
#stops the game without telling the channel.
proc tgquietstop {} {
global tgplaying tgstreak tgchan tgcurrentanswer tghinttimer tgnexttimer tgerrremindtimer
if {$tgplaying==1} {
set tgstreak 0
set tgplaying 0
catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}
if {[utimerexists tghint]!=""} {killutimer $tghinttimer}
if {[utimerexists tgnext]!=""} {killutimer $tgnexttimer}
if {[timerexists tgerrremind]!=""} {killtimer $tgerrremindtimer}
}
}
#reads the question database.
proc tgreadqdb {} {
global tgqdb tgquestionstotal tgquestionslist
set tgquestionstotal 0
set tgquestionslist ""
set qfile [open $tgqdb r]
while {![eof $qfile]} {
lappend tgquestionslist [gets $qfile]
incr tgquestionstotal
}
close $qfile
}
#selects the next question.
proc tgnext {} {
global tgqdb tgcurrentquestion tgcurrentanswer tgquestionnumber tgquestionstotal
global tghintnum tgchan tgquestionslist
tgreadqdb
set tgquestionnumber [rand [llength $tgquestionslist]]
set tgquestionselected [lindex $tgquestionslist $tgquestionnumber]
set tgcurrentquestion [lindex [split $tgquestionselected |] 1]
set tgcurrentanswer [strlwr [lindex [split $tgquestionselected |] 0]]
unset tghintnum
tghint
bind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer
return
}
#shows timed hints.
proc tghint {} {
global tgmaxhint tghintnum tgcurrentanswer tghinttimer tgchan
global tgtimehint tghintchar tgquestionnumber tgquestionstotal
global tgcurrentquestion tghintcharsused tgnexttimer tgtimenext tgstreak tgstreakmin
global tgnobodygotit tgtrythenextone tgmissed tgmaxmissed tgcmdstart tgshowanswer
global tgtimestart
if {[catch {incr tghintnum}]!=0} {set tghintnum 0}
if {$tghintnum >= [expr $tgmaxhint+1]} {
incr tgmissed
set _msg ""
append _msg "[tgcolmiss][lindex $tgnobodygotit [rand [llength $tgnobodygotit]]]"
if {$tgshowanswer==1} {
append _msg " Dogru Cevap [tgcolmisc2][strupr $tgcurrentanswer][tgcolmiss]."
}
if {$tgmaxmissed>0&&$tgmissed>=$tgmaxmissed} {
append _msg " Bu $tgmissed . Cevaplanmayan Soru! Oyun Otomatikman Durdurulmuştur! Oyunu Tekrar Başlatmak İçin Lütfen $tgcmdstart Yazınız!"
tgquietstop
} else {
append _msg " [lindex $tgtrythenextone [rand [llength $tgtrythenextone]]]"
}
tggamemsg "[tgcolmiss]$_msg"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}
if {$tgmaxmissed==0||$tgmissed<$tgmaxmissed} {
set tgnexttimer [utimer $tgtimenext tgnext]
}
return
} elseif {$tghintnum == 0} {
set i 0
set _hint {}
set tghintcharsused {}
regsub -all -- "\[A-Za-z0-9\]" $tgcurrentanswer $tghintchar _hint
set tgtimestart [clock clicks -milliseconds]
} elseif {$tghintnum == 1} {
set i 0
set _hint {}
while {$i<[llength [split $tgcurrentanswer]]} {
set _word [lindex [split $tgcurrentanswer] $i]
set j 0
set _newword {}
while {$j<[strlen $_word]} {
if {$j==0} {
append _newword [stridx $_word $j]
lappend tghintcharsused $i,$j
} else {
if {[string is alnum [stridx $_word $j]]} {
append _newword $tghintchar
} else {
append _newword [stridx $_word $j]
lappend tghintcharsused $i,$j
}
}
incr j
}
lappend _hint $_newword
incr i
}
} else {
set i 0
set _hint {}
while {$i<[llength [split $tgcurrentanswer]]} {
set _word [lindex [split $tgcurrentanswer] $i]
set j 0
set _newword {}
set _selected [rand [strlen $_word]]
regsub -all -- "\[^A-Za-z0-9\]" $_word "" _wordalnum
if {[strlen $_wordalnum]>=$tghintnum} {
while {[lsearch $tghintcharsused $i,$_selected]!=-1||[string is alnum [stridx $_word $_selected]]==0} {
set _selected [rand [strlen $_word]]
}
}
lappend tghintcharsused $i,$_selected
while {$j<[strlen $_word]} {
if {[lsearch $tghintcharsused $i,$j]!=-1||[string is alnum [stridx $_word $j]]==0} {
append _newword [stridx $_word $j]
} else {
if {[string is alnum [stridx $_word $j]]} {
append _newword $tghintchar
}
}
incr j
}
lappend _hint $_newword
incr i
}
}
tggamemsg "[tgcolqhead]===== Soru [expr $tghintnum?"(ipucu $tghintnum/$tgmaxhint)":""] ====="
tggamemsg "[tgcolqbody]$tgcurrentquestion"
tggamemsg "[tgcolhint]ipucu: $_hint"
set tghinttimer [utimer $tgtimehint tghint]
}
#triggered when someone says the correct answer.
proc tgcorrectanswer {nick host hand chan text} {
global tgcurrentanswer tghinttimer tgtimenext tgchan tgnexttimer tgstreak tgstreakmin
global tgscoresbyname tgranksbyname tgranksbynum tgcongrats tgscorestotal tgmissed
global tgtimestart
tggetscores
if {![info exists tgranksbyname([strlwr $nick])]} {
set _oldrank 0
} else {
set _oldrank [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]
}
tgincrscore $nick
tggetscores
set _newrank [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]
set _timetoanswer [expr [expr [clock clicks -milliseconds]-$tgtimestart]/1000.00]
set _msg "[tgcolmisc1][lindex $tgcongrats [rand [llength $tgcongrats]]] [tgcolmisc2]$nick[tgcolmisc1]! Dogru Cevap [tgcolmisc2][strupr $tgcurrentanswer][tgcolmisc1]. Toplam [tgcolmisc2]$_timetoanswer[tgcolmisc1] Saniyede Bildiniz."
if {$_newrank<$_oldrank} {
if {$_newrank==1} {
append _msg " Tebrikler "
} else {
append _msg ""
}
}
tggamemsg "$_msg"
if {$tgstreak!=0} {
if {[lindex [split $tgstreak ,] 0]==[strlwr $nick]} {
set tgstreak [strlwr $nick],[expr [lindex [split $tgstreak ,] 1]+1]
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} {
tggamemsg "[tgcolstrk]$nick Bravo Strike Yapıyorsunuz [lindex [split $tgstreak ,] 1] Soruyu Ard Arda Siz Bildiniz! Diğerleriyle Aranızda Fark Oluşmaya Başladı!"
}
} else {
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak [strlwr $nick],1
}
} else {
set tgstreak [strlwr $nick],1
}
set tgmissed 0
tgshowscores
unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer
killutimer $tghinttimer
set tgnexttimer [utimer $tgtimenext tgnext]
return 1
}
#read current scores from file, sort and store in variable.
proc tggetscores {} {
global tgscf tgscorestotal tgscores tgscoresbyname tgranksbyname tgranksbynum tgrealnames
if {[file exists $tgscf]&&[file size $tgscf]>2} {
set _sfile [open $tgscf r]
set tgscores [lsort -dict -decreasing [split [gets $_sfile]]]
close $_sfile
set tgscorestotal [llength $tgscores]
} else {
set tgscores ""
set tgscorestotal 0
}
if {[info exists tgscoresbyname]} {unset tgscoresbyname}
if {[info exists tgranksbyname]} {unset tgranksbyname}
if {[info exists tgrealnames]} {unset tgrealnames}
if {[info exists tgranksbynum]} {unset tgranksbynum}
set i 0
while {$i<[llength $tgscores]} {
set _item [lindex $tgscores $i]
set _nick [lindex [split $_item ,] 2]
set _lwrnick [lindex [split $_item ,] 3]
set _score [lindex [split $_item ,] 0]
set tgscoresbyname($_lwrnick) $_score
set tgrealnames($_lwrnick) $_nick
set tgranksbyname($_lwrnick) [expr $i+1],$_score
set tgranksbynum([expr $i+1]) $_lwrnick,$_score
incr i
}
return
}
#increment someone's score.
proc tgincrscore {who} {
global tgscores tgscf tgpointsperanswer tgscorestotal tgscoresbyname
tggetscores
if {$tgscorestotal>0} {
set i 0
if {![info exists tgscoresbyname([strlwr $who])]} {
append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who] "
}
while {$i<[llength $tgscores]} {
set _item [lindex $tgscores $i]
set _nick [lindex [split $_item ,] 2]
set _time [lindex [split $_item ,] 1]
set _score [lindex [split $_item ,] 0]
if {[strlwr $who]==[strlwr $_nick]} {
append _newscores "[expr $_score+$tgpointsperanswer],[expr 1000000000000.0/[unixtime]],$who,[strlwr $who][expr [expr [llength $tgscores]-$i]==1?"":"\ "]"
} else {
append _newscores "$_score,$_time,$_nick,[strlwr $_nick][expr [expr [llength $tgscores]-$i]==1?"":"\ "]"
}
incr i
}
} else {
append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who]"
}
set _sfile [open $tgscf w]
puts $_sfile "$_newscores"
close $_sfile
return
}
#shows the current scores on channel.
proc tgshowscores {} {
global tgscores tgchan tgscorestotal
tggetscores
set i 0
while {$i<[llength $tgscores]} {
set _item [lindex $tgscores $i]
set _nick [lindex [split $_item ,] 2]
set _score [lindex [split $_item ,] 0]
if {$i==0} {
append _scores "[tgcolscr1]$_nick $_score"
} elseif {$i==1} {
append _scores ", [tgcolscr2]$_nick $_score"
} elseif {$i==2} {
append _scores ", [tgcolscr3]$_nick $_score"
} elseif {[onchan $_nick $tgchan]} {
append _scores ", [tgcolmisc1]$_nick $_score"
}
incr i
}
tggamemsg "[tgcolmisc1]Sonuclar Ve Puan: $_scores"
}
#reset current scores.
proc tgresetscores {nick host hand text} {
global tgscf tgscorestotal tgscores
if {[file exists $tgscf]&&[file size $tgscf]>2} {
set _sfile [open $tgscf w]
puts $_sfile ""
close $_sfile
set tgscores ""
set tgscorestotal 0
}
tggamemsg "[tgcolrset]===== Skor Tablosu $nick! Tarafından Resetlendi ====="
return 1
}
#triggered when a winning streak ends.
proc tgstreakend {} {
global tgstreak tgrealnames
tggamemsg "[tgcolstend]Bravo $tgrealnames([lindex [split $tgstreak ,] 0]) Çok Fazla Strike ye Sahipsiniz... Tebrikler!"
return
}
#triggered when someone joins trivia chan.
proc tgjoinmsg {nick host hand chan} {
global botnick tgplaying tgcmdhelp tgcmdstart tgflagsstart tgcmdstop tgflagsstop tgchan
if {$nick != $botnick} {
set _msg ""
append _msg "Welcome to $botnick's Trivia Channel. Trivia Oyunu Şuanda"
if {$tgplaying==1} {
append _msg " \002on\002."
} else {
append _msg " \002off\002."
}
if {[matchattr $hand $tgflagsstart $tgchan]&&$tgplaying==0} {
append _msg " Oyunu Başlatmak İçin, Lütfen \002$tgcmdstart\002 Yazınız"
}
append _msg " Yardıma İhtiyacınız Olursa \002/MSG $botnick [strupr
$tgcmdhelp]\002 Yazınız! :-) (JaneR@kaLp.biz)"
[tgpriv] $nick "$_msg"
}
}
#triggered when someone /msgs the bot with the score lookup command.
proc tgscorelookup {nick host hand text} {
global tgscoresbyname tgranksbyname tgscorestotal tgrealnames
if {$text==""} { set text $nick } else { set text [lindex [split $text] 0] }
tggetscores
if {![info exists tgscoresbyname([strlwr $text])]} {
if {[strlwr $text]==[strlwr $nick]} {
set _who "[tgcolmisc1]Siz"
} else {
set _who "[tgcolmisc2]$text [tgcolmisc1]is"
}
[tgpriv] $nick "[tgbold]$_who [tgcolmisc1]Skor Tablosunda Yoksunuz!"
} else {
if {[strlwr $text]==[strlwr $nick]} {
set _who "[tgcolmisc1]Siz"
} else {
set _who "[tgcolmisc2]$tgrealnames([strlwr $text]) [tgcolmisc1]is"
}
[tgpriv] $nick "[tgbold]$_who [tgcolmisc2]$tgscoresbyname([strlwr $text])[tgcolmisc1] Soru Bildiniz , Ranked [tgcolmisc2][tgordnum [lindex [split $tgranksbyname([strlwr $text]) ,] 0]] [tgcolmisc1]of [tgcolmisc2]$tgscorestotal[tgcolmisc1]."
}
return 1
}
#triggered when someone /msgs the bot with the target lookup command.
proc tgtargetlookup {nick host hand text} {
global tgscoresbyname tgranksbyname tgscorestotal tgranksbynum tgrealnames
tggetscores
if {![info exists tgscoresbyname([strlwr $nick])]} {
[tgpriv] $nick "[tgbold]\00304Siz Skor Tablosunda Yoksunuz!"
} else {
set _myrank [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]
set _myscore [lindex [split $tgscoresbyname([strlwr $nick]) ,] 0]
set _tgtrank [expr [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]-1]
set _tgtnick [lindex [split $tgranksbynum($_tgtrank) ,] 0]
set _tgtscore [lindex [split $tgranksbynum($_tgtrank) ,] 1]
[tgpriv] $nick "[tgbold]\00306Şuandaki Bildiğiniz Soru Sayısı \00304$_myscore\00306. "
}
return 1
}
#triggered when someone /msgs the bot with the error reporting command.
proc tgerror {nick host hand text} {
global tgquestionstotal tgquestionslist tgerrfil
if {$text==""||![string is int [lindex $text 0]]} {
[tgpriv] $nick "[tgbold][tgcolmisc1]Soru Numarasını belirtmelisiniz...!"
return
}
tgreadqdb
set _qnum [lindex $text 0]
if {$_qnum>$tgquestionstotal} {
[tgpriv] $nick "[tgbold][tgcolmisc1]Böyle Bir Soru Bulunamadı."
return
}
set _qques [lindex [split [lindex $tgquestionslist [expr $_qnum-1]] |] 1]
set _qans [lindex [split [lindex $tgquestionslist [expr $_qnum-1]] |] 0]
set _desc [lrange $text 1 end]
if {$_desc==""} { set _desc "No further info given for this error." }
set _file [open $tgerrfil a]
puts $_file "Reported by:\t$nick"
puts $_file "Bezirgan #:\t$_qnum"
puts $_file "Bezirgan:\t$_qques"
puts $_file "Answer:\t\t$_qans"
puts $_file "Comments:\t$_desc"
puts $_file "--------------------------------------------------------------------------------"
close $_file
[tgpriv] $nick "[tgbold][tgcolmisc1]Hatayı Bildirdiğiniz İçin Teşekkür Ederiz."
return 1
}
#triggered when someone /msgs the bot with the rules command.
proc tgrulesmsg {nick host hand text} {
global tgrules
[tgpriv] $nick "Kanal Kuralları: $tgrules"
return 1
}
#triggered when someone /msgs the bot with the help command.
proc tggivehelp {nick host hand {text ""}} {
global botnick tgcmdlookup tgcmdhelp tgcmdstart tgcmdstop tgchan tgflagsstop
global tgcmdstop tgflagshint tgcmdhint tgflagsskip tgcmdskip tgflagsreset tgcmdreset
global tgcmdtarget tgcmderror tgcmdrules
if {$text==""} {
[tgpriv] $nick "Yardım Almak İçin Kullanacağınız Komut /msg commands:"
[tgpriv] $nick "Komutları command Yerine Yazınız, /msg $botnick <command>"
[tgpriv] $nick " \002[strupr $tgcmdrules]\002"
[tgpriv] $nick " -- Kanal Kurallarını Listelemek İçin"
[tgpriv] $nick " \002[strupr $tgcmdlookup]\002 \[nick\]"
[tgpriv] $nick " -- Oyundaki Skorunuzu Öğrenmek İçin \[nick\], "
[tgpriv] $nick " Sadece Kendi Skorunuzu Görüntüler."
[tgpriv] $nick " \002[strupr $tgcmdtarget]\002"
[tgpriv] $nick " -- Oyun botundaki Hedefinizi Gösterir"
[tgpriv] $nick " Kimin Sizin Önünüzde Olduğunu Yada Arkanızdakinin Kim Olduğunu Görmek İçin"
[tgpriv] $nick " \002[strupr $tgcmderror]\002 <number> \[description\]"
[tgpriv] $nick " -- Sorulardaki Hataları bizlere Bildirmenize Yarar <number>"
[tgpriv] $nick " JaneR@kaLp.biz"
if {[matchattr $hand $tgflagsreset $tgchan]} {
[tgpriv] $nick " \002[strupr $tgcmdreset]\002"
[tgpriv] $nick " -- Skor Tablosunu Resetlemek İçin."
}
[tgpriv] $nick "Kanal Komutlarını Listelemek İçin, /msg $botnick [strupr $tgcmdhelp] PUBCMDS"
}
if {[strlwr $text]=="pubcmds"} {
[tgpriv] $nick "You have access to the following channel commands:"
if {[matchattr $hand $tgflagsstart $tgchan]} {
[tgpriv] $nick " \002$tgcmdstart\002 -- Oyunu Baslatır."
}
if {[matchattr $hand $tgflagsstop $tgchan]} {
[tgpriv] $nick " \002$tgcmdstop\002 -- Oyunu Durdurur."
}
if {[matchattr $hand $tgflagshint $tgchan]} {
[tgpriv] $nick " \002$tgcmdhint\002 -- İpucu Verir."
}
if {[matchattr $hand $tgflagsskip $tgchan]} {
[tgpriv] $nick " \002$tgcmdskip\002 -- Soruyu Atlar."
}
[tgpriv] $nick "For a list of /msg commands, /msg $botnick [strupr $tgcmdhelp]"
}
return 1
}
#misc procs
proc tggamemsg {what} {
global tgchan
putquick "PRIVMSG $tgchan :[tgbold]$what"
}
#Returns ordinal version of number passed to it.
#i.e. [tgordnum 1] returns "1st", [tgordnum 33] returns "33rd"
#Surely there's an easier way to do this?
proc tgordnum {num} {
set _last1 [string range $num [expr [strlen $num]-1] end]
set _last2 [string range $num [expr [strlen $num]-2] end]
if {$_last1=="1"&&$_last2!="11"} {
return "[expr $num]st"
} elseif {$_last1=="2"&&$_last2!="09"} {
return "[expr $num]nd"
} elseif {$_last1=="3"&&$_last2!="13"} {
return "[expr $num]rd"
} else {
return "[expr $num]th"
}
}
proc tgbold {} {
global tgusebold
if {$tgusebold==1} {
return "\002"
}
}
proc tgcolstart {} {
global tgcolourstart
return "\003$tgcolourstart"
}
proc tgcolstop {} {
global tgcolourstop
return "\003$tgcolourstop"
}
proc tgcolskip {} {
global tgcolourskip
return "\003$tgcolourskip"
}
proc tgcolerr {} {
global tgcolourerr
return "\003$tgcolourerr"
}
proc tgcolmiss {} {
global tgcolourmiss
return "\003$tgcolourmiss"
}
proc tgcolqhead {} {
global tgcolourqhead
return "\003$tgcolourqhead"
}
proc tgcolqbody {} {
global tgcolourqbody
return "\003$tgcolourqbody"
}
proc tgcolhint {} {
global tgcolourhint
return "\003$tgcolourhint"
}
proc tgcolstrk {} {
global tgcolourstrk
return "\003$tgcolourstrk"
}
proc tgcolscr1 {} {
global tgcolourscr1
return "\003$tgcolourscr1"
}
proc tgcolscr2 {} {
global tgcolourscr2
return "\003$tgcolourscr2"
}
proc tgcolscr3 {} {
global tgcolourscr3
return "\003$tgcolourscr3"
}
proc tgcolrset {} {
global tgcolourrset
return "\003$tgcolourrset"
}
proc tgcolstend {} {
global tgcolourstend
return "\003$tgcolourstend"
}
proc tgcolmisc1 {} {
global tgcolourmisc1
return "\003$tgcolourmisc1"
}
proc tgcolmisc2 {} {
global tgcolourmisc2
return "\003$tgcolourmisc2"
}
proc tgpriv {} {
global tgpriv2msg
if {$tgpriv2msg==1} {
return "putmsg"
} else {
return "putnotc"
}
}
putlog "* [file tail [info script]] by uNsouL <email:uNsouL@uNsouL.net> loaded."
tgreadqdb
putlog "* $tgquestionstotal questions in $tgqdb"
#===================== LINE NEEDED FOR LOADCONF ====================#
#! /path/to/eggdrop
#======================= GENERAL BOT SETTINGS ======================#
set username "bots"
set admin "JaneR <caner@hotmail.gen.tr>"
set network "SERVERIP"
set timezone "EST"
set offset "5"
set my-hostname "SERVERIP"
set my-ip "SERVERIP"
#==================== GENERAL BOT LGING OPTIONS ==================#
set max-lsize 0
set quick-ls 0
set l-time 1
set keep-all-ls 0
set switch-lfiles-at 300
set quiet-save 0
set console "mkcobxs"
#================ GENERAL BOT FILE/LOCATION SETTINGS ===============#
set userfile "scripts/log/Oyun.user"
set sort-users 0
set help-path "help/"
set temp-path "/tmp"
set motd "motd"
set telnet-banner "telnet-banner"
#====================== GENERAL BOTNET OPTIONS =====================#
#set botnet-nick "JaneR"
set protect-telnet 0
set dcc-sanitycheck 0
set ident-timeout 5
set require-p 0
set open-telnets 0
set stealth-telnets 0
set use-telnet-banner 0
set connect-timeout 15
set dcc-flood-thr 3
set telnet-flood 5:60
set paranoid-telnet-flood 1
set resolve-timeout 15
#===================== ADVANCED SETTINGS FOR BOT ===================#
#set firewall "proxy:178"
#set nat-ip "127.0.0.1"
#set reserved-port 9076
set ignore-time 0
set hourly-updates 00
set owner "JaneR"
set notify-newusers "$owner"
set default-flags "hp"
set whois-fields "url birthday"
set remote-boots 2
set share-unlinks 1
set die-on-sighup 0
set die-on-sigterm 0
unbind dcc n tcl *dcc:tcl
unbind dcc n set *dcc:set
set must-be-owner 0
unbind dcc n simul *dcc:simul
set max-dcc 50
set dcc-portrange 1024:65535
set enable-simul 1
set allow-dk-cmds 1
#==================== GENERAL BOT MODULE SETTINGS ==================#
set mod-path "modules/"
#==================== GENERAL BOT CHANNEL MODULES ==================#
loadmodule channels
set chanfile "scripts/log/Oyun.chan"
set ban-time 0
set exempt-time 60
set invite-time 60
# set force-expire 0
set share-greet 0
set use-info 1
set global-flood-chan 5:3
set global-flood-deop 5:10
set global-flood-kick 0:0
set global-flood-join 8:30
set global-flood-ctcp 8:30
set global-chanset {
+clearbans +enforcebans
+dynamicbans +userbans
+autoop -bitch
+greet +nodesynch
+statusl -stopnethack
-revenge -secret
-autovoice +cycle
+dontkickops -wasoptest
-inactive +protectfriends
+shared -seen
+userexempts +dynamicexempts
+userinvites +dynamicinvites
}
channel add #oyun {
need-op { putserv "MODE #oyun +o $botnick " }
chanmode "+nt-m"
idle-kick 0
}
set global-chanmode ""
#==================== GENERAL BOT SERVER MODULES ===================#
loadmodule server
set net-type 0
set nick "Oyun"
set realname "Eggdrop Bot"
set init-server { putserv "PRIVMSG nickserv :identify sifre"
}
set servers {
SERVERIP:6667
}
set keep-nick 1
set use-ison 1
set strict-host 0
set quiet-reject 1
set lowercase-ctcp 0
set answer-ctcp 3
set flood-msg 0:0
# how many CTCPs in how many seconds?
set flood-ctcp 0:0
set never-give-up 1
set strict-servernames 0
set default-port 6667
set server-cycle-wait 30
set server-timeout 15
set servlimit 0
set check-stoned 1
set use-console-r 0
set debug-output 0
set serverror-quit 1
set max-queue-msg 300
set trigger-on-ignore 0
set double-mode 0
set double-server 0
set double-help 0
#set use-silence 1
#set check-mode-r 1
loadmodule ctcp
set ctcp-mode 0
loadmodule irc
set bounce-bans 1
set bounce-modes 0
set kick-bus-bans 1
set bounce-bus-bans 1
set max-bans 20
set max-modes 30
set allow-desync 0
set kick-bus 0
set ban-bus 0
set kick-fun 0
set ban-fun 0
set learn-users 0
set wait-split 600
set wait-info 180
set mode-buf-length 200
#unbind msg - hello *msg:hello
#bind msg - myword *msg:hello
unbind msg - ident *msg:ident
unbind msg - addhost *msg:addhost
#bind msg - myidentword *msg:ident
set no-chanrec-info 0
set revenge-mode 1
set bounce-exempts 0
set bounce-invites 0
set max-exempts 20
set max-invites 20
set bounce-bus-exempts 0
set kick-bus-exempts 0
set bounce-bus-invites 0
set kick-bus-invites 0
# set use-exempts 0
# set use-invites 0
set prevent-mixing 1
#set kick-method 1
#set modes-per-line 3
#set use-354 0
#set rfc-compliant 1
#loadmodule transfer
set max-dloads 3
set dcc-block 1024
set copy-to-tmp 1
set xfer-timeout 30
#==================== GENERAL BOT SHARE MODULES ====================#
#loadmodule share
#set allow-resync 0
#set resync-time 900
#set private-owner 0
#set private-global 0
#set private-globals "mnot"
#set private-user 0
#================== GENERAL BOT FILESYSTEM MODULES =================#
#loadmodule filesys
set files-path "/home/TELNETLOGİNismi/filesys"
set incoming-path "/home/TELNETLOGİNismi/filesys/incoming"
set upload-to-pwd 0
set filedb-path ""
set max-file-users 20
set max-filesize 1024
#===================== GENERAL BOT NOTES MODULES ===================#
loadmodule notes
set notefile "scripts/log/Oyun.notes"
set max-notes 50
set note-life 60
set allow-fwd 0
set notify-users 1
set notify-onjoin 1
#==================== GENERAL BOT CONSOLE MODULES ==================#
loadmodule console
set console-autosave 1
set force-channel 0
set info-party 0
#==================== GENERAL BOT WOOBIE MODULES ===================#
#loadmodule woobie
#===================== GENERAL BOT SEEN MODULES ====================#
#loadmodule seen
#==================== GENERAL BOT BLOWFISH MODULES =================#
checkmodule blowfish
#===================== GENERAL BOT ASSOC MODULES ===================#
#loadmodule assoc
#===================== GENERAL BOT WRITE MODULES ===================#
#loadmodule wire
#======================== GENERAL BOT SCRIPTS ======================#
source scripts/alltools.tcl
source scripts/action.fix.tcl
source scripts/userinfo.tcl
source scripts/oyun.tcl
#===================== GENERAL BOT HELP MODULES ====================#
loadhelp scripts/userinfo.help
oyun.tcl dosyası
################################################## ####################
#PLEASE customise the settings before rehashing your bot! #
################################################## ####################
# The full path to the file containing the questions and answers.
# The account the bot runs on must have read access to this file.
set tgqdb "/home/TELNETLOGİNismi/eggdrop/scripts/trivia.questions"
# The full path to the file which tracks the scores. The account
# the bot runs on must have read & write access to this file. If
# the file does not exist, it will be created when needed.
set tgscf "/home/TELNETLOGİNismi/eggdrop/scripts/trivia.skor"
# The full path to the file which records error reports. The
# account the bot runs on must have read & write access to this
# file. If the file does not exist, it will be created when needed.
set tgerrfil "/home/TELNETLOGİNismi/eggdrop/scripts/trivia.errors"
# The name of the channel where the game will be played. The game
# can only be played on one channel.
set tgchan "#oyun"
# How many points to give a person for a correctly answered
# question.
set tgpointsperanswer 1
# The maximum number of hints to give before the question 'expires'
# and the bot goes on to another one. This EXCLUDES the first hint
# given as the question is asked (i.e. the hint which shows no letters,
# only placeholders).
set tgmaxhint 4
# The minimum number of correct answers in a row by one person which
# puts them on a winning streak. Setting this to 0 will disable the
# winning streak feature.
set tgstreakmin 3
# The number of missed (i.e. unanswered, not skipped) questions to allow
# before automatically stopping the game. Setting this to 0 will cause the
# game to run until somebody uses the stop command, or the bot dies, gets
# killed, pings out, or whatever.
set tgmaxmissed 50
# The character to use as a placeholder in hints.
set tghintchar "*"
# The time in seconds between hints.
set tgtimehint 20
# The time in seconds between a correct answer, 'expired' or skipped question
# and the next question being asked.
set tgtimenext 10
# Phrases to use at random when someone answers a question correctly. This must
# be a TCL list. If you don't know what that means, stick to the defaults.
set tgcongrats [list "Bravo" "Başarılar" "İyi gidiyorsun" "Helal sana" "Harikasın sen ya... Soruyu bilen " "başarılar sana " "Göster onlara kim olduğunu " "Zihin gücünüzü iyi kullanın."]
# Phrases to use when the question has 'expired'. Must also be a TCL list.
set tgnobodygotit [list "Soru cevaplayacak kişiler aranıyor... ;)" "Merhaba? Kimse var mı?" "Çok mu zor bu sorular... hadiiii yaparsınız siz ;)" "Yine kaçırdınız... ;)" "Yalnız kaldım sanırım ?" "Top10 listesi çok iyi! Hadi devam... "]
# Phrases to use when the question expired and there's another one coming up.
# Yep, you guessed it... another TCL list.
set tgtrythenextone [list "Hadi görelim sizi..." "Sonraki soru için hazır olun..." "Birinci olabilme ihtimali her zaman vardir... ;)" "Deneyin ve birinci olun..." "Gaming...!"]
# Will the bot show the correct answer if nobody gets it (1) or not (0)?
set tgshowanswer 1
# Use bold codes in messages (1) or not (0)?
set tgusebold 0
# Send private messages using /msg (1) or not (0)?
# If set to 0, private messages will be sent using /notice
set tgpriv2msg 1
# Word to use as /msg command to give help.
# e.g. set tgcmdhelp "helpme" will make the bot give help when someone
# does "/msg <botnick> helpme"
set tgcmdhelp "?"
# Channel command used to start the game.
set tgcmdstart "!basla"
# Flags required to be able to use the start command.
set tgflagsstart -|-
# Channel command used to stop the game.
set tgcmdstop "!asdqdqxcqxqxqxqqxqxqjaner"
# Flags required to be able to use the stop command.
set tgflagsstop -|-
# Channel command used to give a hint.
set tgcmdhint "!ipucu"
# Flags required to be able to use the hint command.
set tgflagshint -|-
# Channel command used to skip the question.
set tgcmdskip "!xcqcxqcqshasdasdhasdhasjaner"
# Flags required to be able to use the skip command.
set tgflagsskip -|-
# Channel command for showing the top 10 scores.
set tgcmdtop10 "!top10"
set tgflagstop10 "-|-"
# /msg command used to reset scores.
set tgcmdreset "!ahsdhayqyqyqxhhxqaxzxajaner"
# Flags required to be able to use the reset command.
set tgflagsreset o|o
# /msg command for looking up somebody's score.
set tgcmdlookup "!skor"
# /msg command for looking up your target.
# (i.e. the person ranked one higher than you).
set tgcmdtarget "!hedef"
# /msg command for reporting errors in questions and/or answers.
set tgcmderror "!hata"
# /msg command to show channel's rules.
set tgcmdrules "!kural"
# Channel's rules.
set tgrules "Coder JaneR!"
# Number of minutes between reminders of how to report errors.
set tgerrremindtime 5
# COLOURS
# The colour codes used are the same as those used by mIRC:
# 00:white 01:black 02:dark blue 07:dark green
# 04:red 05:brown 09:purple 07:orange
# 07:yellow 09,1:light green 10:turquoise 11:cyan
# 09,1:light blue 13:magenta 14:dark grey 15:light grey
#
# Always specify colour codes as two digits, i.e. use "01" for
# black, not "1".
# You can specify a background colour using "00,04" (white text
# on red background).
# To disable a colour, use "".
set tgcolourstart "05" ;#Game has started.
set tgcolourstop "04" ;#Game has stopped.
set tgcolourskip "12" ;#Bezirgan has been skipped.
set tgcolourerr "04" ;#How to report errors.
set tgcolourmiss "10" ;#Nobody answered the question.
set tgcolourqhead "04" ;#Bezirgan heading.
set tgcolourqbody "12" ;#Bezirgan itself.
set tgcolourhint "3" ;#ipucu.
set tgcolourstrk "12" ;#Person is on a winning streak.
set tgcolourscr1 "04" ;#Score of person in first place.
set tgcolourscr2 "12" ;#Score of person in second place.
set tgcolourscr3 "03" ;#Score of person in third place.
set tgcolourrset "04" ;#Scores have been reset.
set tgcolourstend "12" ;#Winning streak ended.
set tgcolourmisc1 "06" ;#Miscellaneous colour #1.
set tgcolourmisc2 "04" ;#Miscellaneous colour #2.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# Any editing done beyond this point is done at your own risk! #
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#Misc checks & var initialisations
if {![file exists $tgqdb]} {
putlog "\002[file tail [info script]]\002 failed to load: $tgqdb does not exist."
return
}
if {![info exists alltools_loaded]||$allt_version<204} {
putlog "\002[file tail [info script]]\002 failed to load: please load alltools.tcl v1.6 or higher before attempting to use this script."
return
}
if {[llength [split $tgchan]]!=1} {
putlog "\002[file tail [info script]]\002 failed to load: too many channels specified."
return
}
if {![info exists tgplaying]} {set tgplaying 0}
if {![info exists tghintnum]} {set tghintnum 0}
if {![info exists tgmissed]} {set tgmissed 0}
#Binds
bind pub $tgflagsstart $tgcmdstart tgstart
bind pub $tgflagsstop $tgcmdstop tgstop
bind pub $tgflagshint $tgcmdhint tgforcehint
bind pub $tgflagsskip $tgcmdskip tgskip
bind pub $tgflagstop10 $tgcmdtop10 tgshowtop10
# bind join -|- "$tgchan *" tgjoinmsg
bind msg - $tgcmdhelp tggivehelp
bind msg - $tgcmdlookup tgscorelookup
bind msg - $tgcmdtarget tgtargetlookup
bind msg - $tgcmderror tgerror
bind msg - $tgcmdrules tgrulesmsg
bind msg $tgflagsreset "$tgcmdreset" tgresetscores
bind kick - "$tgchan $botnick" tgbotgotkicked
bind evnt - disconnect-server tgbotgotdisconnected
proc tgshowtop10 {nick host hand chan text} {
global tgscores tgchan tgscorestotal
if {[strlwr $chan]==[strlwr $tgchan]} {
tggetscores
if {$tgscorestotal>0} {
if {$tgscorestotal>9} {
set _max 9
} else {
set _max [expr $tgscorestotal-1]
}
set i 0
while {$i<=$_max} {
set _item [lindex $tgscores $i]
set _nick [join [lindex [split $_item ,] 2]]
set _score [join [lindex [split $_item ,] 0]]
if {$i==0} {
append _scores "[tgcolscr1]$_nick $_score"
} elseif {$i==1} {
append _scores ", [tgcolscr2]$_nick $_score"
} elseif {$i==2} {
append _scores ", [tgcolscr3]$_nick $_score"
} else {
append _scores ", [tgcolmisc1]$_nick $_score"
}
incr i
}
tggamemsg "[tgcolmisc1]Top 10 Listesi: $_scores"
} else {
tggamemsg "[tgcolmisc1]Skor Tablosu Boş."
}
}
}
#starts the game if it isn't running.
proc tgstart {nick host hand chan text} {
global tgplaying tgstreak tgchan tgerrremindtime tgerrremindtimer tgmissed
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==0} {
tggamemsg "[tgcolstart]Oyunu Baslatan $nick!"
tgnext
set tgplaying 1
set tgstreak 0
set tgmissed 0
set tgerrremindtimer [timer $tgerrremindtime tgerrremind]
}
return 1
}
}
#stops the game if it's running.
proc tgstop {nick host hand chan text} {
global tghinttimer tgnexttimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin
global tgerrremindtimer
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1} {
tggamemsg "[tgcolstop]Oyunu Durduran $nick!"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
set tgplaying 0
catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}
if {[utimerexists tghint]!=""} {killutimer $tghinttimer}
if {[utimerexists tgnext]!=""} {killutimer $tgnexttimer}
if {[timerexists tgerrremind]!=""} {killtimer $tgerrremindtimer}
}
return 1
}
}
#gives a hint if there is currently a question to answer.
proc tgforcehint {nick host hand chan text} {
global tghinttimer tgnexttimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin
global tgtempnohint tghintmax tghintnum
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1&&[utimerexists tghint]!=""} {
killutimer $tghinttimer
tghint
}
return 1
}
}
#skips the current question if one has been asked.
proc tgskip {nick host hand chan text} {
global tghinttimer tgnexttimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin tgtimenext
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1&&[utimerexists tghint]!=""} {
tggamemsg "[tgcolskip]Soru $nick Tarafından Direkt Olarak Geçildi!"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer
killutimer $tghinttimer
set tgnexttimer [utimer $tgtimenext tgnext]
}
return 1
}
}
#reminds channel how to report errors in questions/answers
proc tgerrremind {} {
global tgerrremindtimer tgerrremindtime botnick tgcmderror
# tggamemsg "[tgcolerr]Unutmayin!: Hatalı gordugunuz sorulari bize bildirmek icin lutfen /msg $botnick $tgcmderror <soru numarasi> \[hata sebebi\] yazınız..."
set tgerrremindtimer [timer $tgerrremindtime tgerrremind]
}
#bot got kicked. stop the game.
proc tgbotgotkicked {nick host hand chan targ text} {
tgquietstop
}
#bot got disconnected. stop the game.
proc tgbotgotdisconnected {disconnect-server} {
tgquietstop
}
#stops the game without telling the channel.
proc tgquietstop {} {
global tgplaying tgstreak tgchan tgcurrentanswer tghinttimer tgnexttimer tgerrremindtimer
if {$tgplaying==1} {
set tgstreak 0
set tgplaying 0
catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}
if {[utimerexists tghint]!=""} {killutimer $tghinttimer}
if {[utimerexists tgnext]!=""} {killutimer $tgnexttimer}
if {[timerexists tgerrremind]!=""} {killtimer $tgerrremindtimer}
}
}
#reads the question database.
proc tgreadqdb {} {
global tgqdb tgquestionstotal tgquestionslist
set tgquestionstotal 0
set tgquestionslist ""
set qfile [open $tgqdb r]
while {![eof $qfile]} {
lappend tgquestionslist [gets $qfile]
incr tgquestionstotal
}
close $qfile
}
#selects the next question.
proc tgnext {} {
global tgqdb tgcurrentquestion tgcurrentanswer tgquestionnumber tgquestionstotal
global tghintnum tgchan tgquestionslist
tgreadqdb
set tgquestionnumber [rand [llength $tgquestionslist]]
set tgquestionselected [lindex $tgquestionslist $tgquestionnumber]
set tgcurrentquestion [lindex [split $tgquestionselected |] 1]
set tgcurrentanswer [strlwr [lindex [split $tgquestionselected |] 0]]
unset tghintnum
tghint
bind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer
return
}
#shows timed hints.
proc tghint {} {
global tgmaxhint tghintnum tgcurrentanswer tghinttimer tgchan
global tgtimehint tghintchar tgquestionnumber tgquestionstotal
global tgcurrentquestion tghintcharsused tgnexttimer tgtimenext tgstreak tgstreakmin
global tgnobodygotit tgtrythenextone tgmissed tgmaxmissed tgcmdstart tgshowanswer
global tgtimestart
if {[catch {incr tghintnum}]!=0} {set tghintnum 0}
if {$tghintnum >= [expr $tgmaxhint+1]} {
incr tgmissed
set _msg ""
append _msg "[tgcolmiss][lindex $tgnobodygotit [rand [llength $tgnobodygotit]]]"
if {$tgshowanswer==1} {
append _msg " Dogru Cevap [tgcolmisc2][strupr $tgcurrentanswer][tgcolmiss]."
}
if {$tgmaxmissed>0&&$tgmissed>=$tgmaxmissed} {
append _msg " Bu $tgmissed . Cevaplanmayan Soru! Oyun Otomatikman Durdurulmuştur! Oyunu Tekrar Başlatmak İçin Lütfen $tgcmdstart Yazınız!"
tgquietstop
} else {
append _msg " [lindex $tgtrythenextone [rand [llength $tgtrythenextone]]]"
}
tggamemsg "[tgcolmiss]$_msg"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
catch {unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer}
if {$tgmaxmissed==0||$tgmissed<$tgmaxmissed} {
set tgnexttimer [utimer $tgtimenext tgnext]
}
return
} elseif {$tghintnum == 0} {
set i 0
set _hint {}
set tghintcharsused {}
regsub -all -- "\[A-Za-z0-9\]" $tgcurrentanswer $tghintchar _hint
set tgtimestart [clock clicks -milliseconds]
} elseif {$tghintnum == 1} {
set i 0
set _hint {}
while {$i<[llength [split $tgcurrentanswer]]} {
set _word [lindex [split $tgcurrentanswer] $i]
set j 0
set _newword {}
while {$j<[strlen $_word]} {
if {$j==0} {
append _newword [stridx $_word $j]
lappend tghintcharsused $i,$j
} else {
if {[string is alnum [stridx $_word $j]]} {
append _newword $tghintchar
} else {
append _newword [stridx $_word $j]
lappend tghintcharsused $i,$j
}
}
incr j
}
lappend _hint $_newword
incr i
}
} else {
set i 0
set _hint {}
while {$i<[llength [split $tgcurrentanswer]]} {
set _word [lindex [split $tgcurrentanswer] $i]
set j 0
set _newword {}
set _selected [rand [strlen $_word]]
regsub -all -- "\[^A-Za-z0-9\]" $_word "" _wordalnum
if {[strlen $_wordalnum]>=$tghintnum} {
while {[lsearch $tghintcharsused $i,$_selected]!=-1||[string is alnum [stridx $_word $_selected]]==0} {
set _selected [rand [strlen $_word]]
}
}
lappend tghintcharsused $i,$_selected
while {$j<[strlen $_word]} {
if {[lsearch $tghintcharsused $i,$j]!=-1||[string is alnum [stridx $_word $j]]==0} {
append _newword [stridx $_word $j]
} else {
if {[string is alnum [stridx $_word $j]]} {
append _newword $tghintchar
}
}
incr j
}
lappend _hint $_newword
incr i
}
}
tggamemsg "[tgcolqhead]===== Soru [expr $tghintnum?"(ipucu $tghintnum/$tgmaxhint)":""] ====="
tggamemsg "[tgcolqbody]$tgcurrentquestion"
tggamemsg "[tgcolhint]ipucu: $_hint"
set tghinttimer [utimer $tgtimehint tghint]
}
#triggered when someone says the correct answer.
proc tgcorrectanswer {nick host hand chan text} {
global tgcurrentanswer tghinttimer tgtimenext tgchan tgnexttimer tgstreak tgstreakmin
global tgscoresbyname tgranksbyname tgranksbynum tgcongrats tgscorestotal tgmissed
global tgtimestart
tggetscores
if {![info exists tgranksbyname([strlwr $nick])]} {
set _oldrank 0
} else {
set _oldrank [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]
}
tgincrscore $nick
tggetscores
set _newrank [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]
set _timetoanswer [expr [expr [clock clicks -milliseconds]-$tgtimestart]/1000.00]
set _msg "[tgcolmisc1][lindex $tgcongrats [rand [llength $tgcongrats]]] [tgcolmisc2]$nick[tgcolmisc1]! Dogru Cevap [tgcolmisc2][strupr $tgcurrentanswer][tgcolmisc1]. Toplam [tgcolmisc2]$_timetoanswer[tgcolmisc1] Saniyede Bildiniz."
if {$_newrank<$_oldrank} {
if {$_newrank==1} {
append _msg " Tebrikler "
} else {
append _msg ""
}
}
tggamemsg "$_msg"
if {$tgstreak!=0} {
if {[lindex [split $tgstreak ,] 0]==[strlwr $nick]} {
set tgstreak [strlwr $nick],[expr [lindex [split $tgstreak ,] 1]+1]
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} {
tggamemsg "[tgcolstrk]$nick Bravo Strike Yapıyorsunuz [lindex [split $tgstreak ,] 1] Soruyu Ard Arda Siz Bildiniz! Diğerleriyle Aranızda Fark Oluşmaya Başladı!"
}
} else {
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak [strlwr $nick],1
}
} else {
set tgstreak [strlwr $nick],1
}
set tgmissed 0
tgshowscores
unbind pubm -|- "$tgchan $tgcurrentanswer" tgcorrectanswer
killutimer $tghinttimer
set tgnexttimer [utimer $tgtimenext tgnext]
return 1
}
#read current scores from file, sort and store in variable.
proc tggetscores {} {
global tgscf tgscorestotal tgscores tgscoresbyname tgranksbyname tgranksbynum tgrealnames
if {[file exists $tgscf]&&[file size $tgscf]>2} {
set _sfile [open $tgscf r]
set tgscores [lsort -dict -decreasing [split [gets $_sfile]]]
close $_sfile
set tgscorestotal [llength $tgscores]
} else {
set tgscores ""
set tgscorestotal 0
}
if {[info exists tgscoresbyname]} {unset tgscoresbyname}
if {[info exists tgranksbyname]} {unset tgranksbyname}
if {[info exists tgrealnames]} {unset tgrealnames}
if {[info exists tgranksbynum]} {unset tgranksbynum}
set i 0
while {$i<[llength $tgscores]} {
set _item [lindex $tgscores $i]
set _nick [lindex [split $_item ,] 2]
set _lwrnick [lindex [split $_item ,] 3]
set _score [lindex [split $_item ,] 0]
set tgscoresbyname($_lwrnick) $_score
set tgrealnames($_lwrnick) $_nick
set tgranksbyname($_lwrnick) [expr $i+1],$_score
set tgranksbynum([expr $i+1]) $_lwrnick,$_score
incr i
}
return
}
#increment someone's score.
proc tgincrscore {who} {
global tgscores tgscf tgpointsperanswer tgscorestotal tgscoresbyname
tggetscores
if {$tgscorestotal>0} {
set i 0
if {![info exists tgscoresbyname([strlwr $who])]} {
append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who] "
}
while {$i<[llength $tgscores]} {
set _item [lindex $tgscores $i]
set _nick [lindex [split $_item ,] 2]
set _time [lindex [split $_item ,] 1]
set _score [lindex [split $_item ,] 0]
if {[strlwr $who]==[strlwr $_nick]} {
append _newscores "[expr $_score+$tgpointsperanswer],[expr 1000000000000.0/[unixtime]],$who,[strlwr $who][expr [expr [llength $tgscores]-$i]==1?"":"\ "]"
} else {
append _newscores "$_score,$_time,$_nick,[strlwr $_nick][expr [expr [llength $tgscores]-$i]==1?"":"\ "]"
}
incr i
}
} else {
append _newscores "1,[expr 1000000000000.0/[unixtime]],$who,[strlwr $who]"
}
set _sfile [open $tgscf w]
puts $_sfile "$_newscores"
close $_sfile
return
}
#shows the current scores on channel.
proc tgshowscores {} {
global tgscores tgchan tgscorestotal
tggetscores
set i 0
while {$i<[llength $tgscores]} {
set _item [lindex $tgscores $i]
set _nick [lindex [split $_item ,] 2]
set _score [lindex [split $_item ,] 0]
if {$i==0} {
append _scores "[tgcolscr1]$_nick $_score"
} elseif {$i==1} {
append _scores ", [tgcolscr2]$_nick $_score"
} elseif {$i==2} {
append _scores ", [tgcolscr3]$_nick $_score"
} elseif {[onchan $_nick $tgchan]} {
append _scores ", [tgcolmisc1]$_nick $_score"
}
incr i
}
tggamemsg "[tgcolmisc1]Sonuclar Ve Puan: $_scores"
}
#reset current scores.
proc tgresetscores {nick host hand text} {
global tgscf tgscorestotal tgscores
if {[file exists $tgscf]&&[file size $tgscf]>2} {
set _sfile [open $tgscf w]
puts $_sfile ""
close $_sfile
set tgscores ""
set tgscorestotal 0
}
tggamemsg "[tgcolrset]===== Skor Tablosu $nick! Tarafından Resetlendi ====="
return 1
}
#triggered when a winning streak ends.
proc tgstreakend {} {
global tgstreak tgrealnames
tggamemsg "[tgcolstend]Bravo $tgrealnames([lindex [split $tgstreak ,] 0]) Çok Fazla Strike ye Sahipsiniz... Tebrikler!"
return
}
#triggered when someone joins trivia chan.
proc tgjoinmsg {nick host hand chan} {
global botnick tgplaying tgcmdhelp tgcmdstart tgflagsstart tgcmdstop tgflagsstop tgchan
if {$nick != $botnick} {
set _msg ""
append _msg "Welcome to $botnick's Trivia Channel. Trivia Oyunu Şuanda"
if {$tgplaying==1} {
append _msg " \002on\002."
} else {
append _msg " \002off\002."
}
if {[matchattr $hand $tgflagsstart $tgchan]&&$tgplaying==0} {
append _msg " Oyunu Başlatmak İçin, Lütfen \002$tgcmdstart\002 Yazınız"
}
append _msg " Yardıma İhtiyacınız Olursa \002/MSG $botnick [strupr
$tgcmdhelp]\002 Yazınız! :-) (JaneR@kaLp.biz)"
[tgpriv] $nick "$_msg"
}
}
#triggered when someone /msgs the bot with the score lookup command.
proc tgscorelookup {nick host hand text} {
global tgscoresbyname tgranksbyname tgscorestotal tgrealnames
if {$text==""} { set text $nick } else { set text [lindex [split $text] 0] }
tggetscores
if {![info exists tgscoresbyname([strlwr $text])]} {
if {[strlwr $text]==[strlwr $nick]} {
set _who "[tgcolmisc1]Siz"
} else {
set _who "[tgcolmisc2]$text [tgcolmisc1]is"
}
[tgpriv] $nick "[tgbold]$_who [tgcolmisc1]Skor Tablosunda Yoksunuz!"
} else {
if {[strlwr $text]==[strlwr $nick]} {
set _who "[tgcolmisc1]Siz"
} else {
set _who "[tgcolmisc2]$tgrealnames([strlwr $text]) [tgcolmisc1]is"
}
[tgpriv] $nick "[tgbold]$_who [tgcolmisc2]$tgscoresbyname([strlwr $text])[tgcolmisc1] Soru Bildiniz , Ranked [tgcolmisc2][tgordnum [lindex [split $tgranksbyname([strlwr $text]) ,] 0]] [tgcolmisc1]of [tgcolmisc2]$tgscorestotal[tgcolmisc1]."
}
return 1
}
#triggered when someone /msgs the bot with the target lookup command.
proc tgtargetlookup {nick host hand text} {
global tgscoresbyname tgranksbyname tgscorestotal tgranksbynum tgrealnames
tggetscores
if {![info exists tgscoresbyname([strlwr $nick])]} {
[tgpriv] $nick "[tgbold]\00304Siz Skor Tablosunda Yoksunuz!"
} else {
set _myrank [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]
set _myscore [lindex [split $tgscoresbyname([strlwr $nick]) ,] 0]
set _tgtrank [expr [lindex [split $tgranksbyname([strlwr $nick]) ,] 0]-1]
set _tgtnick [lindex [split $tgranksbynum($_tgtrank) ,] 0]
set _tgtscore [lindex [split $tgranksbynum($_tgtrank) ,] 1]
[tgpriv] $nick "[tgbold]\00306Şuandaki Bildiğiniz Soru Sayısı \00304$_myscore\00306. "
}
return 1
}
#triggered when someone /msgs the bot with the error reporting command.
proc tgerror {nick host hand text} {
global tgquestionstotal tgquestionslist tgerrfil
if {$text==""||![string is int [lindex $text 0]]} {
[tgpriv] $nick "[tgbold][tgcolmisc1]Soru Numarasını belirtmelisiniz...!"
return
}
tgreadqdb
set _qnum [lindex $text 0]
if {$_qnum>$tgquestionstotal} {
[tgpriv] $nick "[tgbold][tgcolmisc1]Böyle Bir Soru Bulunamadı."
return
}
set _qques [lindex [split [lindex $tgquestionslist [expr $_qnum-1]] |] 1]
set _qans [lindex [split [lindex $tgquestionslist [expr $_qnum-1]] |] 0]
set _desc [lrange $text 1 end]
if {$_desc==""} { set _desc "No further info given for this error." }
set _file [open $tgerrfil a]
puts $_file "Reported by:\t$nick"
puts $_file "Bezirgan #:\t$_qnum"
puts $_file "Bezirgan:\t$_qques"
puts $_file "Answer:\t\t$_qans"
puts $_file "Comments:\t$_desc"
puts $_file "--------------------------------------------------------------------------------"
close $_file
[tgpriv] $nick "[tgbold][tgcolmisc1]Hatayı Bildirdiğiniz İçin Teşekkür Ederiz."
return 1
}
#triggered when someone /msgs the bot with the rules command.
proc tgrulesmsg {nick host hand text} {
global tgrules
[tgpriv] $nick "Kanal Kuralları: $tgrules"
return 1
}
#triggered when someone /msgs the bot with the help command.
proc tggivehelp {nick host hand {text ""}} {
global botnick tgcmdlookup tgcmdhelp tgcmdstart tgcmdstop tgchan tgflagsstop
global tgcmdstop tgflagshint tgcmdhint tgflagsskip tgcmdskip tgflagsreset tgcmdreset
global tgcmdtarget tgcmderror tgcmdrules
if {$text==""} {
[tgpriv] $nick "Yardım Almak İçin Kullanacağınız Komut /msg commands:"
[tgpriv] $nick "Komutları command Yerine Yazınız, /msg $botnick <command>"
[tgpriv] $nick " \002[strupr $tgcmdrules]\002"
[tgpriv] $nick " -- Kanal Kurallarını Listelemek İçin"
[tgpriv] $nick " \002[strupr $tgcmdlookup]\002 \[nick\]"
[tgpriv] $nick " -- Oyundaki Skorunuzu Öğrenmek İçin \[nick\], "
[tgpriv] $nick " Sadece Kendi Skorunuzu Görüntüler."
[tgpriv] $nick " \002[strupr $tgcmdtarget]\002"
[tgpriv] $nick " -- Oyun botundaki Hedefinizi Gösterir"
[tgpriv] $nick " Kimin Sizin Önünüzde Olduğunu Yada Arkanızdakinin Kim Olduğunu Görmek İçin"
[tgpriv] $nick " \002[strupr $tgcmderror]\002 <number> \[description\]"
[tgpriv] $nick " -- Sorulardaki Hataları bizlere Bildirmenize Yarar <number>"
[tgpriv] $nick " JaneR@kaLp.biz"
if {[matchattr $hand $tgflagsreset $tgchan]} {
[tgpriv] $nick " \002[strupr $tgcmdreset]\002"
[tgpriv] $nick " -- Skor Tablosunu Resetlemek İçin."
}
[tgpriv] $nick "Kanal Komutlarını Listelemek İçin, /msg $botnick [strupr $tgcmdhelp] PUBCMDS"
}
if {[strlwr $text]=="pubcmds"} {
[tgpriv] $nick "You have access to the following channel commands:"
if {[matchattr $hand $tgflagsstart $tgchan]} {
[tgpriv] $nick " \002$tgcmdstart\002 -- Oyunu Baslatır."
}
if {[matchattr $hand $tgflagsstop $tgchan]} {
[tgpriv] $nick " \002$tgcmdstop\002 -- Oyunu Durdurur."
}
if {[matchattr $hand $tgflagshint $tgchan]} {
[tgpriv] $nick " \002$tgcmdhint\002 -- İpucu Verir."
}
if {[matchattr $hand $tgflagsskip $tgchan]} {
[tgpriv] $nick " \002$tgcmdskip\002 -- Soruyu Atlar."
}
[tgpriv] $nick "For a list of /msg commands, /msg $botnick [strupr $tgcmdhelp]"
}
return 1
}
#misc procs
proc tggamemsg {what} {
global tgchan
putquick "PRIVMSG $tgchan :[tgbold]$what"
}
#Returns ordinal version of number passed to it.
#i.e. [tgordnum 1] returns "1st", [tgordnum 33] returns "33rd"
#Surely there's an easier way to do this?
proc tgordnum {num} {
set _last1 [string range $num [expr [strlen $num]-1] end]
set _last2 [string range $num [expr [strlen $num]-2] end]
if {$_last1=="1"&&$_last2!="11"} {
return "[expr $num]st"
} elseif {$_last1=="2"&&$_last2!="09"} {
return "[expr $num]nd"
} elseif {$_last1=="3"&&$_last2!="13"} {
return "[expr $num]rd"
} else {
return "[expr $num]th"
}
}
proc tgbold {} {
global tgusebold
if {$tgusebold==1} {
return "\002"
}
}
proc tgcolstart {} {
global tgcolourstart
return "\003$tgcolourstart"
}
proc tgcolstop {} {
global tgcolourstop
return "\003$tgcolourstop"
}
proc tgcolskip {} {
global tgcolourskip
return "\003$tgcolourskip"
}
proc tgcolerr {} {
global tgcolourerr
return "\003$tgcolourerr"
}
proc tgcolmiss {} {
global tgcolourmiss
return "\003$tgcolourmiss"
}
proc tgcolqhead {} {
global tgcolourqhead
return "\003$tgcolourqhead"
}
proc tgcolqbody {} {
global tgcolourqbody
return "\003$tgcolourqbody"
}
proc tgcolhint {} {
global tgcolourhint
return "\003$tgcolourhint"
}
proc tgcolstrk {} {
global tgcolourstrk
return "\003$tgcolourstrk"
}
proc tgcolscr1 {} {
global tgcolourscr1
return "\003$tgcolourscr1"
}
proc tgcolscr2 {} {
global tgcolourscr2
return "\003$tgcolourscr2"
}
proc tgcolscr3 {} {
global tgcolourscr3
return "\003$tgcolourscr3"
}
proc tgcolrset {} {
global tgcolourrset
return "\003$tgcolourrset"
}
proc tgcolstend {} {
global tgcolourstend
return "\003$tgcolourstend"
}
proc tgcolmisc1 {} {
global tgcolourmisc1
return "\003$tgcolourmisc1"
}
proc tgcolmisc2 {} {
global tgcolourmisc2
return "\003$tgcolourmisc2"
}
proc tgpriv {} {
global tgpriv2msg
if {$tgpriv2msg==1} {
return "putmsg"
} else {
return "putnotc"
}
}
putlog "* [file tail [info script]] by uNsouL <email:uNsouL@uNsouL.net> loaded."
tgreadqdb
putlog "* $tgquestionstotal questions in $tgqdb"