Jump to content
EGGTCL dot us

Pugsley

Administrators
  • Posts

    427
  • Joined

  • Last visited

  • Days Won

    21

Files posted by Pugsley

  1. Free

    statistics.tcl

    Commands:
     
    <bot> !stat|tstat <nick> <channel> - View statistics of the selected nick for all time|today in the specified channel.
    <bot> !place|tplace <nick> <parameter> <channel> - View the place of the chosen nick in channel for the specified parameter for all time|today.
    <bot> !top|ttop <number> <parameter> <channel> - View top users for all time|today in the chosen channel by the chosen parameter.
    <bot> !all <channel> - View the full statistics of your chosen channel for all time.
    <bot> * Available options: letter, line, smiles, words, joins, nick, action, kicks, topics, modes, time.
    <bot> ** Without specifying a channel or user, the statistics of the current channel or the user who used the command will be shown. If the parameter is absent, the quantity will be used as words.
    <bot> !sappend <nick1> <nick2> <channel>  - Combined statistics of nick1 and nick2 in channel. nick1 it will then be removed.
    <bot> !sset <nick> <parameter> <value> <channel>  - installing a new values for parameter on nick for channel.
    <bot> * As a parameter, use only lines, words, letters, smilies, joins, nicks, actions, kicks, topics, modes, time.
    <bot> !sraw <nick> <channel>  - viewing statistics for nick in channel in the "raw" format.

    0 downloads

       (0 reviews)

    0 comments

    Submitted

  2. Free

    reachdate.tcl

    Countdown Reach Date to date.

    1 download

       (0 reviews)

    0 comments

    Submitted

  3. Free

    christmas.tcl

    Christmas & New Year Countdown for 2hours autoshow in the channel.

    0 downloads

       (0 reviews)

    0 comments

    Submitted

  4. Free

    chanrelay.tcl

    # chanrelay.tcl 3.14
    #
    # A way to link your channels
    #
    # Author: CrazyCat <crazycat@c-p-f.org>
    # http://www.eggdrop.fr
    # irc.zeolia.net #eggdrop
    #
    # Declare issues at https://gitlab.com/tcl-scripts/chanrelay
    # No issue means no bug 🙂
    #
    ## DESCRIPTION ##
    #
    # This TCL is a complete relay script wich works with botnet.
    # All you have to do is to include this tcl in all the eggdrop who
    # are concerned by it.
    #
    # You can use it as a spy or a full duplex communication tool.
    #
    # It don't mind if the eggdrops are on the same server or not,
    # it just mind about the channels and the handle of each eggdrop.
    ## CHANGELOG ##
    #
    # 3.14 - The Pi edition 🙂
    # Now possible to change the (user@network) displayed
    #   just add the usermask correct value in settings
    #   %nick% and %network% are dynamic variables
    #   Think to escape chars as [] or {}
    #
    # 3.13
    # Modified join/part/quit procs
    # Add a limit to message length
    #
    # 3.12
    # Added colors for actions and non-message
    #
    #
    # 3.11
    # Made the "oper" setting functionnal
    # Removed MDS support
    #
    # 3.10
    # Added debug log. It can be enable and disable in configuration
    # and with /msg rc.debug <on|off>
    #
    # 3.9
    # Added exclusion list to ignore some users
    # Added a way to restrict relay to an internal user list
    #
    # 3.81
    # Action mades by server are no more using nick "*"
    # Added a protection on oper actions:
    #   the action must come from the oper bot
    # Correction of the quit transmission: when the bot leaves,
    #   it now detect and transmit
    # Added botnet status broadcast
    # Changed the unload system (thanks to MenzAgitat)
    #
    # 3.8
    # Correction : the config file can now use username for naming,
    #   allowing to have relaying eggdrops in the same place with
    #   different settings
    #
    # 3.7
    # Addition of @commandes (public) restricted to operators:
    #   @topic <network|all> a new topic :
    #       Changes topic on specified network (or all)
    #   @mode <network|all> +mode [arg][,-mode [arg]] :
    #       Changes modes on specified network (or all)
    #       All modes must be separated with a comma
    #   @kick <network|all> user [reason] :
    #       Kicks user on specified network (or all)
    #   @ban <network|all> user [reason]:
    #       Ban-kick user on specified network (or all)
    #   Default reason and banmask are in the conf section
    #
    # 3.6-3
    # Correction of trans mode on/off
    #
    # 3.6-2
    # Correction of the logging of actions (/me)
    #   Nick was replaced with ACTION
    # Correction of empty chan list (!who)

    # 3.6-1
    # Correction of the !who command
    # It's now possible to have the list from a specific server
    #
    # 3.6
    # Correction of modes catching / transmitting
    #
    # 3.5 (Beta)
    # Integration of Message Delivery Service (MDS)
    # by MenzAgitat
    #
    # 3.4
    # Settings modified by msg commands are now saved
    # Correction of small bugs
    # Best verification of settings sent
    # Acknowledgement and error messages added
    #
    # 3.3-1
    # Correction for /msg eggdrop trans <action> [on|off]
    #
    # 3.3
    # Added lines introducing beginning and ending of userlist
    #
    # 3.2
    # Added gray user highlight
    #
    # 3.1
    # Added check for linked bot
    # Corrected parse of some messages
    # Corrected pub commands
    #
    # 3.0
    # Complete modification of configuration
    # Use of namespace
    # No more broadcast, the relay is done with putbot
    ## TODO ##
    #
    # Enhance configuration
    # Allow save of configuration
    # Multi-languages
    ## CONFIGURATION ##
    #
    # For each eggdrop in the relay, you have to
    # indicate his botnet nick, the chan and the network.
    #
    # Syntax:
    # set regg(USERNAME) {
    #   "chan"      "#CHANNEL"
    #   "network"   "NETWORK"
    #}
    # with:
    # USERNAME : The username sets in eggdrop.conf (case-sensitive)
    # optionaly, you can override default values:
    # * highlight (0/1/2/3): is speaker highlighted ? (no/bold/undelined/gray)
    # * snet (y/n): is speaker'network shown ?
    # * transmit (y/n): does eggdrop transmit his channel activity ?
    # * receive (y/n): does eggdrop diffuse other channels activity ?
    # * oper (y/n): does the eggdrop accept @ commands (topic, kick, ban) ?
    # * syn_topic (y/n): if set to Yes, the eggdrop will
    #   synchronize the channel topic when changed on
    #   another chan of the relay
    #
    # userlist(beg) is the sentence announcing the start of !who
    # userlist(end) is the sentence announcing the end of !who

    1 download

       (0 reviews)

    0 comments

    Submitted

  5. Free

    trivia.tcl (working)

    PLEASE customise the settings before rehashing your bot! 

    1 download

       (0 reviews)

    0 comments

    Submitted

  6. Free

    trivia-working.tcl

    PLEASE customise the settings before rehashing your bot! 

    This is the enhanced version of original version Trivia.tcl made by Souperman.
    Enhanced with a !choose option for multiple question files.
    Reason for the adjustment was purely to have an *Nerd* version with all
    kinds of exams like MCSE MCSA CCISP or whatever those whizzkids want.

        
    Enhancements:
    The questionfiles can handle tabs for better editting and manipulation
    eg with a spreadsheet using tabs as a seperator.
    When the next question is selected, all tabs will be removed.

    The questionfiles can be setup to use multiplechoice questions.
    The script will determine if a question is a multiplechoice or not.
    If not, it will sendout the question on one line.
    If it is, it will sendout the question and choices on different lines.

    This is the layout for them:
    Answer|Question   $A:choice   $B:choice   $C:choice $D:choice   $E:choice
    It doenst matter how many choices there are, the script will figure it out.
    lowercase uppercase... it doesnt matter.
    Cheat protection for blocking people from just trying and guessing.
    This is especially handy with multiplechoice question with one answer.

    0 downloads

       (0 reviews)

    0 comments

    Submitted

  7. Free

    worms-en.tcl

    to enable the worms irc party script for your channel type '.chanset #channel +worms'
    the default command to fight with a player is '!fight <nickname>'
     
    # to enable the worms irc party script for your channel type '.chanset #channel +worms' # the default command to fight with a player is '!fight <nickname>' # {{{ worms irc party # {{{ configuration # {{{ variables set worms(trigger) "!" set worms(protection) "300" set worms(default,hp) "150" set worms(version) "1.0" set worms(author) "Unknown" # }}} # {{{ copyright putlog "\[worms-script\] version $worms(version) scripted by $worms(author)" # }}} # {{{ bindings bind PUB -|- "$worms(trigger)fight" game:worms:fight bind PUB -|- "$worms(trigger)weapons" game:worms:weapons:overview bind PUB -|- "$worms(trigger)yes" game:worms:accept bind PUB -|- "$worms(trigger)no" game:worms:reject bind PUBM -|- "*" game:worms:weapons  

    3 downloads

       (0 reviews)

    0 comments

    Updated

  8. Free

    bombsquad.tcl

    Bomb Squad Game Script
    ############################################################################### # Bomb Squad 1.0 by rojo (EFnet #wootoff) # # Copyright 2011 Steve Church (rojo on EFnet). All rights reserved. # # # # Description: # # timebomb script with one insta-kill wire, one disarm wire, one booby-trap # # wire that cuts your time remaining in half, and a random number of decoys. # # # # Please report bugs to rojo on EFnet. # # # # License # # # # Redistribution and use in source and binary forms, with or without # # modification, are permitted provided that the following conditions are met: # # # # 1. Redistributions of source code must retain the above copyright notice, # # this list of conditions and the following disclaimer. # # # # 2. Redistributions in binary form must reproduce the above copyright # # notice, this list of conditions and the following disclaimer in the # # documentation and/or other materials provided with the distribution. # # # # THIS SOFTWARE IS PROVIDED BY STEVE CHURCH "AS IS" AND ANY EXPRESS OR # # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN # # NO EVENT SHALL STEVE CHURCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # # DAMAGE. # ###############################################################################  

    1 download

       (0 reviews)

    0 comments

    Updated

  9. Free

    drpoker.tcl

    Poker Game Script
     
    # ------------------------------------------------------------------------ # Name: drpoker.tcl # Title: Doctor Po's Draw Poker # Date: Sat Aug 16 15:00 2003 # Author: Greg McNeil <gmcneil@yahoo.com> # Purpose: Deals a game of 5 Card Draw Poker to as many as five # players. Cards are dealt face up from a regular shuffled # deck (plus two wild cards). Players then discard and # draw cards. Game ends when bot shows final hands. # The game can operate independently on multiple channels. # Notes: Designed for Eggdrop 1.6, Tcl 8.4, and Undernet. # ------------------------------------------------------------------------ # Doctor Po's Draw Poker, a Tcl script for Eggdrop bots. The bot # deals hands of 5 card draw poker to players on IRC channels. # Copyright (C) 2003 Greg McNeil # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # If you did not receive a copy of the GNU General Public License # along with this program, obtain a copy by writing to the Free # Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ------------------------------------------------------------------------  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  10. Free

    holdem.tcl

    Holdem Game Script
     
    ############################################################################### # holdem.tcl version 1.0 # # Copyright 2011 Steve Church (rojo on EFnet). All rights reserved. # # # # Salt the settings below to taste, load the script, rehash, # # .chanset #channel +holdem, then !holdem to play. It's not rocket surgery. # # # # A note about Unicode / UTF-8: If your bot is compiled with UTF-8 support # # (see http://eggwiki.org/Utf-8 for details) and you set settings(unicode) 1, # # cards are displayed with their suits as extended characters. If players in # # your channel are not using a modern, updated IRC client; rather than seeing # # suits as intended, they may just see garbage. More information for mIRC # # UTF-8 support is available at http://www.mirc.net/newbie/unicode.php . If # # your users use Mibbit, they'll probably see Unicode characters just fine. # # Users using any other IRC client are probably intelligent enough to figure # # out how to handle UTF-8 on their own. # # # # Thanks to the unnaturally lucky Sunset, Trex, turgsh01, and the rest of the # # EFnet #arcade group for helping me squash bugs. If you find more bugs, # # please report them to rojo on EFnet. # # # # License # # # # Redistribution and use in source and binary forms, with or without # # modification, are permitted provided that the following conditions are met: # # # # 1. Redistributions of source code must retain the above copyright notice, # # this list of conditions and the following disclaimer. # # # # 2. Redistributions in binary form must reproduce the above copyright # # notice, this list of conditions and the following disclaimer in the # # documentation and/or other materials provided with the distribution. # # # # THIS SOFTWARE IS PROVIDED BY STEVE CHURCH "AS IS" AND ANY EXPRESS OR # # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN # # NO EVENT SHALL STEVE CHURCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH # # DAMAGE. # ###############################################################################  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  11. Free

    duel.tcl

    Duel IRC Game Script
     
    ############################################################################### # # Duel # v1.03 (22/10/2013) ©2013 MenzAgitat # # IRC: irc.epiknet.org #boulets / #eggdrop # # Mes scripts sont téléchargeables sur http://www.eggdrop.fr # ############################################################################### # # Description # # Ce script permet à un utilisateur d'en défier un autre en combat singulier. # # Une fois le duel lancé, le narrateur (l'Eggdrop) commence à décrire l'action # trépidante qui se déroule sous vos yeux ébahis. # Il existe 5 types d'action, différenciés par un symbole affiché en début de # ligne : # > attaque # < contre-attaque # ~ esquive # ~< esquive + contre-attaque # x attaque ratée # * réaction neutre # A chaque round, le hasard décide qui attaque qui. Lorsqu'une attaque est # lancée, il y a une chance pour qu'elle aboutisse, une chance pour qu'elle # rate, et une chance pour que la victime se défende de 3 façons possibles # (esquive, attaque, ou esquive + contre-attaque). # Des réactions neutres surviennent parfois en réponse à une attaque qui a # abouti; elles représentent les réactions des participants ou du public à ce # qui vient de se passer. # # Chaque attaque a un certain nombre de défenses et de réactions qui lui sont # associées spécifiquement afin d'avoir un contexte cohérent entre les actions # et les réactions, et des soins particuliers ont été apportés à la variété, # l'originalité et l'humour. # La base de données contient : # 121 attaques toutes plus vicieuses les unes que les autres # 60 attaques ratées, car ça arrive les emmerdes... # 105 esquives avec pied de nez # 85 contre-attaques histoire de mettre les points sur les i # 41 esquives + contre-attaque pour les plus habiles # 240 réactions neutres parce que les spectateurs veulent tout savoir # # Le calcul des points s'effectue comme suit : # - chaque attaque menée à bien rapporte 1pt à l'attaquant # - une esquive annule l'attaque # - une contre-attaque n'annule pas l'attaque mais rapporte 1pt au défenseur # - une esquive + contre-attaque annule l'attaque et rapporte 1pt au défenseur # # Voici la syntaxe à utiliser pour défier quelqu'un en duel : # !duel <nick> [nombre de rounds gagnants] # # La commande !duel_stats permet au propriétaire de l'Eggdrop de compter et # d'afficher le nombre d'actions de chaque catégorie dans la base de données. # # Pour activer Duel sur un chan, vous devez taper ceci en partyline de # l'Eggdrop : # .chanset #NomDuChan +duel # et ceci pour le désactiver : # .chanset #NomDuChan -duel # # Quelques détails chiants pour ceux qui veulent juste faire un duel au plus # vite, et bons à savoir pour les autres : # - Le script utilise une file d'attente temporisée indépendante pour # l'affichage des messages afin de ne pas engorger les files d'attente de # l'Eggdrop en y envoyant beaucoup de messages d'un coup. # - Chaque attaque / attaque ratée / défense / réaction ne sera pas répétée # tant que toutes les autres n'auront pas été vues, et l'ordre est différent # à chaque cycle. Notez qu'un rehash ou un restart de l'Eggdrop remet les # compteurs à 0. # # Veuillez maintenant vous reporter à la section configuration du script un peu # plus bas...... # ############################################################################### # # Changelog # # 1.0 # - 1ère version # 1.01 # - Correction : les codes de style (couleurs, gras, ...) n'étaient pas # interprétés correctement dans les actions. # - Correction : la commande !duel tapée sans arguments n'affichait pas la # syntaxe. # - Ajout : une nouvelle attaque a été ajoutée avec ses défenses et réactions # associées. # - Modification : certaines actions ont été reformulées. # 1.02 # - Correction : les guillemets étaient filtrés par erreur dans les actions. # - Correction : une faute d'orthographe a été corrigée dans une action. # 1.03 # - Correction : il n'est désormais plus possible de lancer plusieurs duels # simultanément sur le même chan. # ############################################################################### # # Licence # # Cette création est mise à disposition selon le Contrat # Attribution-NonCommercial-ShareAlike 3.0 Unported disponible en ligne # http://creativecommons.org/licenses/by-nc-sa/3.0/ ou par courrier postal à # Creative Commons, 171 Second Street, Suite 300, San Francisco, California # 94105, USA. # Vous pouvez également consulter la version française ici : # http://creativecommons.org/licenses/by-nc-sa/3.0/deed.fr # ###############################################################################  

    1 download

       (0 reviews)

    0 comments

    Updated

  12. Free

    CoinFlip-DiceRoll.tcl

    Coin flip commands
    # CoinFlip-DiceRoll.tcl Version 1.0 by SpiKe^^ (30 Dec 2012) # # author: SpiKe^^ # # e-mail: spike<at>mytclscripts<dot>com # # webpage: http://mytclscripts.com/ # # This file is Copyrighted under the GNU Public License. # # http://www.gnu.org/copyleft/gpl.html # ######### Coin flip commands ######### # !coin nick1 nick2 # example: !coin starr spike^^ # note: list any two nicks as the players # !coin nick # example: !coin starr # note: command user will be the second player # For help with the Coin flip command, use: !coin ######### Roll dice commands (with Default Dice) ######### # !roll nick1 nick2 nick3 # example: !roll starr bart spike^^ # note: list any two or more nicks as the players # note: can use +me or your nick to include yourself # example: !roll starr bart +me # !roll nick # example: !roll starr # note: command user will be the second player # !roll -all # example: !roll -all # this will roll the dice for every non-exempt nick in channel # note: max players for -all controlled by cFdR(maxnk) setting # note: list of players will always include the command user # !roll <number of players> # example: !roll 20 # this will roll the dice for 20 random non-exempt nicks # note: list of players will always include the command user # For help with the Roll dice command, use: !roll ######### Roll dice commands (with Custom Dice) ######### # note: All above Roll dice commands can be used with Custom Dice # note: maximum of 20 dice, minimum of 4 dice sides # !roll <number of dice>@<numbers on dice> <players> # example: !roll 2@1-6 starr bart spike^^ # note: roll 2 dice, with standard 6-sided dice, for listed nicks # example: !roll 4@1-10 starr # note: roll 4 dice, using 10-sided dice, for starr & command user # example: !roll 5@0-19 -all # note: roll five, 20-sided dice (numbered 0 to 19), for all nicks # example: !roll 2@1-50 45 # note: roll 2, 50-sided dice, for 45 random nicks (include cmd user) # For help with the Roll custom dice command, use: !custom  

    1 download

       (0 reviews)

    0 comments

    Updated

  13. Free

    cowsANDbulls.tcl

    This is the simple game script for eggdrop system use only. The game is emulation of cows
    and buls game whit extra-special gameplay (just like trivia ;)). 
     
    ######### cowsANDbulls.tcl ####################################### by game_over ############### # This is the simple game script for eggdrop system use only. The game is emulation of cows # # and buls game whit extra-special gameplay (just like trivia ;)). # # I STRONGLY RECOMMEND TO READ README.TXT AND FOLLOW STEPS THERE. # ######### Options ############################################################################  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  14. Free

    slapjack.tcl

    Slap Jack IRC Game Script
     
    ################################################################################################## ## ## ## Author: Justdabomb2 <email: edngravy@sbcglobal.net> ## ## Script: Slap Jack Script ## ## Version: v1.0 ## ## Date: 11/13/2006 ## ## Tested with: Eggdrop v1.6.18 ## ## ## ## Commands: !slapjack - Start a new game of slapjack. ## ## !joinsj - Join the current game of slapjack. ## ## !checkcards - Check the card count. ## ## !slap - Slap the current card. ## ## ## ## ## ## Installation: ## ## 1. Save in your script directory as "slapjack.tcl". ## ## 2. add line "source scripts/slapjack.tcl to the bottom of your eggdrop ## ## configuration file. ## ## 3. Rehash or restart your bot, and type "!slapjack" in the channel. ## ## ## ## ## ## You do NOT need to change anything in this script (besides what it tells you to change in ## ## the installation), it should work the way it is right now. ## ## ## ## Newer versions on this script will be if I decide something should be added or a bug ## ## needs to be fixed. ## ## ## ## If you notice any problems with the script, please e-mail them to me at ## ## edngravy@sbcglobal.net ## ## (although, I haven't played around with TCL scripting since 2006, so I don't remember too ## ## much about it, very sorry. I just though I should upload this since it was the last ## ## script I ever made.) ## ## ## ## ~Thank you! ## ## ## ##################################################################################################  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  15. Free

    roulette.tcl

    Roulette Game Script
     
    ###Custom made Russian Roulette Script #this is the first script I written myself so ther's probably couple of things I could have done different #and I'm open for suggestions. If you got any ideas for me please contact me at dopeydwerg@hotmail.com #list lucky comments set pull { "quickly pulls the trigger..." "shakes as he slowly raises the gun to pull the trigger...." "calmly smiles as he pulls the trigger...." "puts the gun in his mouth...." "places the gun between his eyes,and starts to prey..." "Slowly raises the gun and put it against his temple...." } set lucky_msg { "...klik......Oops..did i forget to load this gun" ".....klik....Your luck wont last long hahaha" ".klik........Next turn u got a date with a bullet hahaha" ".klik....... wtf you lucky punk" "......klik....Your lucky that bullet didnt work...gamebot reloaded a fresh bullet" "....klik.....Bet you wish you were this lucky at the lottery" "....klik......Spin or shoot I don't care, if you win I'll just shoot you myself" ".....klik.....So you think your good.....I dare you to play me next" "....klik......If i had a head like yours i'd been playing this game untill i lost" ".....klik......How can someone so ugly be so lucky" } #set vars set player1 "" set player2 "" set curplayer "" set notcurplayer "" set timeout_timer 0 set started 0 set turns 0 set bullit [rand 5] #file you want scores to be written set scorefile "roulette.txt" set kill_count 0 set last_warn "" #binds bind pub - .spin spin:gun bind pub - .shoot shoot:gun bind pub - .play challenge:player bind pub - .reply reply:player bind pub - .accept accept bind pub - .chicken chicken bind pub - .score show_player_score bind pub - .scores showall proc accept {nick host handle chan arg} { global rrstarttimer if {[utimerexists started]!=""} {killutimer $rrstarttimer} reply:player $nick $host $handle $chan "accept" } proc chicken {nick host handle chan arg} { reply:player $nick $host $handle $chan "chicken" } #proc to get somebody ro play with you proc challenge:player {nick host handle chan arg} { global botnick player1 player2 started timeout_timer kill_count last_warn notcurplayer global rrstarttimer rrchannel if {$player1 != ""} { puthelp "PRIVMSG $chan :Sorry $player1 allready challenged $player2" return 0 } if {![onchan $arg $chan]} { if {$nick == $last_warn} { puthelp "PRIVMSG $chan :now you're starting to annoy me so I have to shoot you." kill $nick $chan return 0 } puthelp "PRIVMSG $chan :Sorry but I can't find $arg in this channel.You shure you got the name right?" puthelp "PRIVMSG $chan :And if you do it again I'm gonna shoot you." set last_warn $nick return 0 } if {$arg == ""} { puthelp "PRIVMSG $chan :Type .challenge <nick> to start the game" return 0 } if {$started == 1} { puthelp "PRIVMSG $chan :Game allready running" return 0 } if {$arg == $botnick} { puthelp "PRIVMSG $chan :Challenge accepted" puthelp "PRIVMSG $chan :RRRRRRRRRrrrrrrrr....." kill $nick $chan return 0 } set player1 $nick set player2 $arg set rrchannel $chan set timeout_timer 1 utimer 20 [list timeout $chan ] set rrstarttimer [utimer 50 started] putquick "NOTICE $player2 :$nick challenges you to play Roulette with him." putquick "NOTICE $player1 :Challenge send to $player2" putquick "NOTICE $player2 :type .accept to play .chicken to chicken out" return 0 } proc reply:player {nick host handle chan arg} { global botnick player1 player2 turns started curplayer timeout_timer notcurplayer global rrstarttimer rrchan if {$player1 == ""} { puthelp "NOTICE $nick :Sorry nobody challenged you yet" puthelp "NOTICE $nick :To Chalenge Somebody type .play <nick>" return 0 } if {$nick != $player2} { puthelp "NOTICE $nick :That's not your call. $player2 was challenged by $player1" return 0 } if {$arg == ""} { puthelp "NOTICE $nick :Type .accept to play or .chicken to decline" return 0 } if {$started == 1} { puthelp "PRIVMSG $chan :Game allready running" return 0 } if {$arg == "chicken"} { puthelp "PRIVMSG $chan :$nick Chickened out. $player2 is a little pussycat." set player1 "" set player2 "" return 0 } if {$arg == "accept"} { set curplayer $player1 set notcurplayer $player2 set rrchan $chan putserv "notice $player1 :$nick accepted your challenge." putserv "notice $player1 :$curplayer goes first. .shoot shoots gun, .spin spins gun first" putserv "notice $player2 :$curplayer goes first. .shoot shoots gun, .spin spins gun first" incr_stats $curplayer "" "" "" "" "" incr_stats $notcurplayer "" "" "" "" "" set started 1 set timeout_timer 0 return 0 } } proc spin:gun {nick host handle chan arg} { global botnick player1 player2 turns started bullit curplayer if {$nick != $curplayer} { puthelp "PRIVMSG $chan :Hey no cheating it's not your turn." return 0 } if {$started == 0} { puthelp "PRIVMSG $chan :Game not running. Type .paly <nick> to play" return 0 } set bullit [rand 5] puthelp "PRIVMSG $chan :$curplayer spins gun.....RRRRRRRRRrrrrrrrrre..." incr_stats $curplayer "" "" "" "+ 1" "" shoot:gun $nick $host $handle $chan $started return 0 } proc shoot:gun {nick host handle chan arg} { global botnick player1 player2 turns curplayer started bullit lucky_msg pull notcurplayer playerstat if {$started == 0} { puthelp "PRIVMSG $chan :Game not running. Type .play <nick> To play" return 0 } if {$nick != $curplayer} { puthelp "PRIVMSG $chan :Hey no cheating it's not your turn." return 0 } set checknr1 [rand [llength $pull]] set temp_pull $pull set temp_pull [lindex $temp_pull $checknr1] puthelp "PRIVMSG $chan :$nick $temp_pull" incr_stats $curplayer "" "" "+ 1" "" "" #check if bullit is on position 0 if it is then your dead if {$bullit != 0} { #if not then set bullit - 1 like in a real fun set bullit [expr $bullit - 1] #increase turns taken for stats set turns [expr $turns + 1] #insert random msg set checknr [rand [llength $lucky_msg]] set temp_lol $lucky_msg set temp_lol [lindex $temp_lol $checknr] puthelp "PRIVMSG $chan :$temp_lol" #switch playsers so nobody can before there turn if {$curplayer == $player1} { set curplayer $player2 set notcurplayer $player1 } else { set curplayer $player1 set notcurplayer $player2 } puthelp "notice $curplayer :your turn Type .shoot or .spin" puthelp "notice $notcurplayer :$curplayer's Turn" return 0 #if bullit was on position 0 kick loser from chan and reset all used variables } else { incr_stats $curplayer "" "+ 1" "" "" "+ 1" incr_stats $notcurplayer "+ 1" "" "" "" "+ 1" show_score $notcurplayer putlog "$playerstat" puthelp "KICK $chan $curplayer :\002 \00304 BANG Your Dead!! Winner $playerstat" puthelp "PRIVMSG $chan :\002 \00312 Type .play <nick> to play, .scores for scorelist .score <nick> for score of nick" set player1 "" set player2 "" set curplayer "" set bullit [rand 5] set started 0 return 0 } } proc kill {nick chan} { global botnick set bullit [rand 5] for {set x 1} {$x < $bullit} {incr x} { puthelp "PRIVMSG $chan :klik..." } puthelp "PRIVMSG $chan :...BANG!!! You loose! " puthelp "KICK $chan $nick : Yep I'm still the king" return 0 } proc timeout { chan } { global botnick player1 player2 turns curplayer started bullit lucky_msg pull timeout_timer if {$timeout_timer == 1} { puthelp "PRIVMSG $chan : $player2 is probably to chicken to play" set player1 "" set player2 "" set curplayer "" set bullit [rand 5] set timeout_timer 0 set started 0 return 0 } } proc get_scores {} { global botnick scorefile rrscoresbyname rrscorestotal rrscores rrranksbyname rrranksbynum if {[file exists $scorefile]&&[file size $scorefile]>2} { set _sfile [open $scorefile r] set rrscores [lsort -dict -decreasing [split [gets $_sfile] " "]] close $_sfile set rrscorestotal [llength $rrscores] } else { set rrscores "" set rrscorestotal 0 } if {[info exists rrscoresbyname]} {unset rrscoresbyname} if {[info exists rrranksbyname]} {unset rrranksbyname} if {[info exists rrranksbynum]} {unset rrranksbynum} set i 0 while {$i<[llength $rrscores]} { set _item [lindex $rrscores $i] set _nick [lindex [split $_item ,] 5] set _win [lindex [split $_item ,] 0] set _lost [lindex [split $_item ,] 1] set _shots [lindex [split $_item ,] 2] set _spins [lindex [split $_item ,] 3] set _played [lindex [split $_item ,] 4] set rrscoresbyname($_nick) $_win set rrranksbyname($_nick) [expr $i+1],$_win set rrranksbynum([expr $i+1]) $_nick,$_win incr i } return } proc incr_stats {who win loss shots spins played} { global botnick scorefile rrscoresbyname rrscorestotal rrscores rrranksbyname rrranksbynum set who [lindex [split $who "|"] 0] set who [lindex [split $who "_"] 0] get_scores if {$rrscorestotal>0} { set i 0 if {[lsearch $rrscores "*,*,*,*,*,$who"]==-1} { append _newscores "0,0,0,0,0,$who " } while {$i<[expr [llength $rrscores] - 1]} { set _item [lindex $rrscores $i] set _nick [lindex [split $_item ,] 5] set _win [lindex [split $_item ,] 0] set _lost [lindex [split $_item ,] 1] set _shots [lindex [split $_item ,] 2] set _spins [lindex [split $_item ,] 3] set _played [lindex [split $_item ,] 4] if {[strlwr $who]==[strlwr $_nick]} { append _newscores "[expr $_win $win],[expr $_lost $loss],[expr $_shots $shots],[expr $_spins $spins],[expr $_played $played],$_nick " } else { append _newscores "$_win,$_lost,$_shots,$_spins,$_played,$_nick " } incr i } } else { append _newscores "0,0,0,0,0,$who " } set _sfile [open $scorefile w] puts $_sfile "$_newscores" close $_sfile return 0 } proc show_score {text} { global rrscoresbyname rrscores playerstat get_scores set idx [lsearch -glob $rrscores "*,*,*,*,*,$text"] putlog "[lindex $rrscores $idx]" set _item [lindex $rrscores $idx] set _nick [lindex [split $_item ,] 5] set _win [lindex [split $_item ,] 0] set _lost [lindex [split $_item ,] 1] set _shots [lindex [split $_item ,] 2] set _played [lindex [split $_item ,] 4] set playerstat "$_nick \00307played $_played games, \00309won $_win, \00304lost $_lost, \00313took $_shots shots" return } proc showall {nick uhost handle chan arg} { global botnick scorefile rrscoresbyname rrscorestotal rrscores rrranksbyname rrranksbynum get_scores set totallength 16 if {$rrscorestotal>0} { putquick "PRIVMSG $nick :\00304*****************Roulette Scores**********************" putquick "PRIVMSG $nick :\00304**| NickName | Total | Won | Lost | Shots \00304|**" putquick "PRIVMSG $nick :\00304**|-----------------|-------|-------|------|-------|**" set i 0 while {$i<[expr [llength $rrscores] - 1]} { set checked 0 set _item [lindex $rrscores $i] set _nick [lindex [split $_item ,] 5] set _win [lindex [split $_item ,] 0] if {$_win < 10} { set _win " $_win " } elseif {$_win < 100} { set _win " $_win " } set _lost [lindex [split $_item ,] 1] if {$_lost < 10} { set _lost " $_lost " } elseif {$_lost < 100} { set _lost " $_lost " } set _shots [lindex [split $_item ,] 2] if {$_shots < 10} { set _shots " $_shots " } elseif {$_shots < 100} { set _shots " $_shots " } set _played [lindex [split $_item ,] 4] if {$_played < 10} { set _played " $_played " } elseif {$_played < 100} { set _played " $_played " } set checknick [split $_nick ""] set who [lindex [split $nick "|"] 0] set who [lindex [split $who "_"] 0] if {[string tolower $who] == [string tolower $_nick]} {set checked 1} set long [llength $checknick] set spaces "" for {set i2 $long} {$i2 < $totallength} {incr i2} { append spaces " " } if {$checked == 1} { putquick "PRIVMSG $nick :\00304**| \00312$_nick$spaces\00304|\00312$_played\00304|\00312$_win\00304|\00312$_lost\00304|\00312$_shots\00304|**" } else { putquick "PRIVMSG $nick :\00304**| \00310$_nick$spaces\00304|\00310$_played\00304|\00310$_win\00304|\00310$_lost\00304|\00310$_shots\00304|**" } incr i } putquick "PRIVMSG $nick :\00304********************End off list**********************" } return 0 } proc show_player_score {nick host handle chan arg} { global rrscoresbyname rrscores playerstat if {$arg == ""} { set arg $nick } else { set arg [lindex [split $arg " "] 0] } show_score $arg puthelp "PRIVMSG $chan : $playerstat" return 1 } proc started {} { putlog "starttimer ended" } proc tggamemsg {what} {global rrchannel;putquick "PRIVMSG $rrchannel :[tgbold]$what"} putlog "\00304Modern Roulette Made By Dopeydwerg Loaded"  

    3 downloads

       (0 reviews)

    0 comments

    Updated

  16. Free

    roulette0.3.1.EN.tcl

    Russian Roulette Script
    Version 0.3.1 by dozilla <dozilla@gmx.net> aka Dominik Zilliken 
    To get onto the player list type !roulette1 , !roulette2 , !roulette3
    To start game type !roulette
    Script is just available in German, yet but I will try to make an English version soon, too...
    Have Fun playing Russian Roulette 
    040706 : Changed it to English (Greetz, Cyclone)
     
    ### Russian Roulette Script ### Version 0.3.1 by dozilla <dozilla@gmx.net> aka Dominik Zilliken ### To get onto the player list type !roulette1 , !roulette2 , !roulette3 ### To start game type !roulette ### Script is just available in German, yet but I will try to make an English version soon, too... ### Have Fun playing Russian Roulette ### 040706 : Changed it to English (Greetz, Cyclone) set roulette_channel "#channel" bind pub - !roulette russian.roulette bind pub - !roulette1 roulette.1 bind pub - !roulette2 roulette.2 bind pub - !roulette3 roulette.3 variable nick1 "" variable nick2 "" variable nick3 "" variable player_turn "1"  

    3 downloads

       (0 reviews)

    0 comments

    Updated

  17. Free

    lovematch.tcl

    Love Match IRC Game Script
     
    #### ++++ Author: MadaliN <madalinmen28@yahoo.com> ### ++++ TCL Name: Love & Hate ## ++++ # # Commands: # !love nick1 nick2 # !hate nick1 nick2 bind pub - !love love:pub bind pub - !hate hate:pub proc love:pub {nick uhost hand chan arg} { set nick1 [lindex [split $arg] 0] set nick2 [lindex [split $arg] 1] if {($nick1 != "") && ($nick2 != "") && [onchan $nick1 $chan] && [onchan $nick2 $chan]} { set lovematch [minmaxrand 0 101] if {$lovematch == "100"} { putserv "PRIVMSG $chan :Congratulations! Love match \00312$nick1\003 + \00312$nick2\003 = \00304\002$lovematch\002%" } else { putserv "PRIVMSG $chan :Love match \00312$nick1\003 + \00312$nick2\003 = \00304\002$lovematch\002%" } } } proc hate:pub {nick uhost hand chan arg} { set nick1 [lindex [split $arg] 0] set nick2 [lindex [split $arg] 1] if {($nick1 != "") && ($nick2 != "") && [onchan $nick1 $chan] && [onchan $nick2 $chan]} { set hatematch [minmaxrand 0 100] if {$hatematch == "100"} { putserv "PRIVMSG $chan :Congratulations! Hate match \002$nick1\002 + \002$nick2\002 = \00304\002$hatematch\002%" } else { putserv "PRIVMSG $chan :Hate match \002$nick1\002 + \002$nick2\002 = \002$hatematch\002%" } } } proc minmaxrand {min max} { set r [expr ([rand [expr ($max - $min)]] + $min)] return $r } putlog "+++ sucesfully loaded: \00312Love & Hate TCL Script"  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  18. Free

    BlackScrabble-En.tcl

    Black Scrabble IRC Game Script
     
    #################################################################### # # Black Scrabble 1.2.1 TCL - en version # #A game in which you are given letters and you have to make words with them # #Commands : # #!scrabble <on> / <off> - enable / disable Scrabble #!scrabble - start game #!scrabble stop - stop jocul #!scrabble reset - reset top #!top <general> / <round> - vizualizezi topurile. #!won <user> - view user statistics. #!game - show the current letters from which you will form words. # #INSTALL : # #Put Scrabble.db and the BlackScrabble.tcl file in scripts #Add in config source scripts/BlackScrabble.tcl # # have Fun # # BLackShaDoW ProductionS # Translate by Nik WwW.TclScripts.Net #################################################################### #Set here which flags can enable / disable / reset Scrabble set scrabble(flags) "mn|mM" #Here you set after how many rounds in which there is no activity #to stop the automatic game? set scrabble(end_rounds) "5" #After how many correct answers the eggdrop to show again the letters ? set scrabble(correct_answers_show) "3" #Random round for double points #(will choose a random round from the maximum set below) set scrabble(double_points_round) "5" ### #Select mask to use for users #1 - *!*@$host #2 - *!$ident@$host #3 - $user!$ident@$host #4 - $user!*@* #5 - *!$ident@* set scrabble(userhost) "1" ##################################################################### # # The End is Near :) # #####################################################################  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  19. Free

    duckhunt.tcl

    Duck Hunt IRC Game Script
     
    ############################################################################### # # Duck Hunt # v2.11 (11/04/2016) �2015-2016 Menz Agitat # # IRC: irc.epiknet.org #boulets / #eggdrop # # Mes scripts sont t�l�chargeables sur http://www.eggdrop.fr # Retrouvez aussi toute l'actualit� de mes releases sur # http://www.boulets.oqp.me/tcl/scripts/index.html # # Remerciements � Mon qui m'a donn� l'id�e de faire ce script, � Destiny pour le # beta-testing intensif et pas mal d'id�es, et � Fr�d�ric pour aussi pas mal # d'id�es et la r�alisation du background inclus (duck_background.png). # ############################################################################### # # Description # # Duck Hunt est un FPS pour IRC. # De temps en temps, un canard s'envole et les joueurs doivent l'abattre le plus # rapidement possible. # # Veuillez v�rifier que les param�tres de la section configuration ci-dessous # vous conviennent, de m�me que les param�tres que contiennent le fichier # Duck_Hunt.cfg. # ############################################################################### # # Licence # # Cette cr�ation est mise � disposition selon le Contrat # Attribution-NonCommercial-ShareAlike 3.0 Unported disponible en ligne # http://creativecommons.org/licenses/by-nc-sa/3.0/ ou par courrier postal � # Creative Commons, 171 Second Street, Suite 300, San Francisco, California # 94105, USA. # Vous pouvez �galement consulter la version fran�aise ici : # http://creativecommons.org/licenses/by-nc-sa/3.0/deed.fr # ###############################################################################  

    7 downloads

       (0 reviews)

    0 comments

    Updated

  20. Free

    StairsAndSlides.tcl

    ####################################################################### ## StairAndSlides.tcl 1.0 (24/12/2020) ## ## ## ## Copyright 2008 - 2020 @ WwW.TCLScripts.NET ## ### ## ## / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ ## ## ( T | C | L | S | C | R | I | P | T | S | . | N | E | T ) ## ## \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ ## ## ## ## [] ## ## [100] WINNER ## ## [] ## ## _____________ [] _____________ ____ ## ## ____________) [] (___________ / . .\ ## ## oo ! ! ! [] ' ! ! ! \ ---< ## ## .`\_/\_/\__ . . . [] ,! ! ! ! ! \ / ## ## ! ! ! [] ! ! snake _________/ / ## ## !___!_____!___[]_____'!_!__ -=:___________/ ## ## []__,_!_!_! ## ## []_!__!_!| ## ## ,[]_!__!_! ## ## ,! []_!__!| ## ## ,! ! []_!__! ## ## ! ! ! []_!| ## ## !! ! !|[]_| ## ## !!!._|_[] ## ## !!!|!_.[] ## ## !|!_!__[]!. ## ## !_!_!__[]! !. ## ## !_!_!__[]! ! `. ## ## |!_!__|]! ! ! `. ## ## |_!__|]! ! ! ! `. ## ## |____|_! ! ! ! ` ## ## |____|_! ! ! ! ## ## []____|_! ! ! ## ## []______|_! ! ## ## []________|_! [] ## ## ___start__________[]__________|____________[]______ ## ## ## ## ® BLaCkShaDoW Production ® ## ## ## ## PRESENTS ## ## ® ## #################### STAIRS AND SLIDES TCL ########################## ## ## ## DESCRIPTION: ## ## Who's fast and who's not? Roll the dice and avoid the snakes! ## ## ## ## The goal is to reach 100 points first. ## ## ## ## Ladders will take you up, but snakes will take you down! ## ## ## ## Tested on Eggdrop v1.8.4 (Debian Linux) Tcl version: 8.6.6 ## ## ## ####################################################################### ## ## ## INSTALLATION: ## ## ++ Edit the StairsAndSlides.tcl script and place it into ## ## your /scripts directory, ## ## ++ add "source scripts/StairsAndSlides.tcl" to your ## ## eggdrop config and rehash the bot. ## ## ## ####################################################################### ####################################################################### ## ## ## OFFICIAL LINKS: ## ## E-mail : BLaCkShaDoW[at]tclscripts.net ## ## Bugs report : http://www.tclscripts.net ## ## GitHub page : https://github.com/tclscripts/ ## ## Online help : irc://irc.undernet.org/tcl-help ## ## #TCL-HELP / UnderNet ## ## You can ask in english or romanian ## ## ## ## paypal.me/DanielVoipan = Please consider a donation. Thanks! ## ## ## ####################################################################### ## ## ## To activate: .chanset +stairs / .set #channel +stairs ## ## ## ## !stairs [?|help] - shows Stairs and Slides available commands. ## ## ## ## !stairs - starts the Stairs and Slides game. ## ## ## ## !join - join Stairs and Slides game. ## ## ## ## !dice - roll the dice. ## ## ## ## !stairs difficulty [easy|hard] - change game mode. ## ## ## ## !stairs lang [ro|en] - change game language. ## ## ## ## !stairs stop - stop the game, if running ## ## ## ## !stairs version - shows Stairs and Slides game version. ## ## ## ## !topXX [fastest/longest]- shows the top (ex !top10 or !top20 ## ## ## ## !sstat <nick/#> - shows stats for a nick or a place from TOP ## ## ## ####################################################################### ## ## ## LICENSE: ## ## This code comes with ABSOLUTELY NO WARRANTY. ## ## ## ## This program is free software; you can redistribute it and/or ## ## modify it under the terms of the GNU General Public License ## ## version 3 as published by the Free Software Foundation. ## ## ## ## This program is distributed WITHOUT ANY WARRANTY; ## ## without even the implied warranty of MERCHANTABILITY or ## ## FITNESS FOR A PARTICULAR PURPOSE. ## ## USE AT YOUR OWN RISK. ## ## ## ## See the GNU General Public License for more details. ## ## (http://www.gnu.org/copyleft/library.txt) ## ## ## ## Copyright 2008 - 2020 @ WwW.TCLScripts.NET ## ## ## ####################################################################### ####################################################################### ## CONFIGURATION FOR StairsAndSlides.TCL ## ####################################################################### ## #Set default char for commands set stairs(default_char) "!" ## #What flags can use !stairs stop, to stop the game (-|- for all) set stairs(stop_flags) "mn|MnOo" ## #Set here the default language (EN/RO) set stairs(default_lang) "EN" ## #Seconds to wait for the players to join set stairs(seconds_wait) "30" ## #How type of game the users should play ? (0 - easy ; 1 - hard) # easy - the users must arrive at cell number 100 or higher and they win # hard - the users must arrive exactly at cell number 100 to win, if the last dice # gets them on a cell +100 (like 104) they go to 100 then go back X places # (diference between +104 and 100) so they arrive at cell number 96. set stairs(game_type) "1" ## #Do you want to allow other users to join the game after it already started ? ( 0 - no ; 1 - yes) set stairs(game_after_join) "0" ## #How many seconds the bot should wait for the user to use dice (use !dice) set stairs(dice_wait) "30" ## #After how many forgotten !dice commands not used (consecutive) the user should be kicked from the game ? set stairs(dice_forget) "2" ## #How many dices to use ? (1 - 1 dice ; 2 - 2 dices) set stairs(dice_number) "2" ## #After game ends how many auto starts the game should have ? (0 for none) set stairs(auto_starts) "2" ## #How many seconds to be between the auto start tries ? set stairs(auto_starts_time) "20" ## #How many seconds to wait for the only user joined that joined the game to say "yes" #if he wants to play with the BOT ? set stairs(bot_play_time) "15" #Set here the type of hostname for users #1 - *!*@host #2 - *!ident@host #3 - user!ident@host #4 - user!*@* #5 - *!ident@* set stairs(user_host_type) "1" #Set webchan hosts #If is webchat host, the bot will take only ident set stairs(webchat_hosts) { "*.irccloud.com" "*!*@107.161.19.53" "*!*@107.161.19.109" "*!*@109.169.31.4" "*!*@109.169.29.95" "*!*@78.129.202.38" "*!*@64.62.228.82" "*!*@195.154.53.5" "*!*@212.83.148.225" "*!*@195.154.52.250" "*!*@207.192.75.252" "*!*@107.161.19.53" "*!*@192.184.10.9" "*!*@192.184.9.110" "*!*@tooting.irccloud.com" "*!*@192.184.8.73" "*!*@hathersage.irccloud.com" "*!*@ealing.irccloud.com" } ## #map of numbers set stairs_slides(num_map) { "1 2 3 4 5 6 7 8 9 10" "11 12 13 14 15 16 17 18 19 20" "21 22 23 24 25 26 27 28 29 30" "31 32 33 34 35 36 37 38 39 40" "41 42 43 44 45 46 47 48 49 50" "51 52 53 54 55 56 57 58 59 60" "61 62 63 64 65 66 67 68 69 70" "71 72 73 74 75 76 77 78 79 80" "81 82 83 84 85 86 87 88 89 90" "91 92 93 94 95 96 97 98 99 100" } ## #stairs and slides patterns # num1-num2 [snake -> num1-num2, go back from num1 to num2] [slide -> num1+num2, jump from num1 to num2] # You can add as many patterns as you want, the eggdrop with take a random one. ## set stairs(num_patterns) { "3+39 14+35 31+70 44+65 47+86 59+80 63+83 72+91 30-8 40-4 54-37 79-42 90-33 93-69 98-64" } ### # FLOOD PROTECTION #Set the number of minute(s) to ignore flooders, 0 to disable flood protection ### set stairs(ignore_prot) "1" ### # FLOOD PROTECTION #Set the number of requests within specifide number of seconds to trigger flood protection. # By default, 3:10, which allows for upto 3 queries in 10 seconds. 3 or more quries in 10 seconds would cuase # the forth and later queries to be ignored for the amount of time specifide above. ### set stairs(flood_prot) "3:5" ################################################################################ bind pub - $stairs(default_char)stairs stairs_slides:start bind pub - $stairs(default_char)join stairs_slides:join bind pub - $stairs(default_char)dice stairs_slides:dice bind pub - $stairs(default_char)sstat stairs_slides:stat bind nick - * stairs_slides:changenick bind pubm - * stairs_slides:bot_play_yes bind pubm - * stairs_slides:top bind time - "00 00 * * *" stairs_slides:month_reset setudef str stairs_lang setudef str stairs_difficulty setudef flag stairs set stairs(file) "stairsandslides.txt" if {![file exists $stairs(file)]} { set file [open $stairs(file) w] close $file } ### proc stairs_slides:month_reset {min hour day mon year} { global stairs_slides stairs if {[clock format [clock seconds] -format "%e"] == 1} { if {![info exists stairs_slides(month_reseted)]} { set stairs_slides(month_reseted) 1 stairs_slides:reset putlog "StairsAndSlide month reset succeded" } } elseif {[info exists stairs_slides(month_reseted)]} { unset stairs_slides(month_reseted) } } ### proc stairs_slides:reset {} { global stairs_slides stairs set file [open $stairs(file) w] close $file } ### proc stairs_slides:top {nick host hand chan arg} { global stairs_slides stairs if {![channel get $chan stairs]} { return } set command [lindex [split $arg] 0] set type [lindex [split $arg] 1] if {[string equal -nocase "fastest" $type]} { set type 1 } elseif {[string equal -nocase "longest" $type]} { set type 2 } else { set type 0 } set first_char [string index $command 0] if {[string equal -nocase $first_char $stairs(default_char)]} { set cmd [string tolower [string range $command 1 end]] if {[regexp -nocase {^(top)[0-9]+$} $cmd]} { set flood [stairs_slides:flood:prot $host $chan] if {$flood == 1} {return 0} set places [string map {"top" ""} $cmd] set top [stairs_slides:top_get $chan $places $type] if {$top == 0} { stairs_slides:say [list $places] "" $chan 39 0 } else { stairs_slides:say [list $places $top] "" $chan 38 0 } } } } ### proc stairs_slides:fastest {seconds chan} { global stairs_slides stairs set file [open $stairs(file) r] set read [read -nonewline $file] close $file array set top [list] set split_file [split $read "\n"] foreach line $split_file { set read_chan [lindex [split $line] 0] if {[string equal -nocase $read_chan $chan]} { set read_num [lindex [split $line] 4] set read_nick [lindex [split $line] 2] if {$read_num != "0"} { lappend top($read_num) $read_nick } } } if {[array size top] == 0} { return 0 } set counter 0 foreach i [lsort -integer -increasing [array names top]] { incr counter if {$counter == 1} { if {$seconds < $i} { set beat 1 } else { set beat 0 break } } } return $beat } ### proc stairs_slides:top_get {chan num type} { global stairs_slides stairs set file [open $stairs(file) r] set read [read -nonewline $file] close $file set split_file [split $read "\n"] set lang [string tolower [channel get $chan stairs_lang]] if {$lang == ""} { set lang [string tolower $stairs(default_lang)] } array set top [list] set counter 0 foreach line $split_file { set read_chan [lindex [split $line] 0] if {[string equal -nocase $read_chan $chan]} { set read_nick [lindex [split $line] 2] switch $type { 0 { set read_num [lindex [split $line] 3] } 1 { set read_num [lindex [split $line] 4] } 2 { set read_num [lindex [split $line] 5] } } if {$read_num != "0"} { incr counter lappend top($read_num) $read_nick } if {$counter == $num} { break } } } if {[array size top] == 0} { return 0 } else { set counter 0 set output "" foreach i [lsort -integer -decreasing [array names top]] { incr counter if {$type == 0} { lappend output "\#$counter [join $top($i) ", "] ($i $stairs($lang.lang.37))" } else { lappend output "\#$counter [join $top($i) ", "] ([stairs_slides:time_return $i])" } } if {$output == ""} {return 0} return [join $output] } } ### proc stairs_slides:stat_place {place chan} { global stairs_slides stairs set file [open $stairs(file) r] set read [read -nonewline $file] close $file set split_file [split $read "\n"] array set top [list] set counter 0 foreach line $split_file { set read_chan [lindex [split $line] 0] if {[string equal -nocase $read_chan $chan]} { set read_nick [lindex [split $line] 2] set read_num [lindex [split $line] 3] lappend top($read_num) $read_nick } } if {[array size top] == 0} { return 0 } set output 0 foreach i [lsort -integer -decreasing [array names top]] { incr counter if {[string equal -nocase $counter $place]} { set output $top($i) break } } return $output } ### proc stairs_slides:stat {nick host hand chan arg} { global stairs_slides stairs if {![channel get $chan stairs]} { return } set flood [stairs_slides:flood:prot $host $chan] if {$flood == 1} {return 0} set what [lindex [split $arg] 0] set place_search 0 if {$what == ""} {set what $nick} if {[regexp {^[0-9]+$} $what]} { set place_search 1 } set file [open $stairs(file) r] set read [read -nonewline $file] close $file set split_read [split $read "\n"] if {$place_search == 0} { set search [lsearch -nocase $split_read "$chan * $what *"] if {$search > -1} { set line [lindex $split_read $search] set read_host [lindex [split $line] 1] set read_nick [lindex [split $line] 2] set read_wins [lindex [split $line] 3] set read_shortest_time [stairs_slides:time_return [lindex [split $line] 4]] set read_longest_time [stairs_slides:time_return [lindex [split $line] 5]] set read_timewasted [stairs_slides:time_return [lindex [split $line] 6]] stairs_slides:say [list $read_nick $read_host $read_wins $read_shortest_time $read_longest_time $read_timewasted] "" $chan 35 0 } else { stairs_slides:say [list $what] "" $chan 36 0 } } else { set nicks [stairs_slides:stat_place $what $chan] if {$nicks == 0} { stairs_slides:say [list $what] "" $chan 40 0 return } foreach entry $nicks { set search [lsearch -nocase $split_read "$chan * $entry *"] if {$search > -1} { set line [lindex $split_read $search] set read_host [lindex [split $line] 1] set read_nick [lindex [split $line] 2] set read_wins [lindex [split $line] 3] set read_shortest_time [stairs_slides:time_return [lindex [split $line] 4]] set read_longest_time [stairs_slides:time_return [lindex [split $line] 5]] set read_timewasted [stairs_slides:time_return [lindex [split $line] 6]] stairs_slides:say [list $read_nick $read_host $read_wins $read_shortest_time $read_longest_time $read_timewasted] "" $chan 35 0 } else { stairs_slides:say [list $what] "" $chan 36 0 } } } } ### proc stairs_slides:save {chan host nick wins time timewasted} { global stairs_slides stairs set file [open $stairs(file) r] set read [read -nonewline $file] close $file set split_read [split $read "\n"] set search [lsearch -nocase $split_read "$chan $host *"] if {$search < 0} { set file [open $stairs(file) a] puts $file "$chan $host $nick $wins $time $time $timewasted" close $file } else { set timestamp [clock format [clock seconds] -format {%Y%m%d%H%M%S}] set temp "${stairs(file)}.$timestamp" set tempwrite [open $temp w] set shortest_time "" set longest_time "" set time_wasted "" foreach line $split_read { set read_chan [lindex [split $line] 0] set read_host [lindex [split $line] 1] if {[string equal -nocase $read_chan $chan] && [string equal -nocase $read_host $host]} { set read_wins [lindex [split $line] 3] set read_shortest_time [lindex [split $line] 4] set read_longest_time [lindex [split $line] 5] set read_timewasted [lindex [split $line] 6] if {$time < $read_shortest_time} { set shortest_time $time set longest_time $read_longest_time } elseif {$time > $read_shortest_time} { set shortest_time $read_shortest_time if {$time > $read_longest_time} { set longest_time $time } else {set longest_time $read_longest_time} } else { set shortest_time $read_shortest_time set longest_time $read_longest_time } set wins [expr $read_wins + $wins] set time_wasted [expr $read_timewasted + $timewasted] continue } else { puts $tempwrite $line } } puts $tempwrite "$chan $host $nick $wins $shortest_time $longest_time $time_wasted" close $tempwrite file rename -force $temp $stairs(file) } } ### proc stairs_slides:difficulty {chan} { global stairs_slides stairs set difficulty [channel get $chan stairs_difficulty] if {$difficulty == ""} { return $stairs(game_type) } elseif {[string equal -nocase $difficulty "easy"]} { return 0 } elseif {[string equal -nocase $difficulty "hard"]} { return 1 } else { return $stairs(game_type) } } ### proc stairs_slides:start {nick host hand chan arg} { global stairs_slides stairs if {![channel get $chan stairs]} { return } set flood [stairs_slides:flood:prot $host $chan] if {$flood == 1} {return 0} set what [lindex [split $arg] 0] set option [string tolower [lindex [split $arg] 1]] switch [string tolower $what] { difficulty { if {$option == ""} { stairs_slides:say [list $option] $nick $chan 46 1 return } if {[string equal -nocase "easy" $option]} { channel set $chan stairs_difficulty $option stairs_slides:say [list $option] $nick $chan 45 1 } elseif {[string equal -nocase "hard" $option]} { channel set $chan stairs_difficulty $option stairs_slides:say [list $option] $nick $chan 45 1 } else { stairs_slides:say [list $option] $nick $chan 44 1 } return } lang { if {$option == ""} { stairs_slides:say [list $option] $nick $chan 43 1 return } if {![info exists stairs($option.lang.1)]} { stairs_slides:say [list $option] $nick $chan 41 1 return } channel set $chan stairs_lang $option stairs_slides:say [list $option] $nick $chan 42 1 return } version { putserv "PRIVMSG $chan :\002$stairs(projectName) $stairs(version)\002 coded by $stairs(author) ($stairs(website))" return } stop { if {[matchattr $hand $stairs(stop_flags) $chan]} { stairs_slides:stop $chan return } } help { stairs_slides:say [list $option] $nick $chan 47 1 return } \? { stairs_slides:say [list $option] $nick $chan 47 1 return } } if {[info exists stairs_slides(no_autostart:$chan)]} { unset stairs_slides(no_autostart:$chan) } if {[info exists stairs_slides(game_start:$chan)]} { stairs_slides:say "" $nick $chan 2 1 return } foreach tmr [utimers] { if {[string match "*stairs_slides:autostart:now $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } } set stairs_slides(game_start:$chan) 1 set stairs_slides(game_join:$chan) 1 stairs_slides:say "" $nick $chan 31 0 stairs_slides:say "" $nick $chan 1 0 utimer $stairs(seconds_wait) [list stairs_slides:check_enough $chan] } proc stairs_slides:stop {chan} { global stairs_slides stairs if {![info exists stairs_slides(game_start:$chan)]} { return } foreach tmr [utimers] { if {[string match "*stairs_slides:autostart:now $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } if {[string match "*stairs_slides:no_bot_play $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } if {[string match "*stairs_slides:no_dice * $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } if {[string match "*stairs_slides:game_start_now * $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } if {[string match "*stairs_slides:check_enough $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } if {[string match "*stairs_slides:game_start $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } } stairs_slides:unset $chan stairs_slides:say "" "" $chan 49 0 } ### proc stairs_slides:autostart {chan} { global stairs_slides stairs if {![info exists stairs_slides(autostart_num:$chan)]} { set stairs_slides(autostart_num:$chan) 0 } if {$stairs_slides(autostart_num:$chan) >= $stairs(auto_starts)} { unset stairs_slides(autostart_num:$chan) set stairs_slides(no_autostart:$chan) 1 return 0 } utimer $stairs(auto_starts_time) [list stairs_slides:autostart:now $chan] incr stairs_slides(autostart_num:$chan) } ### proc stairs_slides:autostart:now {chan} { global stairs_slides stairs set stairs_slides(game_start:$chan) 1 set stairs_slides(game_join:$chan) 1 stairs_slides:say "" "" $chan 31 0 stairs_slides:say "" "" $chan 1 0 utimer $stairs(seconds_wait) [list stairs_slides:check_enough $chan] } ### proc stairs_slides:no_bot_play {chan} { global stairs_slides stairs stairs_slides:say "" "" $chan 7 0 stairs_slides:unset $chan if {$stairs(auto_starts) > 0 && ![info exists stairs_slides(no_autostart:$chan)]} { stairs_slides:autostart $chan } return } ### proc stairs_slides:bot_play_yes {nick host hand chan arg} { global stairs_slides stairs botnick if {![info exists stairs_slides(game_start:$chan)]} {return} if {[info exists stairs_slides(bot_play:$chan)]} { set text [lindex [split $arg] 0] if {[string equal -nocase $text "yes"]} { set hostname [stairs_slides:host_return $stairs(user_host_type) $nick [getchanhost $nick $chan]] set entry [lindex $stairs_slides(players:$chan) 0] set read_hostname [lindex $entry 1] if {[string equal -nocase $hostname $read_hostname]} { foreach tmr [utimers] { if {[string match "*stairs_slides:no_bot_play $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } } unset stairs_slides(bot_play:$chan) set bot_host [stairs_slides:host_return $stairs(user_host_type) $botnick [getchanhost $botnick $chan]] set id [stairs_slides:id $chan] lappend stairs_slides(players:$chan) [list $botnick $bot_host $id] stairs_slides:say [list $botnick] $nick $chan 5 0 set game_difficulty [stairs_slides:difficulty $chan] set lang [string tolower [channel get $chan stairs_lang]] if {$lang == ""} { set lang [string tolower $stairs(default_lang)] } if {$game_difficulty == 0} { set difficulty $stairs($lang.lang.32) } else { set difficulty $stairs($lang.lang.33) } set players [stairs_slides:players $chan] stairs_slides:say [list $difficulty] "" $chan 22 0 stairs_slides:say [list [llength $stairs_slides(players:$chan)] $players] "" $chan 9 0 utimer 4 [list stairs_slides:game_start $chan] } } } } ### proc stairs_slides:check_enough {chan} { global stairs_slides stairs if {![info exists stairs_slides(players:$chan)]} { if {$stairs(auto_starts) > 0} { if {[info exists stairs_slides(autostart_num:$chan)]} { if {$stairs_slides(autostart_num:$chan) >= $stairs(auto_starts)} { stairs_slides:say "" "" $chan 6 0 } else { stairs_slides:say "" "" $chan 8 0 } } else { stairs_slides:say "" "" $chan 8 0 } } else { stairs_slides:say "" "" $chan 6 0 } stairs_slides:unset $chan if {$stairs(auto_starts) > 0 && ![info exists stairs_slides(no_autostart:$chan)]} { stairs_slides:autostart $chan } return } if {[llength $stairs_slides(players:$chan)] < 2} { if {[info exists stairs_slides(game_join:$chan)]} { unset stairs_slides(game_join:$chan) } set stairs_slides(bot_play:$chan) 0 set entry [lindex $stairs_slides(players:$chan) 0] set read_nick [lindex $entry 0] stairs_slides:say [list $read_nick $stairs(bot_play_time)] $read_nick $chan 24 0 utimer $stairs(bot_play_time) [list stairs_slides:no_bot_play $chan] return } set game_difficulty [stairs_slides:difficulty $chan] set lang [string tolower [channel get $chan stairs_lang]] if {$lang == ""} { set lang [string tolower $stairs(default_lang)] } if {$game_difficulty == 0} { set difficulty $stairs($lang.lang.32) } else { set difficulty $stairs($lang.lang.33) } set players [stairs_slides:players $chan] stairs_slides:say [list $difficulty] "" $chan 22 0 stairs_slides:say [list [llength $stairs_slides(players:$chan)] $players] "" $chan 9 0 if {[info exists stairs_slides(game_join:$chan)]} { unset stairs_slides(game_join:$chan) } utimer 4 [list stairs_slides:game_start $chan] } ### proc stairs_slides:game_start {chan} { global stairs_slides if {[info exists stairs_slides(autostart_num:$chan)]} { unset stairs_slides(autostart_num:$chan) } set dicelist [stairs_slides:autodice $chan] stairs_slides:say [list [join $dicelist ", "]] "" $chan 10 0 set stairs_slides(game_start_time:$chan) [unixtime] utimer 5 [list stairs_slides:game_start_now 0 $chan] } ### proc stairs_slides:game_start_now {num chan} { global stairs_slides stairs botnick set entry [lindex $stairs_slides(players:$chan) $num] set stairs_slides(current_player_pos:$chan) $num set nickname [lindex $entry 0] set hostname [lindex $entry 1] set id [lindex $entry 2] if {![string equal -nocase $nickname $botnick]} { set stairs_slides(current_dice:$chan) $id if {![info exists stairs_slides(first_dice_show:$chan)] && $num == 0} { stairs_slides:say [list $nickname $stairs(dice_wait)] "" $chan 27 0 set stairs_slides(first_dice_show:$chan) 1 } else { stairs_slides:say [list $nickname $stairs(dice_wait)] "" $chan 12 0 } utimer $stairs(dice_wait) [list stairs_slides:no_dice $num $chan] } else { stairs_slides:bot_dice $id $chan } } ### proc stairs_slides:bot_dice {id chan} { global stairs_slides stairs botnick if {[info exists stairs_slides(current_dice:$chan)]} { unset stairs_slides(current_dice:$chan) } set dices [stairs_slides:dice_get] stairs_slides:save_dices $id $chan if {$stairs(dice_number) == 1} { set ivalue "[lindex $dices 0] [stairs_slides:special_text [stairs_slides:dice_image [lindex $dices 0]]]" set value [lindex $dices 0] set sum $value } else { foreach v [lindex $dices 0] { set i [stairs_slides:special_text [stairs_slides:dice_image $v]] lappend ivalue "$v $i" } set ivalue [join $ivalue] set value [lindex $dices 0] set sum [lindex $dices 1] } stairs_slides:advance $id $chan $sum $value $ivalue } ### proc stairs_slides:player_left {nick id chan} { global stairs_slides stairs stairs_slides:say [list $nick] "" $chan 25 0 stairs_slides:remove $chan $id set llength_players [llength $stairs_slides(players:$chan)] if {$llength_players < 2} { stairs_slides:say "" "" $chan 15 0 stairs_slides:unset $chan if {$stairs(auto_starts) > 0 && ![info exists stairs_slides(no_autostart:$chan)]} { stairs_slides:autostart $chan } } else { set inc [expr $num + 1] if {[lindex $stairs_slides(players:$chan) $inc] != ""} { utimer 3 [list stairs_slides:game_start_now $inc $chan] } else { utimer 3 [list stairs_slides:game_start_now 0 $chan] } } } ### proc stairs_slides:no_dice {num chan} { global stairs_slides stairs set new_penalty 0 set id $stairs_slides(current_dice:$chan) unset stairs_slides(current_dice:$chan) set nick [stairs_slides:get $chan $id 0] if {![onchan $nick $chan]} { stairs_slides:player_left $nick $id $chan return } stairs_slides:times $id $chan $stairs(dice_wait) if {![info exists stairs_slides(penalties:$chan)]} { lappend stairs_slides(penalties:$chan) [list $id "1"] stairs_slides:say [list $nick $stairs(dice_forget)] "" $chan 13 0 } else { set search [lsearch -nocase $stairs_slides(penalties:$chan) [list $id "*"]] if {$search < 0} { lappend stairs_slides(penalties:$chan) [list $id "1"] stairs_slides:say [list $nick $stairs(dice_forget)] "" $chan 13 0 } else { set entry [lindex $stairs_slides(penalties:$chan) $search] set penalty_nr [lindex $entry 1] incr penalty_nr if {$penalty_nr < $stairs(dice_forget)} { set stairs_slides(penalties:$chan) [lreplace $stairs_slides(penalties:$chan) $search $search] lappend stairs_slides(penalties:$chan) [list $id $penalty_nr] stairs_slides:say [list $nick $stairs(dice_forget)] "" $chan 13 0 } else { stairs_slides:say [list $nick] "" $chan 14 0 stairs_slides:remove $chan $id } } } if {![info exists stairs_slides(players:$chan)]} { return } set llength_players [llength $stairs_slides(players:$chan)] if {$llength_players < 2} { stairs_slides:say "" "" $chan 15 0 stairs_slides:unset $chan if {$stairs(auto_starts) > 0 && ![info exists stairs_slides(no_autostart:$chan)]} { stairs_slides:autostart $chan } } else { set inc [expr $num + 1] if {[lindex $stairs_slides(players:$chan) $inc] != ""} { utimer 4 [list stairs_slides:game_start_now $inc $chan] } else { utimer 4 [list stairs_slides:game_start_now 0 $chan] } } } ### proc stairs_slides:remove {chan id} { global stairs_slides set search [lsearch -nocase $stairs_slides(players:$chan) [list "*" "*" $id]] set stairs_slides(players:$chan) [lreplace $stairs_slides(players:$chan) $search $search] if {[info exists stairs_slides(penalties:$chan)]} { set search [lsearch -nocase $stairs_slides(penalties:$chan) [list $id "*"]] set stairs_slides(penalties:$chan) [lreplace $stairs_slides(penalties:$chan) $search $search] } if {[info exists stairs_slides(positions:$chan)]} { set search [lsearch -nocase $stairs_slides(positions:$chan) [list $id "*"]] set stairs_slides(positions:$chan) [lreplace $stairs_slides(positions:$chan) $search $search] } if {[info exists stairs_slides(dices:$chan)]} { set search [lsearch -nocase $stairs_slides(dices:$chan) [list $id "*"]] set stairs_slides(dices:$chan) [lreplace $stairs_slides(dices:$chan) $search $search] } if {[info exists stairs_slides(future_stairs_slides:$chan)]} { set search [lsearch -nocase $stairs_slides(future_stairs_slides:$chan) [list $id "*"]] set stairs_slides(future_stairs_slides:$chan) [lreplace $stairs_slides(future_stairs_slides:$chan) $search $search] } if {[info exists stairs_slides(times:$chan)]} { set search [lsearch -nocase $stairs_slides(times:$chan) [list $id "*"]] set stairs_slides(times:$chan) [lreplace $stairs_slides(times:$chan) $search $search] } } ### proc stairs_slides:dice_get {} { global stairs set dices "" set counter 0 set sum 0 if {$stairs(dice_number) == 1} { set dice [expr [rand 6] + 1] return [list $dice $dice] } else { while {$counter < 2} { set dice [expr [rand 6] + 1] set sum [expr $sum + $dice] lappend dices $dice incr counter } return [list $dices $sum] } } ### proc stairs_slides:autodice {chan} { global stairs_slides stairs set first_dice_winner 0 set dices "" set players_dice "" array set dice_order [list] foreach entry $stairs_slides(players:$chan) { set nickname [lindex $entry 0] set hostname [lindex $entry 1] if {[lsearch -nocase $players_dice $entry] < 0} { if {$stairs(dice_number) == 1} { set dice [expr [rand 6] + 1] } else { set dice1 [expr [rand 6] + 1] set dice2 [expr [rand 6] + 1] set dice [expr $dice1 + $dice2] } while 1 { if {[lsearch $dices $dice] < 0} { lappend dice_order($dice) $entry lappend dices $dice lappend players_dice $entry break } else { if {$stairs(dice_number) == 1} { set dice [expr [rand 6] + 1] } else { set dice1 [expr [rand 6] + 1] set dice2 [expr [rand 6] + 1] set dice [expr $dice1 + $dice2] } } } } } set dicelist "" unset stairs_slides(players:$chan) foreach a [lsort -integer -decreasing [array names dice_order]] { lappend stairs_slides(players:$chan) [join $dice_order($a)] set nickname [lindex [lindex $dice_order($a) 0] 0] lappend dicelist "$nickname \[$a\]" } return $dicelist } ### proc stairs_slides:unset {chan} { global stairs_slides if {[info exists stairs_slides(game_start:$chan)]} { unset stairs_slides(game_start:$chan) } if {[info exists stairs_slides(game_join:$chan)]} { unset stairs_slides(game_join:$chan) } if {[info exists stairs_slides(players:$chan)]} { unset stairs_slides(players:$chan) } if {[info exists stairs_slides(current_dice:$chan)]} { unset stairs_slides(current_dice:$chan) } if {[info exists stairs_slides(penalties:$chan)]} { unset stairs_slides(penalties:$chan) } if {[info exists stairs_slides(positions:$chan)]} { unset stairs_slides(positions:$chan) } if {[info exists stairs_slides(current_player_pos:$chan)]} { unset stairs_slides(current_player_pos:$chan) } if {[info exists stairs_slides(stairs_slide:$chan)]} { unset stairs_slides(stairs_slide:$chan) } if {[info exists stairs_slides(game_start_time:$chan)]} { unset stairs_slides(game_start_time:$chan) } if {[info exists stairs_slides(bot_play:$chan)]} { unset stairs_slides(bot_play:$chan) } if {[info exists stairs_slides(game_end_time:$chan)]} { unset stairs_slides(game_end_time:$chan) } if {[info exists stairs_slides(dices:$chan)]} { unset stairs_slides(dices:$chan) } if {[info exists stairs_slides(total_dices:$chan)]} { unset stairs_slides(total_dices:$chan) } if {[info exists stairs_slides(first_dice_show:$chan)]} { unset stairs_slides(first_dice_show:$chan) } if {[info exists stairs_slides(game_won:$chan)]} { unset stairs_slides(game_won:$chan) } if {[info exists stairs_slides(future_stairs_slides:$chan)]} { unset stairs_slides(future_stairs_slides:$chan) } if {[info exists stairs_slides(times:$chan)]} { unset stairs_slides(times:$chan) } } ### proc stairs_slides:dice {nick host hand chan arg} { global stairs_slides stairs if {![channel get $chan stairs]} { return } set flood [stairs_slides:flood:prot $host $chan] if {$flood == 1} {return 0} if {![info exists stairs_slides(game_start:$chan)]} { return } if {![info exists stairs_slides(players:$chan)]} { return } if {![info exists stairs_slides(current_dice:$chan)]} { return } set hostname [stairs_slides:host_return $stairs(user_host_type) $nick [getchanhost $nick $chan]] set search [lsearch $stairs_slides(players:$chan) [list "*" $hostname "*"]] if {$search < 0} {return} set entry [lindex $stairs_slides(players:$chan) $search] set f_hostname [lindex $entry 1] set f_nick [lindex $entry 0] set id [lindex $entry 2] if {![string equal $id $stairs_slides(current_dice:$chan)]} { return } if {[info exists stairs_slides(penalties:$chan)]} { set search [lsearch -nocase $stairs_slides(penalties:$chan) [list $id "*"]] set stairs_slides(penalties:$chan) [lreplace $stairs_slides(penalties:$chan) $search $search] } foreach tmr [utimers] { if {[string match "*stairs_slides:no_dice * $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] set seconds_remain [lindex $tmr 0] set diff [expr $stairs(dice_wait) - $seconds_remain] stairs_slides:times $id $chan $diff break } } if {[info exists stairs_slides(current_dice:$chan)]} { unset stairs_slides(current_dice:$chan) } set dices [stairs_slides:dice_get] stairs_slides:save_dices $id $chan if {$stairs(dice_number) == 1} { set ivalue "[lindex $dices 0] [stairs_slides:special_text [stairs_slides:dice_image [lindex $dices 0]]]" set value [lindex $dices 0] set sum $value } else { foreach v [lindex $dices 0] { set i [stairs_slides:special_text [stairs_slides:dice_image $v]] lappend ivalue "$v $i" } set ivalue [join $ivalue] set value [lindex $dices 0] set sum [lindex $dices 1] } stairs_slides:advance $id $chan $sum $value $ivalue } ### proc stairs_slides:get_times {id chan} { global stairs_slides stairs if {![info exists stairs_slides(times:$chan)]} { return 0 } set search [lsearch -nocase $stairs_slides(times:$chan) [list $id "*"]] if {$search > -1} { set entry [lindex $stairs_slides(times:$chan) $search] set read_seconds [lindex $entry 1] return $read_seconds } else { return 0 } } ### proc stairs_slides:times {id chan seconds} { global stairs_slides stairs if {![info exists stairs_slides(times:$chan)]} { lappend stairs_slides(times:$chan) [list $id $seconds] } else { set search [lsearch $stairs_slides(times:$chan) [list $id "*"]] if {$search > -1} { set entry [lindex $stairs_slides(times:$chan) $search] set read_seconds [lindex $entry 1] set seconds [expr $read_seconds + $seconds] set stairs_slides(times:$chan) [lreplace $stairs_slides(times:$chan) $search $search] lappend stairs_slides(times:$chan) [list $id $seconds] } else { lappend stairs_slides(times:$chan) [list $id $seconds] } } } ### proc stairs_slides:save_dices {id chan} { global stairs_slides stairs if {![info exists stairs_slides(dices:$chan)]} { lappend stairs_slides(dices:$chan) [list $id 1] } else { set search [lsearch $stairs_slides(dices:$chan) [list $id "*"]] if {$search > -1} { set found [lindex $stairs_slides(dices:$chan) $search] set current_dice [lindex $found 1] incr current_dice set stairs_slides(dices:$chan) [lreplace $stairs_slides(dices:$chan) $search $search] lappend stairs_slides(dices:$chan) [list $id $current_dice] } else { lappend stairs_slides(dices:$chan) [list $id 1] } } if {![info exists stairs_slides(total_dices:$chan)]} { set stairs_slides(total_dices:$chan) 1 } else { set stairs_slides(total_dices:$chan) [expr $stairs_slides(total_dices:$chan) + 1] } } ### proc stairs_slides:get_dices {id chan} { global stairs_slides stairs if {![info exists stairs_slides(dices:$chan)]} { return 0 } else { set search [lsearch $stairs_slides(dices:$chan) [list $id "*"]] if {$search > -1} { set found [lindex $stairs_slides(dices:$chan) $search] set current_dice [lindex $found 1] return $current_dice } else {return 0} } } ### proc stairs_slides:advance {id chan sum value ivalue} { global stairs_slides stairs set current_pos $stairs_slides(current_player_pos:$chan) set nick [stairs_slides:get $chan $id 0] if {![info exists stairs_slides(positions:$chan)]} { lappend stairs_slides(positions:$chan) [list $id $sum] set next_sum $sum set current_sum $sum set search [lsearch $stairs_slides(positions:$chan) [list $id "*"]] } else { set search [lsearch $stairs_slides(positions:$chan) [list $id "*"]] if {$search > -1} { set found [lindex $stairs_slides(positions:$chan) $search] set current_sum [lindex $found 1] set next_sum [expr $current_sum + $sum] } else { set next_sum $sum set current_sum $sum lappend stairs_slides(positions:$chan) [list $id $sum] set search [lsearch $stairs_slides(positions:$chan) [list $id "*"]] } } set game_difficulty [stairs_slides:difficulty $chan] if {$game_difficulty == 0} { incr current_pos if {$next_sum < 100} { if {$stairs(dice_number) == 1} { stairs_slides:say [list $nick $ivalue $sum] $nick $chan 17 0 } else { stairs_slides:say [list $nick $ivalue $sum] $nick $chan 16 0 } set status [stairs_slides:advance:pos $search $chan $next_sum $current_sum] set jump_to [lindex $status 1] set status [lindex $status 0] set seconds 4 if {$status > -1} { set future_stairs_slides [stairs_slides:future_stairs_slides $id $nick $jump_to $chan] set seconds 6 } else { set future_stairs_slides [stairs_slides:future_stairs_slides $id $nick $next_sum $chan] } if {$future_stairs_slides == 1} { set seconds [expr $seconds + 2] } if {[lindex $stairs_slides(players:$chan) $current_pos] != ""} { utimer $seconds [list stairs_slides:game_start_now $current_pos $chan] } else { utimer $seconds [list stairs_slides:game_start_now 0 $chan] } } else { stairs_slides:winner $id $chan $next_sum $value } } else { if {$next_sum < 100} { incr current_pos if {$stairs(dice_number) == 1} { stairs_slides:say [list $nick $ivalue $ivalue] $nick $chan 17 0 } else { stairs_slides:say [list $nick $ivalue $sum] $nick $chan 16 0 } set status [stairs_slides:advance:pos $search $chan $next_sum $current_sum] set jump_to [lindex $status 1] set status [lindex $status 0] set seconds 4 if {$status > -1} { set future_stairs_slides [stairs_slides:future_stairs_slides $id $nick $jump_to $chan] set seconds 6 } else { set future_stairs_slides [stairs_slides:future_stairs_slides $id $nick $next_sum $chan] } if {$future_stairs_slides == 1} { set seconds [expr $seconds + 2] } if {[lindex $stairs_slides(players:$chan) $current_pos] != ""} { utimer $seconds [list stairs_slides:game_start_now $current_pos $chan] } else { utimer $seconds [list stairs_slides:game_start_now 0 $chan] } } elseif {$next_sum == 100} { stairs_slides:winner $id $chan $next_sum $value } elseif {$next_sum > 100} { if {$stairs(dice_number) == 1} { stairs_slides:say [list $nick $ivalue $ivalue] $nick $chan 17 0 } else { stairs_slides:say [list $nick $ivalue $sum] $nick $chan 16 0 } set dif [expr $next_sum - 100] set down [expr 100 - $dif] set seconds 7 stairs_slides:getback $search $chan $down $dif $next_sum set future_stairs_slides [stairs_slides:future_stairs_slides $id $nick $down $chan] if {$future_stairs_slides == 1} { set seconds [expr $seconds + 2] } incr current_pos if {[lindex $stairs_slides(players:$chan) $current_pos] != ""} { utimer $seconds [list stairs_slides:game_start_now $current_pos $chan] } else { utimer $seconds [list stairs_slides:game_start_now 0 $chan] } } } } ### proc stairs_slides:winner {id chan pos value} { global stairs_slides stairs botnick set broke_fastest 0 set usertime [stairs_slides:get_times $id $chan] set stairs_slides(game_won:$chan) 1 set stairs_slides(game_end_time:$chan) [unixtime] set nick [stairs_slides:get $chan $id 0] set hostname [stairs_slides:get $chan $id 1] set gametime [expr $stairs_slides(game_end_time:$chan) - $stairs_slides(game_start_time:$chan)] if {[isbotnick $nick]} { stairs_slides:save $chan $hostname $nick 1 0 $gametime } else { set broke_fastest [stairs_slides:fastest $usertime $chan] stairs_slides:save $chan $hostname $nick 1 $usertime $gametime } set dices [stairs_slides:get_dices $id $chan] set gametime [stairs_slides:time_return $gametime] set totaldices $stairs_slides(total_dices:$chan) if {$stairs(dice_number) == 1} { set values "$value [stairs_slides:special_text [stairs_slides:dice_image $value]]" } else { foreach v $value { set i [stairs_slides:special_text [stairs_slides:dice_image $v]] lappend values "$v $i" } set values [join $values] } stairs_slides:say [list $nick $values] $nick $chan 23 0 if {$broke_fastest == 1} { stairs_slides:say [list $nick] $nick $chan 48 0 } stairs_slides:say [list $nick $dices] $nick $chan 34 0 stairs_slides:say [list $totaldices $gametime] $nick $chan 4 0 stairs_slides:unset $chan } ### proc stairs_slides:getback {pos chan next dif last} { global stairs_slides stairs set entry [lindex $stairs_slides(positions:$chan) $pos] set id [lindex $entry 0] set nick [stairs_slides:get $chan $id 0] set stairs_num [stairs_slides:get_stair_slide $id $chan 0] set slides_num [stairs_slides:get_stair_slide $id $chan 1] set stairs_slides(positions:$chan) [lreplace $stairs_slides(positions:$chan) $pos $pos] lappend stairs_slides(positions:$chan) [list $id $next] stairs_slides:say [list $nick $dif $last $next] $nick $chan 21 0 stairs_slides:say [list $nick $next $stairs_num $slides_num] $nick $chan 19 0 } ### proc stairs_slides:future_stairs_slides {id nick pos chan} { global stairs_slides stairs if {$stairs(dice_number) == 1} { set future_places 6 } else { set future_places 12 } set counter 0 set stairs_list "" set slides_list "" for {set i 1} {$i <= 100} {incr i} { if {$i > $pos} { incr counter set check_stair_slide [stairs_slides:check $i] set status [lindex $check_stair_slide 0] set jump_to [lindex $check_stair_slide 1] if {$status == 0} { lappend stairs_list [list \002$i\002 [stairs_slides:special_text "&#8594;"] $jump_to[stairs_slides:special_text "&#8593;"]] } elseif {$status == 1} { lappend slides_list [list \002$i\002 [stairs_slides:special_text "&#8594;"] $jump_to[stairs_slides:special_text "&#8595;"]] } if {$counter == $future_places} { break } } } if {$stairs_list == "" && $slides_list == ""} { return 0 } elseif {$slides_list != "" && $stairs_list == ""} { set status [stairs_slides:last_future_stairs_slides $id $chan $slides_list] set slides_list [join $slides_list ", "] if {$status == 1} { stairs_slides:say [list $nick $slides_list] "" $chan 28 0 } } elseif {$stairs_list != "" && $slides_list == ""} { set status [stairs_slides:last_future_stairs_slides $id $chan $stairs_list] set stairs_list [join $stairs_list ", "] if {$status == 1} { stairs_slides:say [list $nick $stairs_list] "" $chan 29 0 } } else { set stairs_list [join $stairs_list ", "] set slides_list [join $slides_list ", "] lappend text $stairs_list lappend text $slides_list set status [stairs_slides:last_future_stairs_slides $id $chan $text] set text [join $text ", "] if {$status == 1} { stairs_slides:say [list $nick $text] "" $chan 30 0 } } return 1 } ### proc stairs_slides:last_future_stairs_slides {id chan text} { global stairs_slides stairs if {![info exists stairs_slides(future_stairs_slides:$chan)]} { lappend stairs_slides(future_stairs_slides:$chan) [list $id $text] return 1 } else { set search [lsearch $stairs_slides(future_stairs_slides:$chan) [list $id "*"]] if {$search > -1} { set entry [lindex $stairs_slides(future_stairs_slides:$chan) $search] set read_text [lindex $entry 1] if {![string equal -nocase $text $read_text]} { set stairs_slides(future_stairs_slides:$chan) [lreplace $stairs_slides(future_stairs_slides:$chan) $search $search] lappend stairs_slides(future_stairs_slides:$chan) [list $id $text] return 1 } else { return 0 } } else { lappend stairs_slides(future_stairs_slides:$chan) [list $id $text] return 1 } } } ### proc stairs_slides:advance:pos {pos chan places last_place} { global stairs_slides stairs set entry [lindex $stairs_slides(positions:$chan) $pos] set id [lindex $entry 0] set stairs_slides(positions:$chan) [lreplace $stairs_slides(positions:$chan) $pos $pos] set check_stair_slide [stairs_slides:check $places] set status [lindex $check_stair_slide 0] set nick [stairs_slides:get $chan $id 0] set jump_to [lindex $check_stair_slide 1] set stairs_num [stairs_slides:get_stair_slide $id $chan 0] set slides_num [stairs_slides:get_stair_slide $id $chan 1] switch $status { 0 { set stairs_num [stairs_slides:add_stair_slide $id $chan 0] stairs_slides:say [list $nick $places $jump_to] $nick $chan 18 0 } 1 { set slides_num [stairs_slides:add_stair_slide $id $chan 1] stairs_slides:say [list $nick $places $jump_to] $nick $chan 20 0 } } if {$status != "-1"} { stairs_slides:say [list $nick $jump_to $stairs_num $slides_num] $nick $chan 19 0 lappend stairs_slides(positions:$chan) [list $id $jump_to] } else { stairs_slides:say [list $nick $places $stairs_num $slides_num] $nick $chan 19 0 lappend stairs_slides(positions:$chan) [list $id $places] } if {$status != "-1"} { return [list $status $jump_to] } else { return $status } } ### proc stairs_slides:time_return {get_time} { global stairs_slides stairs if {$get_time == "0" || $get_time == ""} { return "N/A" } set days [expr $get_time/86400] set hours [expr [expr $get_time/3600] % 24]; set minutes [expr [expr $get_time / 60] % 60] set seconds [expr $get_time % 60] if {$days == "0"} { if {$hours == "0"} { if {$minutes > 0} { return "${minutes}m:${seconds}s" } else { return "${seconds}s" } } else { if {$minutes > 0} { return "${hours}h:${minutes}m" } else { return "${hours}h" } } } else { if {$hours > 0} { return "${days}d:${hours}h" } else { return "${days}d" } } } ### proc stairs_slides:get_stair_slide {id chan type} { global stairs_slides stairs if {![info exists stairs_slides(stairs_slide:$chan)]} { return 0 } set search [lsearch $stairs_slides(stairs_slide:$chan) [list $id $type "*"]] if {$search < 0} { return 0 } set entry [lindex $stairs_slides(stairs_slide:$chan) $search] set last_num [lindex $entry 2] return $last_num } ### proc stairs_slides:add_stair_slide {id chan type} { global stairs_slides stairs if {![info exists stairs_slides(stairs_slide:$chan)]} { lappend stairs_slides(stairs_slide:$chan) [list $id $type 1] return 1 } else { set search [lsearch $stairs_slides(stairs_slide:$chan) [list $id $type "*"]] if {$search > -1} { set entry [lindex $stairs_slides(stairs_slide:$chan) $search] set last_num [lindex $entry 2] incr last_num set stairs_slides(stairs_slide:$chan) [lreplace $stairs_slides(stairs_slide:$chan) $search $search] lappend stairs_slides(stairs_slide:$chan) [list $id $type $last_num] return $last_num } else { lappend stairs_slides(stairs_slide:$chan) [list $id $type 1] return 1 } } } ### proc stairs_slides:check {pos} { global stairs_slides stairs set llength_patters [llength $stairs(num_patterns)] set rand_pattern [lindex $stairs(num_patterns) [rand $llength_patters]] set search_stair [lsearch $rand_pattern "${pos}+*"] if {$search_stair > -1} { set return [lindex $rand_pattern $search_stair] set split_return [split $return "+"] set where [lindex $split_return 1] return [list 0 $where] } set search_slide [lsearch $rand_pattern "${pos}-*"] if {$search_slide > -1} { set return [lindex $rand_pattern $search_slide] set split_return [split $return "-"] set where [lindex $split_return 1] return [list 1 $where] } return "-1" } ### proc stairs_slides:players {chan} { global stairs_slides stairs set nicknames "" foreach entry $stairs_slides(players:$chan) { set nickname [lindex $entry 0] lappend nicknames $nickname } return [join $nicknames ", "] } ### proc stairs_slides:join {nick host hand chan arg} { global stairs_slides stairs if {![channel get $chan stairs]} { return } if {![info exists stairs_slides(game_start:$chan)]} {return} if {![info exists stairs_slides(game_join:$chan)] && $stairs(game_after_join) == 0} { return } if {[info exists stairs_slides(game_won:$chan)]} {return} set hostname [stairs_slides:host_return $stairs(user_host_type) $nick [getchanhost $nick $chan]] set id [stairs_slides:id $chan] if {![info exists stairs_slides(players:$chan)]} { lappend stairs_slides(players:$chan) [list $nick $hostname $id] stairs_slides:say [list $nick] $nick $chan 5 0 } else { set search [lsearch $stairs_slides(players:$chan) [list "*" $hostname "*"]] if {$search > -1} { stairs_slides:say "" $nick $chan 3 1 return } set players_num [llength $stairs_slides(players:$chan)] if {$stairs(dice_number) == 1} { if {$players_num == 6} { stairs_slides:say [list $nick] $nick $chan 26 0 return } } else { if {$players_num == 12} { stairs_slides:say [list $nick] $nick $chan 26 0 return } } lappend stairs_slides(players:$chan) [list $nick $hostname $id] stairs_slides:say "" $nick $chan 4 1 stairs_slides:say [list $nick] $nick $chan 5 0 } if {[info exists stairs_slides(autostart_num:$chan)]} { unset stairs_slides(autostart_num:$chan) } } ### proc stairs_slides:id {chan} { global stairs_slides if {![info exists stairs_slides(players:$chan)]} { return 1 } set numbers "" set current_num 0 set found_it 0 foreach entry $stairs_slides(players:$chan) { set num [lindex $entry 2] lappend numbers $num } while {$found_it == 0} { incr current_num if {[lsearch $numbers $current_num] < 0} { set found_it 1 } } return $current_num } ### proc stairs_slides:get {chan id type} { global stairs_slides if {![info exists stairs_slides(players:$chan)]} { return 0 } set return "" foreach entry $stairs_slides(players:$chan) { set nick [lindex $entry 0] set hostname [lindex $entry 1] set num [lindex $entry 2] if {[string equal $id $num]} { if {$type == 0} { set return $nick break } elseif {$type == 1} {set return $hostname ; break} } } return $return } ### proc stairs_slides:say {text nick chan num type} { global stairs_slides stairs set lang [channel get $chan stairs_lang] if {$lang == ""} { set lang [string tolower $stairs(default_lang)] } set counter 0 set replace(%chan%) $chan foreach t $text { incr counter set replace(%msg.$counter%) $t } if {$type == 1} { putserv "NOTICE $nick :[string map [array get replace] $stairs($lang.lang.$num)]" } else { set text [string map [array get replace] $stairs($lang.lang.$num)] foreach t [stairs_slides:wordwrap $text 400] { putserv "PRIVMSG $chan :$t" } } } ### proc stairs_slides:host_return {type user host} { global stairs set ident [lindex [split $host "@"] 0] set uhost [lindex [split $host @] 1] set check_webchat [stairs_slides:check_webchat $host] if {$check_webchat == "1"} { set type 5 } switch $type { 1 { return "*!*@$uhost" } 2 { return "*!$ident@$uhost" } 3 { return "$user!$ident@$uhost" } 4 { return "$user!*@*" } 5 { return "*!$ident@*" } } } ### proc stairs_slides:check_webchat {host} { global stairs set webchat_found 0 set host "*!$host" foreach h $stairs(webchat_hosts) { if {[string match -nocase $h $host]} { set webchat_found 1 break } } return $webchat_found } ### proc stairs_slides:dice_image {num} { global stairs_slides stairs switch $num { 1 { return "&#9856;" } 2 { return "&#9857;" } 3 { return "&#9858;" } 4 { return "&#9859;" } 5 { return "&#9860;" } 6 { return "&#9861;" } } } proc stairs_slides:changenick {nick host hand chan newnick} { global stairs_slides stairs if {![channel get $chan stairs]} { return } if {![info exists stairs_slides(game_start:$chan)]} { return } if {![info exists stairs_slides(players:$chan)]} { return } set hostname [stairs_slides:host_return $stairs(user_host_type) $nick [getchanhost $nick $chan]] set search [lsearch $stairs_slides(players:$chan) [list "*" $hostname "*"]] if {$search > -1} { set id [lindex [lindex $stairs_slides(players:$chan) $search] 2] set stairs_slides(players:$chan) [lreplace $stairs_slides(players:$chan) $search $search] set stairs_slides(players:$chan) [linsert $stairs_slides(players:$chan) $search [list $newnick $hostname $id]] } } ### proc stairs_slides:wordwrap {str {len 100} {splitChr { }}} { set out [set cur {}]; set i 0 foreach word [split [set str][unset str] $splitChr] { if {[incr i [string len $word]]>$len} { lappend out [join $cur $splitChr] set cur [list $word] set i [string len $word] } { lappend cur $word } incr i } lappend out [join $cur $splitChr] } ### proc stairs_slides:special_text {string} { global stairs_slides stairs set map {} foreach {entity number} [regexp -all -inline {&#(\d+);} $string] { lappend map $entity [format \\u%04x [scan $number %d]] } set string [string map [subst -nocomm -novar $map] $string] return $string } ### proc stairs_slides:flood:prot {host chan} { global stairs_slides stairs set number [scan $stairs(flood_prot) %\[^:\]] set timer [scan $stairs(flood_prot) %*\[^:\]:%s] if {[info exists stairs_slides(flood:$host:$chan:act)]} { return 1 } foreach tmr [utimers] { if {[string match "*stairs_slides:remove:flood $host $chan*" [join [lindex $tmr 1]]]} { killutimer [lindex $tmr 2] } } if {![info exists stairs_slides(flood:$host:$chan)]} { set stairs_slides(flood:$host:$chan) 0 } incr stairs_slides(flood:$host:$chan) utimer $timer [list stairs_slides:remove:flood $host $chan] if {$stairs_slides(flood:$host:$chan) > $number} { set stairs_slides(flood:$host:$chan:act) 1 utimer [expr $stairs(ignore_prot) * 60] [list stairs_slides:expire:flood $host $chan] return 1 } else { return 0 } } ### set stairs(projectName) "StairsAndSlides" set stairs(author) "BLaCkShaDoW" set stairs(website) "wWw.TCLScriptS.NeT" set stairs(version) "v1.0" ### proc stairs_slides:remove:flood {host chan} { global stairs_slides if {[info exists stairs_slides(flood:$host:$chan)]} { unset stairs_slides(flood:$host:$chan) } } ### proc stairs_slides:expire:flood {host chan} { global stairs_slides if {[info exists stairs_slides(flood:$host:$chan:act)]} { unset stairs_slides(flood:$host:$chan:act) } } ## #Language # English set stairs(en.lang.1) "\[ \002S\002tairs and \002S\002lides \] You have \002${stairs(seconds_wait)}s\002 to \002${stairs(default_char)}join\002" set stairs(en.lang.2) "\[ \002S\002tairs and \002S\002lides \] already started.." set stairs(en.lang.3) "You already joined \[ \002S\002tairs and \002S\002lides \]" set stairs(en.lang.4) "\[ \002S\002tairs & \002S\002lides \] total \002%msg.1%\002 rolled dice in \002%msg.2%\002" set stairs(en.lang.5) "\002%msg.1%\002 joins \[\002S\002tairs and \002S\002lides \]" set stairs(en.lang.6) "no players, game stopped." set stairs(en.lang.7) "not enough players, next game in \002${stairs(auto_starts_time)}s\002" set stairs(en.lang.8) "no players, next game in \002${stairs(auto_starts_time)}s\002" set stairs(en.lang.9) "\002%msg.1%\002 players this round: %msg.2%" set stairs(en.lang.10) "\[\002S\002tairs and \002S\002lides \] First dice is on the house! \002Auto dice\002 results: %msg.1%" set stairs(en.lang.11) "not enough players, game stopped." set stairs(en.lang.12) "play continues with \002%msg.1%\002. You have \002${stairs(dice_wait)}s\002 to use \002${stairs(default_char)}dice\002 and show your dice talent." set stairs(en.lang.13) "\002%msg.1%\002 idles and is skipped." set stairs(en.lang.14) "\002%msg.1%\002 has been idle \002$stairs(dice_forget)\002 times in a row and is removed from game." set stairs(en.lang.15) "no players, no winner... recycling" set stairs(en.lang.16) "\002%msg.1%\002 throws the dices..and the luck shows : %msg.2%. That means that %msg.1% advances \002%msg.3%\002 places." set stairs(en.lang.17) "\002%msg.1%\002 throws the dice..and the luck shows : %msg.2%. That means that %msg.1% advances \002%msg.3%\002 places." set stairs(en.lang.18) "Hurray ! it seems that the luck is with \002%msg.1%\002. He stepped on place nr. %msg.2% and encounter a \002stair\002 that jumps him directly to place nr. \002%msg.3%\002" set stairs(en.lang.19) "Current place for you %msg.1% --- \002%msg.2%\002 \[STAIRS: %msg.3% ; SLIDES: %msg.4%\]" set stairs(en.lang.20) "Oh not :\( ! bad luck for \002%msg.1%\002. He stepped on place nr. \002%msg.2%\002 and encounter a \002slide\002 that takes him down directly to place nr. \002%msg.3%\002" set stairs(en.lang.21) "Sorry for \002%msg.1%\002, he passed over \002100\002 with (%msg.2% positions) at \002%msg.3%\002 so now is going back to place nr. \002%msg.4%\002." set stairs(en.lang.22) "Welcome to \[ \002S\002tairs and \002S\002lides \] \[Difficulty mode: %msg.1%\]" set stairs(en.lang.23) "\002%msg.1%\002 rolls %msg.2% and wins \[ \002S\002tairs and \002S\002lides \]" set stairs(en.lang.24) "Just \002%msg.1%\002 joined. Play with me ? Answer \002yes\002. %msg.2% seconds remaining." set stairs(en.lang.25) "\002%msg.1%\002 left the channel and is removed from \[ \002S\002tairs and \002S\002lides \]" set stairs(en.lang.26) "players reached... try next round, \002%msg.1%\002" set stairs(en.lang.27) "\002%msg.1%\002 plays first. You have %msg.2% seconds to use \002$stairs(default_char)dice\002 to show your dice talent." set stairs(en.lang.28) "Better be carefull \002%msg.1%\002, it looks like that you have ahead some \002slides\002: %msg.2%" set stairs(en.lang.29) "Your future sounds good \002%msg.1%\002, it looks like that you have ahead some \002stairs\002: %msg.2%" set stairs(en.lang.30) "Mixed feelings about your future \002%msg.1%\002, it looks like that you have ahead some \002stairs\002 and \002slides\002: %msg.2%" set stairs(en.lang.31) "\[ \002S\002tairs and \002S\002lides \] by \002TCL\002scriptS.NeT" set stairs(en.lang.32) "easy" set stairs(en.lang.33) "hard" set stairs(en.lang.34) "\[ \002S\002tairs & \002S\002lides \] \002%msg.1%\002 wins with \002%msg.2%\002 rolled dice" set stairs(en.lang.35) "\002%msg.1%\002 \[%msg.2%\] (wins: \002%msg.3%\002 ; fastest win: \002%msg.4%\002 ; longest: \002%msg.5%\002) ; time wasted: \002%msg.6%\002" set stairs(en.lang.36) "no stats about \002%msg.1%\002." set stairs(en.lang.37) "wins" set stairs(en.lang.38) "TOP \002%msg.1%\002: %msg.2%" set stairs(en.lang.39) "no users in TOP\002%msg.1%\002" set stairs(en.lang.40) "no stats about place number \002\#%msg.1%\002." set stairs(en.lang.41) "Language %msg.1% doesnt exists." set stairs(en.lang.42) "Set language \002%msg.1%\002 as default." set stairs(en.lang.43) "Use \002$stairs(default_char)\002stairs \002lang\002 <lang>" set stairs(en.lang.44) "Use as difficulty modes \002easy\002 sau \002hard\002" set stairs(en.lang.45) "Set as difficulty mode \002%msg.1%\002." set stairs(en.lang.46) "Use \002$stairs(default_char)\002stairs \002difficulty\002 <easy>/<hard>" set stairs(en.lang.47) "HELP: \002$stairs(default_char)stairs\002 - starts game ; \002$stairs(default_char)dice\002 - throw the dice ; \002$stairs(default_char)topXX\002 \[fastest/longest\] - show the top (ex \002$stairs(default_char)top10\002) ; \002$stairs(default_char)sstat\002 <nick/\#> (view stats for a <nick> or place)" set stairs(en.lang.48) "\002%msg.1%\002 broke the \002Fast Win Record\002" set stairs(en.lang.49) "game stopped." set stairs(ro.lang.1) "\[ \002S\002erpi si \002S\002cari \] Ai la dispozitie \002${stairs(seconds_wait)}s\002 sa te inscrii cu \002${stairs(default_char)}join\002" set stairs(ro.lang.2) "\[ \002S\002erpi si \002S\002cari \] a pornit deja.." set stairs(ro.lang.3) "Te-ai inscris deja in \[ \002S\002erpi si \002S\002cari \]." set stairs(ro.lang.4) "\[ \002S\002erpi si \002S\002cari \] \002%msg.1%\002 zaruri aruncate in \002%msg.2%\002" set stairs(ro.lang.5) "\002%msg.1%\002 se alatura \[ \002S\002erpi si \002S\002cari \]" set stairs(ro.lang.6) "nu sunt jucatori, joc oprit." set stairs(ro.lang.7) "nu sunt destui jucatori, urmatorul joc in \002${stairs(auto_starts_time)}s\002" set stairs(ro.lang.8) "nu sunt jucatori, urmatorul joc in ${stairs(auto_starts_time)}s" set stairs(ro.lang.9) "\002%msg.1%\002 jucatori prezenti: %msg.2%" set stairs(ro.lang.10) "\[ \002S\002erpi si \002S\002cari \] Primele aruncari din partea casei ! Rezultate \002zaruri\002: %msg.1%" set stairs(ro.lang.11) "nu sunt destui jucatori, joc oprit." set stairs(ro.lang.12) "jocul continua cu \002%msg.1%\002. Ai la dispozitie \002${stairs(dice_wait)}s\002 sa folosesti \002${stairs(default_char)}dice\002 pentru a ne arata talentul." set stairs(ro.lang.13) "\002%msg.1%\002 intarzie si este sarit." set stairs(ro.lang.14) "\002%msg.1%\002 a intarziat de \002$stairs(dice_forget)\002 ori la rand si este scos din joc." set stairs(ro.lang.15) "nu sunt destui jucatori, niciun jucator... reincerc" set stairs(ro.lang.16) "\002%msg.1%\002 arunca zarurile..si norocul arata : %msg.2%. Asta inseamna ca %msg.1% avanseaza \002%msg.3%\002 locuri." set stairs(ro.lang.17) "\002%msg.1%\002 arunca zarul..si norocul arata : %msg.2%. Asta inseamna ca %msg.1% avanseaza \002%msg.3%\002 locuri." set stairs(ro.lang.18) "Fericire mare ! se pare ca norocul este cu \002%msg.1%\002. A picat pe locul nr. \002%msg.2%\002 unde a gasit o \002scara\002 care il duce direct la locul nr. \002%msg.3%\002" set stairs(ro.lang.19) "Locul curent pentru %msg.1% --- \002%msg.2%\002 \[SCARI: %msg.3% ; SERPI: %msg.4%\]" set stairs(ro.lang.20) "Oh nu :\( ! ghinion pentru \002%msg.1%\002. A picat pe locul nr. %msg.2% unde a gasit un \002sarpe\002 care l-a speriat si l-a trimis in spate la locul nr. \002%msg.3%\002" set stairs(ro.lang.21) "Imi pare rau pentru \002%msg.1%\002, a trecut peste \002100\002 cu (%msg.2% locuri) la \002%msg.3%\002 si acum e trimis in spate la locul nr. \002%msg.4%\002." set stairs(ro.lang.22) "Bine ati venit la \[ \002S\002erpi si \002S\002cari \] \[Mod dificultate: %msg.1%\]" set stairs(ro.lang.23) "\002%msg.1%\002 arunca %msg.2% si castiga \[ \002S\002erpi si \002S\002cari \]" set stairs(ro.lang.24) "Doar \002%msg.1%\002 s-a alaturat. Vrei sa te joci cu mine ? Raspunde cu \002yes\002. Ai %msg.2%s la dispozitie." set stairs(ro.lang.25) "\002%msg.1%\002 a parasit canalul si este scos din jocul \[ \002S\002tairs and \002S\002lides \]" set stairs(ro.lang.26) "toate locurile ocupate... incearca urmatorul joc, \002%msg.1%\002" set stairs(ro.lang.27) "\002%msg.1%\002 arunca primul. Ai la dispozitie %msg.2%s sa folosesti \002$stairs(default_char)dice\002 pentru a ne arata talentul." set stairs(ro.lang.28) "Ai grija \002%msg.1%\002, se pare ca ai in fata cativa \002serpi\002: %msg.2%" set stairs(ro.lang.29) "Viitorul suna bine \002%msg.1%\002, se pare ca ai in fata cateva \002scari\002: %msg.2%" set stairs(ro.lang.30) "Sentimente mixe pentru \002%msg.1%\002, se pare ca ai in fata cateva \002scari\002 si cativa \002serpi\002: %msg.2%" set stairs(ro.lang.31) "\[ \002S\002erpi si \002S\002cari \] de \002TCL\002scriptS.NeT" set stairs(ro.lang.32) "usor" set stairs(ro.lang.33) "greu" set stairs(ro.lang.34) "\[ \002S\002erpi si \002S\002cari \] \002%msg.1%\002 castiga cu \002%msg.2%\002 zaruri aruncate" set stairs(ro.lang.35) "\002%msg.1%\002 \[%msg.2%\] (castiguri: \002%msg.3%\002 ; cel mai scurt castig: \002%msg.4%\002 ; cel mai lung: \002%msg.5%\002) ; timp jucat: \002%msg.6%\002" set stairs(ro.lang.36) "nu sunt statistici pentru \002%msg.1%\002." set stairs(ro.lang.37) "castig." set stairs(ro.lang.38) "TOP \002%msg.1%\002: %msg.2%" set stairs(ro.lang.39) "nu sunt useri in TOP\002%msg.1%\002" set stairs(ro.lang.40) "nu sunt statistici pentru locul \002\#%msg.1%\002." set stairs(ro.lang.41) "Limba \002%msg.1%\002 nu exista." set stairs(ro.lang.42) "Am setat limba \002%msg.1%\002 ca fiind cea standard." set stairs(ro.lang.43) "Foloseste \002$stairs(default_char)\002stairs \002lang\002 <lang>" set stairs(ro.lang.44) "Foloseste ca moduri de dificultate \002easy\002 sau \002hard\002" set stairs(ro.lang.45) "Am setat mod de dificultate \002%msg.1%\002." set stairs(ro.lang.46) "Foloseste \002$stairs(default_char)\002stairs \002difficulty\002 <easy>/<hard>" set stairs(ro.lang.47) "AJUTOR: \002$stairs(default_char)stairs\002 - porneste jocul ; \002$stairs(default_char)dice\002 - arunca zarurile ; \002$stairs(default_char)topXX\002 \[fastest/longest\] - arata topul (ex \002$stairs(default_char)top10\002) ; \002$stairs(default_char)sstat\002 <nick/\#> (vizualizare statisici pentru <nick> sau loc)" set stairs(ro.lang.48) "\002%msg.1%\002 a depasit recordul de \002Cel mai rapid castig\002" set stairs(ro.lang.49) "joc oprit." putlog "\002$stairs(projectName) $stairs(version)\002 coded by $stairs(author) ($stairs(website)): Loaded.." ############## ########################################################## ## END # ##########################################################  

    1 download

       (0 reviews)

    0 comments

    Updated

  21. Free

    beer.tcl

    # beer.tcl # # This script gives a beer to people with the !beer command. # # Usage: # !beer give a beer to yourself # !beer <user> give a beer to <user> # # Enable for a channel with: .chanset #channel +beer # Disable for a channel with: .chanset #channel -beer # # See https://github.com/hwipl/eggdrop-scripts for the latest version and # additional information including the license (MIT). # tested versions, might run on earlier versions package require Tcl 8.6 package require eggdrop 1.8.4 namespace eval ::beer { # channel flag for enabling/disabling setudef flag beer } proc ::beer::give_beer { nick host hand chan arg } { # check channel flag if enabled in this channel if {![channel get $chan beer]} { return 0 } # set receiver set receiver $nick if { $arg != "" } { set receiver [lindex $arg 0] } puthelp "PRIVMSG $chan :\001ACTION gives $receiver an ice cold beer." return 1 } namespace eval ::beer { bind pub - !beer ::beer::give_beer putlog "Loaded beer.tcl" }  

    2 downloads

       (0 reviews)

    0 comments

    Updated

  22. Free

    funwar.tcl

    # funwar.tcl # # This script was created to post fun clan wars/matches for the two multiplayer # games RTCW and ET in channels periodically and with the commands below. The # matches are retrieved from tables in postreSQL databases. # # Usage: # !et post ET matches # !rtcw post RTCW matches # !funwars post ET and RTCW matches # # Enable for a channel with: .chanset #channel +funwar # Disable for a channel with: .chanset #channel -funwar # # See https://github.com/hwipl/eggdrop-scripts for the latest version and # additional information including the license (MIT). # tested versions, might run on earlier versions package require Tcl 8.6 package require eggdrop 1.8.4 # postgres sql package require tdbc::postgres namespace eval ::funwar { # channel flag for enabling/disabling setudef flag funwar # sql server address, username and password variable sqlServer "eggdroppostgres" variable sqlUser "eggdrop" variable sqlPassword "eggdropPassword" # ET database and table on sql server variable sqlDbnameEt "postgres" variable sqlTblnameEt "test.funmatch" # RTCW database and table on sql server variable sqlDbnameRtcw "postgres" variable sqlTblnameRtcw "test.funmatch" # crontab style definition of how often funwars are posted in channels # format: # "MIN HOUR DAY MONTH YEAR" # examples: # "20,50 * * * *" post at minute 20 and 50 of every hour # "*/10 * * * *" post every ten minutes variable autoCron "20,50 * * * *" # trigger configuration for ET, RTCW and both variable triggerEt "!et" variable triggerRtcw "!rtcw" variable triggerBoth "!funwars" # output configuration variable outputHeader "*** Funwars: ***" variable outputHeader2 "Game: Date/Time: XonX: Clantag: IRC:" variable outputFooter "*** end of funwars list ***" } # post the funwar header in the channel proc ::funwar::postHeader {chan} { variable outputHeader variable outputHeader2 set fmt "%-7s %-20s %-6s %-12s %-12s" set lineHeader [format $fmt {*}$outputHeader2] puthelp "PRIVMSG $chan :$outputHeader" puthelp "PRIVMSG $chan :$lineHeader" } # post a funwar line in the channel proc ::funwar::post {game id date time xonx clantag irc www server org chan } { set fmt "%-7s %-20s %-6s %-12s %-12s" set outputBody [format $fmt $game $date/$time $xonx $clantag $irc] puthelp "PRIVMSG $chan :$outputBody" } # post the funwar footer in the channel proc ::funwar::postFooter {chan} { variable outputFooter puthelp "PRIVMSG $chan :$outputFooter" } # get rows from sql table proc ::funwar::sqlGet {server user password dbname tblname order limit} { # connect to data base # add -sslmode require if you want to enforce ssl tdbc::postgres::connection create db -host $server -database $dbname \ -user $user -password $password # query table in data base set columns "id,date,time,xonx,clantag,irc,www,server,org" set top "FETCH FIRST $limit ROWS ONLY" set queryStr "SELECT $columns FROM $tblname ORDER BY $order DESC $top" set query [db prepare $queryStr] # collect all rows and return them set rows "" $query foreach row { lappend rows $row } $query close db close return $rows } # query db, parse everything and post in channels proc ::funwar::sqlParsedb {server user password dbname tblname order chan \ game limit command} { # query rows from table in database set rows [sqlGet $server $user $password $dbname $tblname $order \ $limit] if {$rows == ""} { return } if { $command != "noheader" } { # post header in every given channel foreach channel $chan { postHeader $channel } } # parse earch row and post them in channels foreach row $rows { set id [dict get $row id] set date [dict get $row date] set time [dict get $row time] set xonx [dict get $row xonx] set clantag [dict get $row clantag] set irc [dict get $row irc] set www [dict get $row www] set server [dict get $row server] set org [dict get $row org] foreach channel $chan { # post row in every given channel post $game $id $date $time $xonx $clantag $irc $www \ $server $org $channel } } if { $command != "nofooter" } { # post footer in every given channel foreach channel $chan { postFooter $channel } } } # helper for posting rtcw entries proc ::funwar::postRtcw {chan limit command} { variable sqlServer variable sqlUser variable sqlPassword variable sqlDbnameRtcw variable sqlTblnameRtcw set order "id" set game "RTCW" sqlParsedb $sqlServer $sqlUser $sqlPassword $sqlDbnameRtcw \ $sqlTblnameRtcw $order $chan $game $limit $command } # helper for posting et entries proc ::funwar::postEt {chan limit command} { variable sqlServer variable sqlUser variable sqlPassword variable sqlDbnameEt variable sqlTblnameEt set order "id" set game "ET" sqlParsedb $sqlServer $sqlUser $sqlPassword $sqlDbnameEt \ $sqlTblnameEt $order $chan $game $limit $command } # handle the !rtcw trigger proc ::funwar::rtcw { nick host hand chan arg } { # check channel flag if enabled in this channel if {![channel get $chan funwar]} { return 0 } set limit "10" set command "" postRtcw $chan $limit $command return 1 } # handle the !et trigger proc ::funwar::et { nick host hand chan arg } { # check channel flag if enabled in this channel if {![channel get $chan funwar]} { return 0 } set limit "10" set command "" postEt $chan $limit $command return 1 } # handle the !funwars trigger proc ::funwar::both { nick host hand chan arg } { # check channel flag if enabled in this channel if {![channel get $chan funwar]} { return 0 } set limit "3" set command "nofooter" postRtcw $chan $limit $command set command "noheader" postEt $chan $limit $command return 1 } # handle cron auto posting proc ::funwar::auto { min hour day month year } { # determine list of channels to post in based on channel flag set autoChannels "" foreach botChan [channels] { # only use channels the bot is on and have the flag enabled if {![botonchan $botChan] || ![channel get $botChan funwar]} { continue } lappend autoChannels $botChan } if {$autoChannels == ""} { # no channels to post in return } set limit "3" set command "nofooter" postRtcw $autoChannels $limit $command set command "noheader" postEt $autoChannels $limit $command } namespace eval ::funwar { bind pub - $triggerEt ::funwar::et bind pub - $triggerRtcw ::funwar::rtcw bind pub - $triggerBoth ::funwar::both bind cron - $autoCron ::funwar::auto putlog "Loaded funwars.tcl" }  

    1 download

       (0 reviews)

    0 comments

    Updated

  23. Free

    match.tcl

    # match.tcl # # This script was originally created to save clan matches in a file, # to show all the saved matches and to be able to remove them from # the file again. But it could be used for storing, showing and # deleting arbitrary lines of text in a file. # # Usage: # !addmatch match add match to the file/list. # !showmatch show the saved matches. # !delmatch number remove match with number (as shown # by !showmatch) from the file/list. # The numbers of remaining matches # might change. # # The command names can be changed in the config section below. # # Enable for a channel with: .chanset #channel +match # Disable for a channel with: .chanset #channel -match # # See https://github.com/hwipl/eggdrop-scripts for the latest version and # additional information including the license (MIT). # tested versions, might run on earlier versions package require Tcl 8.6 package require eggdrop 1.8.4 # Config: namespace eval ::match { # channel flag for enabling/disabling setudef flag match # Name and/or path of the file you want to store the matches in and its # backup file. Channel name will be prepended to file name variable filename "matches.lst" variable filenamebak "matches.lst.bak" # Names of the commands for adding, deleting and showing variable addcommand "!addmatch" variable delcommand "!delmatch" variable showcommand "!showmatch" } # End of Config # this procedure shows the saved matches: proc ::match::show {nick host hand chan arg} { variable filename # check channel flag if enabled in this channel if {![channel get $chan match]} { return 0 } # check if file exists and contains matches set mfile ${chan}.${filename} set nomatches "No matches found." if {![file exists $mfile] || [file size $mfile] == 0} { puthelp "PRIVMSG $chan :$nomatches" return 0 } # read all matches from file if {[catch {open $mfile r} input]} { puthelp "PRIVMSG $nick :Error opening file: $input" return 0 } while {[gets $input line] >= 0} { lappend matches $line } close $input # show each match as a message in the channel puthelp "PRIVMSG $chan :*** Match List ***" for { set i 0 } { $i < [llength $matches] } { incr i } { puthelp "PRIVMSG $chan :([expr $i +1]) [lindex $matches $i]" } puthelp "PRIVMSG $chan :*** End of Match List ***" return 1 } # this procedure deletes saved matches: proc ::match::del {nick host hand chan arg} { variable filename variable filenamebak # check channel flag if enabled in this channel if {![channel get $chan match]} { return 0 } # arg containing the match id must be present if {$arg == ""} { return 0 } # check if file exists and contains matches set mfile ${chan}.${filename} set mfilebak ${chan}.${filenamebak} set noexist "Match does not exist." if {![file exists $mfile] || [file size $mfile] == 0} { puthelp "PRIVMSG $nick :$noexist" return 0 } # read all matches from file if {[catch {open $mfile r} input]} { puthelp "PRIVMSG $nick :Error opening file: $input" return 0 } while {[gets $input line] >= 0} { lappend matches $line } close $input # backup matches file file copy -force $mfile $mfilebak # write matches back to file if {[catch {open $mfile w} output]} { putshelp "PRIVMSG $nick :Error opening file: $output" return 0 } set deleted 0 for { set i 0 } { $i < [llength $matches] } { incr i } { # omit the match that should be deleted if {[expr $i +1] == $arg} { set deleted 1 continue } puts $output "[lindex $matches $i]" } close $output # send result back to caller if {$deleted == 0} { puthelp "PRIVMSG $nick :$noexist" return 0 } puthelp "NOTICE $nick :Match number $arg deleted." return 1 } # this procedure adds matches to the list: proc ::match::add {nick host hand chan arg} { variable filename # check channel flag if enabled in this channel if {![channel get $chan match]} { return 0 } # arg containing the match must be present if {$arg == ""} { return 0 } # write match to file set mfile ${chan}.${filename} if {[catch {open $mfile a} output]} { puthelp "PRIVMSG $nick :Error opening file: $output" return 0 } puts $output "$nick: $arg" close $output puthelp "NOTICE $nick :Match added." return 1 } namespace eval ::match { bind pub - $showcommand ::match::show bind pub - $addcommand ::match::add # bind pub o|o $delcommand ::match::del bind pub - $delcommand ::match::del putlog "Loaded match.tcl" }  

    1 download

       (0 reviews)

    0 comments

    Updated

  24. Free

    sysinfo.tcl

    Says the uptime of the machine and bot uptime of server connected.
     
    set pubtrig "!" # Set global|channel flags to trigger commands set sysflags o|m bind pub - ${pubtrig}uptime uptime:pub proc uptime:pub {nick uhost hand chan arg} { global uptime server sysflags if {([matchattr [nick2hand $nick] $sysflags]) && (![regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :\002S\002\037ystem\037: [eval exec uptime]" puthelp "PRIVMSG $chan :\002B\002\037ot\037 ($server): [duration [expr [unixtime] - $uptime]]" } else { if {([matchattr [nick2hand $nick] $sysflags]) && ([regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :System: [eval exec uptime]" puthelp "PRIVMSG $chan :Bot ($server): [duration [expr [unixtime] - $uptime]]" } } } bind pub - ${pubtrig}os osystem:pub proc osystem:pub {nick uhost hand chan arg} { global botnick sysflags if {([matchattr [nick2hand $nick] $sysflags]) && (![regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :\002O\002\037perating\037 \002S\002\037ystem\037: [eval exec uname] [eval exec uname -r]" } else { if {([matchattr [nick2hand $nick] $sysflags]) && ([regexp c [getchanmode $chan]])} { puthelp "PRIVMSG $chan :Operating System: [eval exec uname] [eval exec uname -r]" } } }  

    1 download

       (0 reviews)

    0 comments

    Updated

  25. Free

    autotalk.tcl

    Auto Speak in YOur Channel.

    2 downloads

       (0 reviews)

    0 comments

    Submitted

×
×
  • Create New...