Skip to content

Instantly share code, notes, and snippets.

@jonas747
Created February 23, 2014 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonas747/9171483 to your computer and use it in GitHub Desktop.
Save jonas747/9171483 to your computer and use it in GitHub Desktop.
Simple E2 chip that records when you die and keeps track of how long ago you died
@name NLRHelper
@persist CurrentMinute DeathTime DeathClk
@trigger
if(clk("update")){
timer("update", 1000)
if(!owner():isAlive() && !DeathClk){
DeathClk = 1
DeathTime = realtime()
}elseif(owner():isAlive() && DeathClk){
DeathClk = 0
}
Delta = round(realtime() - DeathTime)
Minutes = floor(Delta / 60)
Seconds = floor(Delta % 60)
if(Minutes != CurrentMinute && Minutes < 6){
print("Time since death: "+Minutes+"m "+Seconds+"s")
hint("Time since death: "+Minutes+"m "+Seconds+"s", 5)
CurrentMinute = Minutes
}
setName("NLR Helper\nTime since death: "+Minutes+"m "+Seconds+"s")
}elseif(chatClk(owner())){
if(lastSaid() == "!nlr"){
hideChat(1)
Delta = round(realtime() - DeathTime)
Minutes = round(Delta / 60)
Seconds = round(Delta % 60)
print("Time since death: "+Minutes+"m "+Seconds+"s")
}
}elseif(first() || duped()){
timer("update", 1000)
DeathTime = realtime()
runOnChat(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment