Guest User

Untitled

a guest
May 9th, 2018
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. if { $cmd == "DBUNNUKE" } {
  2. set release [lindex $arg 1]
  3. set section [lindex $arg 2]
  4. set reason [lindex $arg 3]
  5. set curtime [lindex $arg 4]
  6. set nick [lindex $arg 5]
  7. set chan [lindex $arg 6]
  8. set network [lindex $arg 7]
  9. set source [lindex $arg 8]
  10. if { $source == "" } { set source $network }
  11.  
  12. if { [llength $mysql(nuke,allowedsource)] <= 0 } { set AddToDB "1"
  13. } elseif { [lsearch -exact $mysql(nuke,allowedsource) $source] != -1 } { set AddToDB "1"
  14. } else { set AddToDB "0" }
  15.  
  16. set numrel [::mysql::sel $mysql(handle) "SELECT rel_id FROM allpres WHERE rel_name = '$release'"]
  17.  
  18. if { $numrel != 0 && $AddToDB == "1" } {
  19. set getsql [::mysql::sel $mysql(handle) "SELECT rel_id,nuked FROM allpres WHERE rel_name = '$release'" -flatlist]
  20. set rel_id [lindex $getsql 0]
  21. set nuked [lindex $getsql 1]
  22.  
  23. foreach nuke {1 3 5 7 9} {
  24. if {$nuke == $nuked} {
  25. set nuked [expr $nuked + 1]
  26. set updatepre [::mysql::exec $mysql(handle) "UPDATE allpres SET nuked = '$nuked' WHERE rel_id = '$rel_id'"]
  27. set updatenuke [::mysql::exec $mysql(handle) "UPDATE nukes SET unnuked = 'Y' WHERE rel_id = '$rel_id'"]
  28. set insertnuke [::mysql::exec $mysql(handle) "INSERT INTO unnukes (rel_id,un_reason,un_time) VALUES ( '$rel_id' , '$reason' , '$curtime' )"]
  29. set insertnick [::mysql::exec $mysql(handle) "INSERT INTO nicks (rel_id,a_type,a_nick,a_chan,a_network) VALUES ( '$rel_id' , 'NUKE' , '$nick' , '$chan' , '$network' )"]
  30. putallbots "DBUNNUKEOK $release $section $reason $curtime $nick $chan $network $source"
  31. }
  32. }
  33. }
  34. }
  35. }
Add Comment
Please, Sign In to add comment