Advertisement
Guest User

Slot test

a guest
Dec 21st, 2012
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 22.32 KB | None | 0 0
  1. #-----------------------------------------------------------------------------------#
  2. #                                                                                   #
  3. #                                                                                   #
  4. # Slot_Machine                                                                      #
  5. #                                                                                   #
  6. #                                                                                   #
  7. #                                                                                   #
  8. # Usage:                                                                            #
  9. #   Terminal: .chanset #channel +Slot_Machine                                       #
  10. #   Channel: !Slot_Machine Help                                                     #
  11. #                                                                                   #
  12. #                                                                                   #
  13. #                                                                                   #
  14. # TODO:                                                                             #
  15. #   - Multi Using                                                                   #
  16. #   - Message via: Channel, Query or. Notice                                        #
  17. #   - Multi Language                                                                #
  18. #                                                                                   #
  19. #                                                                                   #
  20. # ChangeLog:                                                                        #
  21. #   - MySQL                                                                         #
  22. #   - General Script                                                                #
  23. #                                                                                   #
  24. #                                                                                   #
  25. # Contakt:                                                                          #
  26. # Copyright (C) 2012, Diamond85                                                     #
  27. # E-Mail: Diamond85@gmx.de                                                          #
  28. #                                                                                   #
  29. #                                                                                   #
  30. #-----------------------------------------------------------------------------------#
  31.  
  32. namespace eval S_M {
  33.  
  34.  
  35.     #############################################################################
  36.     #                                                                           #
  37.     #                                                                           #
  38.     #                               Config_Begins                               #
  39.     #                                                                           #
  40.     #                                                                           #
  41.     #############################################################################
  42.  
  43.    
  44.     namespace eval G_S {
  45.     #############################################################################
  46.     #                             General_Settings                              #
  47.     #############################################################################
  48.  
  49.         # Set This To The Command Character You Want To Use
  50.         # For The Binds ( ! ? . . . )
  51.         variable gs_char "!"
  52.  
  53.         # Set These To Your Preferred Binds ( one two . . . )
  54.         variable gs_bind "Slot_Machine Slot SM"
  55.  
  56.         # (Number Of Seconds) To Ignore Flooders,
  57.         # 0 Will Disable Flood Protection
  58.         variable gs_wait "60"
  59.        
  60.         # How Many Requests In How Many Seconds Is Considered Flooding?
  61.         # By Default, This Allows 1 Queries In 60 Seconds, The 2th Being Ignored
  62.         # And Ignoring The Flooder For 'variable gs_wait' Seconds
  63.         variable gs_flood "1:60"
  64.  
  65.         # Add Here The Admin Flags ( m=Master / n=Owner / o=OP . . . )
  66.         # To Enable Or Disable This Script On Channel Commands
  67.         variable gs_flags "+mno|+mno"
  68.  
  69.         # Set Here The Slot Symbols
  70.         variable gs_symbols {
  71.             "¤"
  72.             "¥"
  73.             "X"
  74.         }
  75.        
  76.         # Set Here The Slot Text
  77.         variable gs_game_start_text {
  78.             "\00314Spielt an der Slotmaschiene\003."
  79.             "\00314Zieht den Hebel\003."
  80.             "\00314Los gehts\003."
  81.             "\00314Versucht sein Glück an der Slotmaschiene\003."
  82.             "\00314Viel Glück\003."
  83.             "\00314Jetzt Gewinnst du was\003."
  84.             "\00314Alle guten Dinge sind 3\003."
  85.         }
  86.    
  87.         # Set Here The Slot Text
  88.         variable gs_game_lose_text {
  89.             "\00314Vielleicht klappt es ja beim nächsten Mal\003."
  90.             "\00314Das war leider Nix\003."
  91.             "\00314Du Brauchst mehr Glück\003."
  92.             "\00314So wird das nichts\003."
  93.             "\00314Gib es Lieber auf\003."
  94.             "\00314Ich hatte mal welche dia haben auch Gewonnen\003."
  95.             "\00314Heute ist nicht dein Tag\003."
  96.         }
  97.     }
  98.  
  99.    
  100.     namespace eval M_S {
  101.     #############################################################################
  102.     #                              MySQL_Settings                               #
  103.     #############################################################################
  104.    
  105.         # Set Here The MySQL Host
  106.         variable ms_host "localhost"
  107.  
  108.         # Set Here The MySQL User
  109.         variable ms_user "eggdrop"
  110.  
  111.         # Set Here The MySQL User Pass
  112.         variable ms_pass "eggdrop"
  113.  
  114.         # Set Here The MySQL Database
  115.         variable ms_database "eggdrop"
  116.  
  117.         # Set Here The MySQL Table
  118.         variable ms_table "Slot_Machine"
  119.     }
  120.  
  121.    
  122.     #############################################################################
  123.     #                                                                           #
  124.     #                                                                           #
  125.     #                                Config_End                                 #
  126.     #                                                                           #
  127.     #                                                                           #
  128.     #############################################################################
  129.  
  130.    
  131.     namespace eval M_S {
  132.     #############################################################################
  133.     #                              MySQL_Settings                               #
  134.     #############################################################################
  135.    
  136.         variable ms_handle ""
  137.         variable ms_namelast ""
  138.         package require mysqltcl 3.0
  139.     }
  140.  
  141.    
  142.     namespace eval M_A {
  143.     #############################################################################
  144.     #                               MySQL_Action                                #
  145.     #############################################################################
  146.    
  147.         bind evnt - prerehash S_M::M_A::ma_stop
  148.         bind evnt - rehash S_M::M_A::ma_start
  149.         bind evnt - loaded S_M::M_A::ma_start
  150.         bind time - "00 * * * *" S_M::M_A::ma_dirtyhack
  151.  
  152.         proc ma_dirtyhack {args} {
  153.             S_M::M_A::ma_change $S_M::M_S::ms_table; set xy [S_M::M_A::ma_query "SELECT * from $S_M::M_S::ms_table where 1=2"]
  154.         }
  155.    
  156.         proc ma_start { args } {
  157.             set S_M::M_S::ms_handle [mysqlconnect -host $S_M::M_S::ms_host -user $S_M::M_S::ms_user -password $S_M::M_S::ms_pass -encoding binary]
  158.         }
  159.  
  160.         proc ma_stop { args } {
  161.             if {$S_M::M_S::ms_handle != ""} { mysqlclose $S_M::M_S::ms_handle }
  162.         }
  163.  
  164.         proc ma_change { ms_database } {
  165.             if {$S_M::M_S::ms_namelast != $S_M::M_S::ms_database} {
  166.                 set S_M::M_S::ms_namelast $S_M::M_S::ms_database
  167.                 mysqluse $S_M::M_S::ms_handle $S_M::M_S::ms_database
  168.             }
  169.         }
  170.  
  171.         proc ma_query { sql } {
  172.             if {[string toupper [lindex $sql 0]] == "SELECT"} {
  173.                 return [mysqlsel $S_M::M_S::ms_handle $sql -list]
  174.             } else {
  175.                 mysqlexec $S_M::M_S::ms_handle $sql
  176.                 return 0
  177.             }
  178.         }
  179.     }
  180.  
  181.    
  182.     namespace eval B_B {
  183.     #############################################################################
  184.     #                                Bind_Bind                                  #
  185.     #############################################################################
  186.  
  187.         foreach bind [split $S_M::G_S::gs_bind " "] {
  188.             bind pub -|- "${S_M::G_S::gs_char}$bind" S_M::F_C::fc_check
  189.         }
  190.     }
  191.  
  192.    
  193.     namespace eval F_C {
  194.     #############################################################################
  195.     #                                Flood_Check                                #
  196.     #############################################################################
  197.  
  198.         proc fc_check {nick host hand chan arg} {
  199.             if {[matchattr $hand $S_M::G_S::gs_flags]} {
  200.                 S_M::S_A::sa_action $nick $host $hand $chan $arg
  201.                 return
  202.             }
  203.             if {[channel get $chan $S_M::S_I::si_name]} {
  204.                 if {[S_M::F_A::fa_flood $nick $host $hand $chan $arg]} {
  205.                     return
  206.                 }
  207.                 S_M::S_A::sa_action $nick $host $hand $chan $arg
  208.             }
  209.         }
  210.     }
  211.  
  212.    
  213.     namespace eval F_A {
  214.     #############################################################################
  215.     #                               Flood_Action                                #
  216.     #############################################################################
  217.    
  218.         variable fa_data
  219.         variable fa_array
  220.  
  221.         proc fa(init) {} {
  222.             if {![string match *:* $S_M::G_S::gs_flood]} {
  223.                 putlog "\003\[\00304$S_M::S_I::si_name\003\] \00314variable \003\(\00309gs_flood\003: \00309$S_M::G_S::gs_flood\003) \00314wurde nicht richtig Eingestellt\003."
  224.                 return 1
  225.             }
  226.             set S_M::F_A::fa_data(flood_num) [lindex [split $S_M::G_S::gs_flood :] 0]
  227.             set S_M::F_A::fa_data(flood_time) [lindex [split $S_M::G_S::gs_flood :] 1]
  228.             set i [expr $S_M::F_A::fa_data(flood_num) - 1]
  229.             while {$i >= 0} {
  230.                 set S_M::F_A::fa_array($i) 0
  231.                 incr i -1
  232.             }
  233.         }
  234.         ; fa(init)
  235.  
  236.         proc fa_flood {nick host hand chan arg} {
  237.             if {$S_M::F_A::fa_data(flood_num) == 0} {
  238.                 return 0
  239.             }
  240.             set i [expr ${S_M::F_A::fa_data(flood_num)} - 1]
  241.             while {$i >= 1} {
  242.                 set S_M::F_A::fa_array($i) $S_M::F_A::fa_array([expr $i - 1])
  243.                 incr i -1
  244.             }
  245.             set S_M::F_A::fa_array(0) [unixtime]
  246.             if {[expr [unixtime] - $S_M::F_A::fa_array([expr ${S_M::F_A::fa_data(flood_num)} - 1])] <= ${S_M::F_A::fa_data(flood_time)}} {
  247.                 S_M::W_A::wa_action $nick $host $hand $chan $arg
  248.                 return 1
  249.             } else {
  250.                 return 0
  251.             }
  252.         }
  253.     }
  254.  
  255.    
  256.     namespace eval W_A {
  257.     #############################################################################
  258.     #                               Wait_Action                                 #
  259.     #############################################################################
  260.    
  261.         proc wa_action {nick host hand chan arg} {
  262.             if {[set timeleft [S_M::W_A::wa_throttled $host,$chan $S_M::G_S::gs_wait]]} {
  263.                 putnow "PRIVMSG $chan :\003\[\00304$S_M::S_I::si_name\003\] \00309$nick \00314Du darfst erst wieder in \00304$timeleft \00314Sekunden\003!"
  264.             } else {
  265.                 S_M::S_A::sa_action $nick $host $hand $chan $arg
  266.             }
  267.         }
  268.  
  269.         proc wa_throttled {id time} {
  270.             global wa_throttled
  271.             if {[info exists wa_throttled($id)]} {
  272.                 return [expr {($wa_throttled($id)+$time)-[clock sec]}]  
  273.             } {
  274.                 set wa_throttled($id) [clock sec]
  275.                 utimer $time [list unset wa_throttled($id)]
  276.                 return 0
  277.             }
  278.         }
  279.     }
  280.  
  281.    
  282.     namespace eval S_A {
  283.     #############################################################################
  284.     #                               Start_Action                                #
  285.     #############################################################################
  286.  
  287.         proc sa_action {nick host hand chan arg} {
  288.             set arg [split $arg]
  289.             switch -exact -- [lindex $arg 0] {
  290.                 "on" {
  291.                     if {[matchattr $hand $S_M::G_S::gs_flags]} {
  292.                         if {[channel get $chan $S_M::S_I::si_name]} {
  293.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314ist bereits \00309An\003."
  294.                         } else {
  295.                             channel set $chan +$S_M::S_I::si_name
  296.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314ist nun \00309Aktiviert\003."
  297.                         }
  298.                     }
  299.                 }
  300.                 "off" {
  301.                     if {[matchattr $hand $S_M::G_S::gs_flags]} {
  302.                         if {[channel get $chan $S_M::S_I::si_name]} {
  303.                             channel set $chan -$S_M::S_I::si_name
  304.                             putnow "PRIVMSG $chan :\003\[\00304$S_M::S_I::si_name\003\] \00314ist nun \00304Deaktiviert\003."
  305.                         } else {
  306.                             putnow "PRIVMSG $chan :\003\[\00304$S_M::S_I::si_name\003\] \00314ist bereits \00304Aus\003."
  307.                         }
  308.                     }
  309.                 }
  310.                 "table" {
  311.                     if {[matchattr $hand $S_M::G_S::gs_flags]} {
  312.                         S_M::M_A::ma_change S_M::M_S::ms_database
  313.                         S_M::M_A::ma_query "CREATE TABLE $S_M::M_S::ms_table (Type  varchar(10), Chan  varchar(50), Nick  varchar(50), Points int(10) Default 0, Count int(10) Default 0);"
  314.                         putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00309$nick \00314Ich habe die Tabelle \00309$S_M::M_S::ms_table \003(\00309Type\00314, \00309Chan\00314, \00309Nick\00314, \00309Points, \00309Count\00314) \00314Zur \00309$S_M::M_S::ms_database \00314Datenbank Hinzugefügt\003."
  315.                     }
  316.                 }          
  317.                 "version" {
  318.                     if {[channel get $chan $S_M::S_I::si_name]} {
  319.                         putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Projekt Name\003: \00309$S_M::S_I::si_projektname \003\| \00314Version\003: \00309$S_M::S_I::si_version \003\| \00314Date\003: \00309$S_M::S_I::si_date \003\| \00314CopyRight\003: \00309$S_M::S_I::si_copyright $S_M::S_I::si_copyrightyear \00314by \00309$S_M::S_I::si_author \003\| \00314e\003-\00314Mail\003: \00309$S_M::S_I::si_contact \003\| \00314HomePage\003: \037\00309$S_M::S_I::si_web\037 \003(\00314Status\003: \00309Aktiviert\003)"
  320.                     } else {
  321.                         putnow "PRIVMSG $chan :\003\[\00304$S_M::S_I::si_name\003\] \00314Projekt Name\003: \00309$S_M::S_I::si_projektname \003\| \00314Version\003: \00309$S_M::S_I::si_version \003\| \00314Date\003: \00309$S_M::S_I::si_date \003\| \00314CopyRight\003: \00309$S_M::S_I::si_copyright $S_M::S_I::si_copyrightyear \00314by \00309$S_M::S_I::si_author \003\| \00314e\003-\00314Mail\003: \00309$S_M::S_I::si_contact \003\| \00314HomePage\003: \037\00309$S_M::S_I::si_web\037 \003(\00314Status\003: \00304Deaktiviert\003)"
  322.                     }
  323.                 }
  324.                 "help" {
  325.                     if {[matchattr $hand $S_M::G_S::gs_flags]} {
  326.                         if {[channel get $chan $S_M::S_I::si_name]} {
  327.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Verfügbare Befehle\003: $S_M::G_S::gs_char\00309$S_M::G_S::gs_bind \003\| \003(\00307Einsatz\003) \| \00309Points \003(\00307Nick\003) \003\| \003(\00307Jackpot\003) \| (\00307Version\003) \| \003(\00304Off\003)"
  328.                         } else {
  329.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Verfügbare Befehle\003: $S_M::G_S::gs_char\00309$S_M::G_S::gs_bind \003(\00307On\003)"
  330.                         }
  331.                     } else {
  332.                         if {[channel get $chan $S_M::S_I::si_name]} {
  333.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Verfügbare Befehle\003: $S_M::G_S::gs_char\00309$S_M::G_S::gs_bind \003\| \003(\00307Einsatz\003) \| \00309Points \003(\00307Nick\003) \003\| \003(\00307Jackpot\003) \| (\00307Version\003)"
  334.                         }
  335.                     }
  336.                 }
  337.                 "del" {
  338.                     if {[channel get $chan $S_M::S_I::si_name]} {
  339.                         if {[matchattr $hand $S_M::G_S::gs_flags]} {
  340.                             if {$arg == ""} {
  341.                                 S_M::M_A::ma_query "DELETE FROM `$S_M::M_S::ms_table` WHERE `Nick` = '[mysqlescape $nick]';"
  342.                                 putnow "PRIVMSG $chan :\00309$nick\003. \00314Du wurdest aus meiner datenbank \00304gelöscht\003."
  343.                             } else {
  344.                                 if {[S_M::M_A::ma_query "SELECT Points FROM $S_M::M_S::ms_table WHERE Nick = '[mysqlescape $arg]'"] == ""} {
  345.                                     putnow "PRIVMSG $chan :\00309$nick\003. \00314$arg \00304existierst nicht \00314in meiner Datenbank\003."
  346.                                 } else {
  347.                                     S_M::M_A::ma_query "DELETE FROM `$S_M::M_S::ms_table` WHERE `Nick` = '[mysqlescape $arg]';"
  348.                                     putnow "PRIVMSG $chan :\00309$nick\003. \00314$arg wurde aus meiner datenbank \00304gelöscht\003."
  349.                                 }
  350.                             }
  351.                         } else {
  352.                             if {[S_M::M_A::ma_query "SELECT Points FROM $S_M::M_S::ms_table WHERE Nick = '[mysqlescape $nik]'"] == ""} {
  353.                                 putnow "PRIVMSG $chan :\00309$nick\003. \00314Du \00304existierst nicht \00314in meiner Datenbank\003."
  354.                             } else {
  355.                                 S_M::M_A::ma_query "DELETE FROM `$S_M::M_S::ms_table` WHERE `Nick` = '[mysqlescape $nick]';"
  356.                                 putnow "PRIVMSG $chan :\00309$nick\003. \00314Du wurdest aus meiner datenbank \00304gelöscht\003."
  357.                             }    
  358.                         }
  359.                     }
  360.                 }
  361.                 "points" {
  362.                     if {[channel get $chan $S_M::S_I::si_name]} {
  363.                         putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00309$nick \00314Du hast \00309[S_M::S_R::sr_read User $chan $nick]\003\$"
  364.                     }
  365.                 }
  366.                 "jackpot" {
  367.                     if {[channel get $chan $S_M::S_I::si_name]} {
  368.                         putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00309$nick \00314Im Jackpot sind \00309[S_M::S_R::sr_read Global $chan ${S_M::S_I::si_name}_Jackpot]\003\$"
  369.                     }
  370.                 }
  371.                 default {
  372.                     if {[matchattr $hand $S_M::G_S::gs_flags]} {
  373.                         if {![channel get $chan $S_M::S_I::si_name]} {
  374.                             putnow "PRIVMSG $chan :\003\[\00304$S_M::S_I::si_name\003\] \00314ist \00304Deaktiviert\003! \00314Benutze Bitte \003$S_M::G_S::gs_char\00309$S_M::G_S::gs_bind \003(\00307On\003)"
  375.                         }
  376.                     }
  377.                     if {[channel get $chan $S_M::S_I::si_name]} {
  378.                         if {$arg == ""} {
  379.                             S_M::S_W::sw_write User $chan $nick [expr int([S_M::S_R::sr_read User $chan $nick] - 10)]
  380.                             S_M::S_W::sw_write Global $chan ${S_M::S_I::si_name}_Jackpot [expr int([S_M::S_R::sr_read Global $chan ${S_M::S_I::si_name}_Jackpot] + 10)]
  381.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00309$nick [lindex $S_M::G_S::gs_game_start_text [rand [llength $S_M::G_S::gs_game_start_text]]]"
  382.                             set slot1 [lindex $S_M::G_S::gs_symbols [rand [llength $S_M::G_S::gs_symbols]]]
  383.                             putnow "PRIVMSG $chan :\003( \00309$slot1 \003) \003( \00304X \003) \003( \00304X \003)"
  384.                             set slot2 [lindex $S_M::G_S::gs_symbols [rand [llength $S_M::G_S::gs_symbols]]]
  385.                             putnow "PRIVMSG $chan :\003( \00309$slot1 \003) \003( \00309$slot2 \003) \003( \00304X \003)"
  386.                             set slot3 [lindex $S_M::G_S::gs_symbols [rand [llength $S_M::G_S::gs_symbols]]]
  387.                             putnow "PRIVMSG $chan :\003( \00309$slot1 \003) \003( \00309$slot2 \003) \003( \00309$slot3 \003)"
  388.                             if {$slot1 == "X"} {
  389.                                 if {$slot2 == "X"} {
  390.                                     if {$slot3 == "X"} {
  391.                                         S_M::S_W::sw_write User $chan $nick [expr int([S_M::S_R::sr_read User $chan $nick] + [S_M::S_R::sr_read Global $chan ${S_M::S_I::si_name}_Jackpot])]
  392.                                         putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \002\00309Jackpot\002 \00314Du hast \00309[S_M::S_R::sr_read Global $chan ${S_M::S_I::si_name}_Jackpot]\003\$ \00314Gewonnen\003!"
  393.                                         S_M::S_W::sw_write Global $chan ${S_M::S_I::si_name}_Jackpot 0
  394.                                         return 1
  395.                                     }
  396.                                 }
  397.                             }
  398.                             if {$slot1 == $slot2} {
  399.                                 if {$slot2 == $slot3} {
  400.                                     S_M::S_W::sw_write User $chan $nick [expr int([S_M::S_R::sr_read User $chan $nick] + 100)]
  401.                                     putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Herzlichen Glückwunsch\003. \00314Du hast \00309100\003\$ \00314Gewonnen\003."
  402.                                     return 1
  403.                                 }
  404.                             }
  405.                             if {$slot1 == $slot2} {
  406.                                 S_M::S_W::sw_write User $chan $nick [expr int([S_M::S_R::sr_read User $chan $nick] + 25)]
  407.                                 putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Herzlichen Glückwunsch\003. \00314Du hast \0030925\003\$ \00314Gewonnen\003."
  408.                                 return 1
  409.                             }
  410.                             if {$slot2 == $slot3} {
  411.                                 S_M::S_W::sw_write User $chan $nick [expr int([S_M::S_R::sr_read User $chan $nick] + 25)]
  412.                                 putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Herzlichen Glückwunsch\003. \00314Du hast \0030925\003\$ \00314Gewonnen\003."
  413.                                 return 1
  414.                             }
  415.                             if {$slot1 == "X"} {
  416.                                 if {$slot3 == "X"} {
  417.                                     S_M::S_W::sw_write User $chan $nick [expr int([S_M::S_R::sr_read User $chan $nick] + 10)]
  418.                                 putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] \00314Herzlichen Glückwunsch\003. \00314Du hast \0030910\003\$ \00314Gewonnen\003."
  419.                                     return 1
  420.                                 }
  421.                             }
  422.                             putnow "PRIVMSG $chan :\003\[\00309$S_M::S_I::si_name\003\] [lindex $S_M::G_S::gs_game_lose_text [rand [llength $S_M::G_S::gs_game_lose_text]]] \00314Dir wurden \0030910\003\$ \00314Abgezogen\003!"
  423.                             return 1
  424.                         }
  425.                     }
  426.                 }
  427.             }
  428.         }
  429.     }
  430.  
  431.    
  432.     namespace eval S_W {
  433.     #############################################################################
  434.     #                                Start_Write                                #
  435.     #############################################################################
  436.    
  437.         proc sw_write {Type Chan Nick Points} {
  438.             S_M::M_A::ma_change $S_M::M_S::ms_database
  439.             S_M::M_A::ma_query "Delete FROM $S_M::M_S::ms_table WHERE Nick = '[mysqlescape $Nick]'"
  440.             S_M::M_A::ma_query "INSERT $S_M::M_S::ms_table SET Type = '[mysqlescape $Type]' , Chan = '[mysqlescape $Chan]' , Nick = '[mysqlescape $Nick]' , Points = '[mysqlescape $Points]'"
  441.             return 1
  442.         }
  443.     }
  444.  
  445.  
  446.     namespace eval S_R {
  447.     #############################################################################
  448.     #                                Start_Read                                 #
  449.     #############################################################################
  450.    
  451.         proc sr_read {Type Chan Nick} {
  452.             S_M::M_A::ma_change $S_M::M_S::ms_database
  453.             return [S_M::M_A::ma_query "SELECT Points FROM $S_M::M_S::ms_table WHERE Type = '[mysqlescape $Type]' and Chan = '[mysqlescape $Chan]' and Nick = '[mysqlescape $Nick]'"]
  454.         }
  455.     }
  456.  
  457.    
  458.     namespace eval S_I {
  459.     #############################################################################
  460.     #                               Script_Info                                 #
  461.     #############################################################################
  462.    
  463.         variable si_name "Slot_Machine"
  464.         variable si_projektname "SM"
  465.         variable si_author "Diamond85"
  466.         variable si_contact "Diamond85@gmx.de"
  467.         variable si_web "Coming Soon"
  468.         variable si_copyright "(c)"
  469.         variable si_copyrightyear "2012"
  470.         variable si_version "0.3"
  471.         variable si_date "21.12.2012"
  472.     }
  473.  
  474.    
  475.     namespace eval S_S {
  476.     #############################################################################
  477.     #                             Setudef_Settings                              #
  478.     #############################################################################
  479.         setudef flag $S_M::S_I::si_name
  480.     }
  481.  
  482.     putlog "\003\[\00309$S_M::S_I::si_name\003\] \00314Projekt Name\003: \00309$S_M::S_I::si_projektname \003\| \00314Version\003.\00309$S_M::S_I::si_version \003(\00314Status\003: \00309Loaded\003)."
  483. }
  484.  
  485. # EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement