Created
February 23, 2014 13:27
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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