All pastes #519334 Raw Edit

oLcAY's PC script

public text v1 · immutable
#519334 ·published 2007-05-29 16:58 UTC
rendered paste body
ON $*:TEXT:/[!@.](PC|Pest|World|PCW)off/Si:#:{ 
  if ($readini(PCW.ini,$chan,Status) == OFF) { 
    notice $nick 12You cant turn something off that is not on. 
    halt 
  } 
  if ($nick isop $chan || $nick ishop $chan || $address($nick,2) == $address($me,2)) { 
    remini PCW.ini $chan 
    writeini PCW.ini $chan Status OFF 
    msg $chan 12The PestControl services have been halted by4 $nick  
    halt 
  } 
  else { 
    notice $nick 12You must be Halfop Plus to use this command. 
  } 
} 
ON $*:TEXT:/[!@.](PC|Pest|World|PCW)On/Si:#:{ 
  if (($nick isop $chan || $nick ishop $chan || $address($nick,2) == $address($me,2)) && ($readini(PCW.ini,$chan,Status) == OFF)) { 
    remini PCW.ini $chan 
    msg $chan 12The PestControl services have been continued by4 $nick  
    halt 
  } 
  if ($readini(PCW.ini,$chan,Status) != OFF) { 
    notice $nick 12You cant turn ON whats not off. 
    halt 
  } 
  else { 
    notice $nick 12You must be 4Halfop12 Plus to use this command. 
  } 
} 
ON $*:TEXT:/[!@.](SetPCW|setWorld)/Si:#:{ 
  if ($readini(PCW.ini,$chan,Status) == OFF) { halt } 
  if ($3 != $null) { halt } 
  if (!$2) { 
    notice $nick 4Error:12 $1 <World>  
    halt 
  } 
  if (($nick isop $chan || $nick ishop $chan || $address($nick,2) == $address($me,2)) && ($2 isnum 2-140)) { 
    writeini PCW.ini $chan World $2 
    writeini PCW.ini $chan Nick $nick 
    writeini PCW.ini $chan Time $CTime 
    msg $chan 12The PestControl world has been changed by4 $nick  
    halt 
  } 
  if ($nick isvoice $chan || $nick isreg $chan) { 
    notice $nick 12You must be Halfop Plus to use this command. 
    halt 
  } 
  if ($2 >= 139) { 
    notice $nick 12The world must be Between4 212 and4 140 
    halt 
  } 
  else { 
    notice $nick 12A PestControl world must be a number. 
  } 
} 
ON $*:TEXT:/[!@.](PCW|World|PestWorld)/Si:#:{ 
  if (OFF isin $1 || ON isin $1) { halt } 
  if ($readini(PCW.ini,$chan,Status) == OFF) { halt } 
  if ($readini(PCW.ini,$chan,World) == $null) { 
    notice $nick 12There is no world set. 
    halt 
  } 
  notice $nick 12The current PestControl world is4 $readini(PCW.ini,$chan,World) 12Set by4 $readini(PCW.ini,$chan,Nick) 12 $+ $duration($calc($CTime - $readini(PCW.ini,$chan,Time))) ago. 4 $+ $chr(187) $+ 12 $+ $readini(PCW.ini,$chan,Users) $+ 4 $+ $chr(171)  
  halt 
} 
} 

ON $*:TEXT:/[!@.]Stop(PC|World|PCW)/Si:#:{ 
  if ($readini(PCW.ini,$chan,Status) == OFF) { halt } 
  if ($nick isop $chan || $nick ishop $chan || $address($nick,2) == $address($me,2)) { 
    remini PCW.ini $chan 
    msg $chan 12All PestControl files for4 $chan 12 have been deleted. 
    halt 
  } 
  if ($readini(PCW.ini,$chan,World) == $null) { 
    notice $nick 12You cant turn Stop whats not there. 
    halt 
  } 
  else { 
    notice $nick 12You must be Halfop Plus to use this command. 
  } 
} 
Alias SelfPC { 
  dialog -m PCW1337 PCW1337 
} 
menu * { 
  Self PestControl:dialog -m PCW1337 PCW1337 
} 
dialog PCW1337 { 
  title "PCW Dialog | Made By: Jdawg140 ©" 
  size -1 -1 160 60 
  option dbu 
  button "Ok", 1, 0 0 37 60, ok 
  button "Cancel", 2, 123 0 37 60, cancel 
  Box "Script By Jdawg140 © ", 3, 50 0 60 12, center 
  edit "World", 4, 50 12 60 12, center 
  edit "#Channel", 6, 50 24 60 12, center 
  button "Set World", 5, 50 36 60 24, center 
} 
on *:DIALOG:PCW1337:sclick:5:{ 
  if ($readini(PCW.ini,$did($dname,6),Status) == OFF) { 
    echo $active $timestamp The PestControl system is off for $did($dname,6) 
    halt 
  } 
  if ($me ison $did($dname,6) && $did($dname,4) isnum 2-140) { 
    writeini PCW.ini $did($dname,6) World $did($dname,4) 
    writeini PCW.ini $did($dname,6) Nick $me 
    writeini PCW.ini $did($dname,6) Time $CTime 
    msg $did($dname,6) 12The PestControl world has been changed by4 $me  
    halt 
  } 
  if ($did($dname,4) !isnum 2-140) { 
    echo $active $timestamp Dude $did($dname,4) is not a number. 
    halt 
  } 
  else { 
    echo $active $timestamp Dude your not on $did($dname,6) 
  } 
}