Guest User

Untitled

a guest
Sep 9th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 1.88 KB | None | 0 0
  1. ###########################################
  2. #                          
  3. # Channel invite 0.1 BETA          
  4. # Scripted by Dreamer              
  5. #                          
  6. ###########################################
  7. #  
  8. # Type /msg <botnick> @add <nick> <pass>
  9. # to add someone to the database
  10. # Type /msg <botnick> @invite <nick> <pass>
  11. # to get invited in to channel
  12. #
  13. # History:
  14. # 0.1: First version
  15. #
  16. ###########################################
  17. # EDIT FROM HERE
  18.  
  19. # Channel where the bot wil invite
  20. set chan_1 "#chav"
  21.  
  22. # Name of the database
  23. set db scripts/chan.invite
  24.  
  25. # STOP EDITING FROM HERE
  26.  
  27. set ver "0.1"
  28.  
  29. bind msg - @add add_1
  30. bind msg - @invite inv_1
  31.  
  32. putlog "Channel invite $ver by Dreamer loaded"
  33.  
  34. # Script starts now
  35.  
  36. proc add_1 { nick uhost hand args } {
  37.     global chan_1 db
  38.     set args [split $args " "]
  39.     set user [lindex $args 0]
  40.     set user [string range $user 1 end]
  41.     set pass [lindex $args 1]
  42.     set pass [string range $pass 0 end-1]
  43.     if { $user == "" || $pass == "" } {
  44.             putserv "PRIVMSG $nick :Please instert a Nickname and a password"
  45.             return 0
  46.     }
  47.     set up $user|$pass
  48.     set wfile [open $db a+]
  49.     puts $wfile $up
  50.     close $wfile
  51.     putserv "PRIVMSG $chan_1 :\[\00314DB UPDATE\003\] $user is added to Database by $nick"
  52. }
  53.  
  54. proc inv_1 { nick uhost hand arg } {
  55.     global chan_1 db
  56.     set found 0
  57.     set arg [split $arg " "]
  58.     set user1 [lindex $arg 0]
  59.     set user1 [string range $user1 0 end]
  60.     set pass1 [lindex $arg 1]
  61.     set pass1 [string range $pass1 0 end]
  62.     set up1 $user1|$pass1
  63.     set found 0
  64.     set fs [open $db r]
  65.     while {![eof $fs]} {
  66.     gets $fs line
  67.     if {$line == $up1} { set found 1 }
  68.     }
  69.     close $fs
  70.     if {$found} {
  71.     putserv "PRIVMSG $chan_1 :\[\00314INVITE\003\] $user1 invited him/herself as $nick"
  72.     putserv "invite $nick $chan_1"
  73.     } else {
  74.     putserv "PRIVMSG $nick :Wrong pass or username !!!!"
  75.     putserv "PRIVMSG $chan_1 :\[\0034INTRUDER\003\] $nick tried to get in the channel"
  76.     }
  77. }
Add Comment
Please, Sign In to add comment