All pastes #635159 Raw Edit

spy script

public text v1 · immutable
#635159 ·published 2007-07-26 21:52 UTC
rendered paste body
alias chspy {
  dialog -dm spy spy
}
dialog spy {
  title "Viper79's Channel Spy"
  size -1 -1 120 110
  option dbu 
  tab "Spy",1, 5 5 110 95
  tab "Receiver",2
  tab "Setup",26
  tab "About",3
  button "Done",4,6 110 40 10, OK
  button "Cancel",5,75 110 40 10, Cancel


  box "Channel to Spy",20, 10 23 100 70,tab 1
  edit "",6, 15 35 90 11,AutoHs,tab 1
  text "Current Spying Channel",21",30 50 70 10,tab 1
  edit "",22, 15 60 90 11,AutoHs read,tab 1
  button "Add",8, 15 80 20 10,tab 1
  button "Remove",9, 75 80 30 10,tab 1

  box "Channel to report Spy",10, 10 23 100 70,tab 2
  edit "",11, 15 35 90 11,AutoHs,tab 2
  text "Current Spying Channel",12",30 50 70 10,tab 2
  edit "",13, 15 60 90 11,AutoHs read,tab 2
  button "Add",23, 15 80 20 10,tab 2
  button "Remove",24, 75 80 30 10,tab 2

  text "Viper79's Channel Spy",14,17 25 90 10,tab 3
  text "Written by Viper79 ",15,17 35 90 10,tab 3
  text "Homepage:None",16,17 55 90 10,tab 3
  text "Channel: #Spyer",17,17 65 90 10,tab 3
  text "Enjoy Spying On Others",18,17 75 97 10,tab 3

  check "Texts",31,10 25 35 10,tab 26
  check "Actions",27,10 35 35 10,tab 26
  check "Joins",28,10 45 35 10,tab 26
  check "Parts",29,10 55 35 10,tab 26
  check "Quits",30,10 65 35 10,tab 26

  check "Nicks",32,10 75 35 10,tab 26
  check "Kicks",33,10 85 35 9,tab 26
  check "Ops",34,75 26 35 10,tab 26
  check "Deops",35,75 36 35 10,tab 26
  check "Voices",36,75 46 35 10,tab 26

  check "Devoices",37,75 56 35 10,tab 26
  check "Bans",38,75 66 35 10,tab 26
  check "Unbans",39,75 76 35 10,tab 26
  check "Topics",40,75 86 35 10,tab 26
  check "Modes",41,10 95 35 9,tab 26

  text "S",43,50 29 5 7,tab 26
  text "E",44,50 40 5 7,tab 26
  text "T",45,50 51 5 7,tab 26
  text "U",46,50 62 5 7,tab 26
  text "P",47,50 73 5 7,tab 26
  text "Setup Events to Spy",48,50 97 60 7,tab 26
}
on 1:DIALOG:spy:init:*: {
  did -a spy 22 %spy1
  did -a spy 13 %spy2
  did -a spy 6 %spy1
  did -a spy 11 %spy2
  if (%chtext == ON) { did -c spy 31 }
  if (%chjoin == ON) { did -c spy 28 }
  if (%chaction == ON) { did -c spy 27 }
  if (%chpart == ON) { did -c spy 29 }
  if (%chquit == ON) { did -c spy 30 }
  if (%chnick == ON) { did -c spy 32 }
  if (%chkick == ON) { did -c spy 33 }
  if (%chops == ON) { did -c spy 34 }
  if (%chdeops == ON) { did -c spy 35 }
  if (%chvoice == ON) { did -c spy 36 }
  if (%chdevoice == ON) { did -c spy 37 }
  if (%chban == ON) { did -c spy 38 }
  if (%chunban == ON) { did -c spy 39 }
  if (%chtopic == ON) { did -c spy 40 }
  if (%chmode == ON) { did -c spy 41 }
}
on 1:DIALOG:spy:sclick:8: {
  set %spy1 $did(6)
  did -a spy 22 %spy1
  enable #chspy
}
on 1:DIALOG:spy:sclick:9: {
  did -r spy 22
  did -r spy 6
  unset %spy1
  disable #chspy
}
on 1:DIALOG:spy:sclick:23: {
  set %spy2 $did(11)
  did -a spy 13 %spy2
  enable #chspy
}
on 1:DIALOG:spy:sclick:24: {
  did -r spy 13
  did -r spy 11
  unset %spy2
  disable #chspy
}
on 1:DIALOG:spy:sclick:*: {
  if ($did(31).state == 1) { set %chtext ON }
  else { unset %chtext }
  if ($did(28).state == 1) { set %chjoin ON }
  else { unset %chjoin }
  if ($did(27).state == 1) { set %chaction ON }
  else { unset %chaction }
  if ($did(29).state == 1) { set %chpart ON }
  else { unset %chpart }
  if ($did(30).state == 1) { set %chquit ON }
  else { unset %chquit }
  if ($did(32).state == 1) { set %chnick ON }
  else { unset %chnick }
  if ($did(33).state == 1) { set %chkick ON }
  else { unset %chkick }
  if ($did(34).state == 1) { set %chops ON }
  else { unset %chops }
  if ($did(35).state == 1) { set %chdeops ON }
  else { unset %chdeops }
  if ($did(36).state == 1) { set %chvoice ON }
  else { unset %chvoice }
  if ($did(37).state == 1) { set %chdevoice ON }
  else { unset %chdevoice }
  if ($did(38).state == 1) { set %chban ON }
  else { unset %chban }
  if ($did(39).state == 1) { set %chunban ON }
  else { unset %chunban }
  if ($did(40).state == 1) { set %chtopic ON }
  else { unset %chtopic }
  if ($did(41).state == 1) { set %chmode ON }
  else { unset %chmode }
}
#chspy on
on *:TEXT:*:%spy1: { 
  if (%chtext == ON) {  msg %spy2  14(3 $+ %spy1 $+ 14) 3<2 $$+ $nick $$+ 3>14 $1- }
  else { halt }
}
on *:ACTION:*:%spy1: {
  if (%chaction == ON) { msg %spy2  14(3 $+ %spy1 $+ 14)6 $nick $1- }
  else { halt }
}
on *:JOIN:%spy1: {
  if (%chjoin == ON) { msg %spy2 3*** $nick ( $+ $mask($address,3) $+ ) has joined %spy1 }
  else { halt }
}
on *:PART:%spy1: {
  if (%chpart == ON) { msg %spy2 3*** $nick ( $+ $mask($address,3) $+ ) has left %spy1 }
  else { halt }
}
on *:QUIT: { 
  if (%chquit == ON) { 
    if ( $nick ison %spy1 ) {  msg %spy2  14(3 $+ %spy1 $+ 14) 4*** $nick has quit IRC 3( $+ $1- $+ ) }
    else { halt }
  }
}
on *:NICK: { 
  if (%chnick == ON) { 
    if ($comchan($newnick,1) == %spy1) {  msg %spy2 3*** $nick is known as $newnick }
    else { halt }
  }
}
on *:KICK:%spy1: { 
  if (%chkick == ON) { msg %spy2 14(3 $+ %spy1 $+ 14) 3*** $knick was kicked by $nick ( $+ $2- $+ ) }
  else { halt }
}
on *:OP:%spy1: { 
  if (%chops == ON) { msg %spy2  14(3 $+ %spy1 $+ 14) 3*** $nick sets +o $opnick }
  else { halt }
}
on *:DEOP:%spy1: {
  if (%chdeops == ON) { msg %spy2  14(3 $+ %spy1 $+ 14) 3*** $nick sets -o $opnick }
  else { halt }
}
on *:VOICE:%spy1: {
  if (%chvoice == ON) { msg %spy2  14(3 $+ %spy1 $+ 14) 3*** $nick sets +v $vnick }
  else { halt }
}
on *:DEVOICE:%spy1: { 
  if (%chdevoice == ON) { msg %spy2 14(3 $+ %spy1 $+ 14) 3*** $nick sets -v $vnick }
  else { halt }
}
on *:BAN:%spy1: {
  if (%chban == ON) { msg %spy2  14(3 $+ %spy1 $+ 14) 3*** $nick sets +b $bnick }
  else { halt }
}
on *:UNBAN:%spy1: {
  if (%chunban == ON) { msg %spy2 14(3 $+ %spy1 $+ 14) 3*** $nick sets -b $1- }
  else { halt }
}
on *:TOPIC:%spy1: {
  if (%chtopic == ON) { msg %spy2 14(3 $+ %spy1 $+ 14) 3*** $nick changes topic to ' $+ $chan(%spy1).topic ' }
  else { halt }
}
on *:MODE:%spy1: { 
  if (%chmode == ON) { msg %spy2  14(3 $+ %spy1 $+ 14) 3*** $nick set mode $1- }
  else { halt }
}
#chspy end