Year of the Dragon: Through April 23rd, claim the adventure pack Slice of Life for free! Speak to Xatheral in the Hall of Heroes.

Game mechanicsNewbie guideIn developmentDDO StoreSocial Media


ChallengesClassesCollectablesCraftingEnhancementsEpic DestiniesFavorFeats

GlossaryItemsMapsMonstersPlacesQuestsRacesReincarnationSkillsSpells


Please create an account or log in to build a reputation and unlock more editing privileges, and then visit DDO wiki's IRC Chat/Discord if you need any help!

User:Technical 13/SandBox/mIRC scripts/Idle time teller

From DDO wiki
Jump to navigation Jump to search
⇑   ⇑   Back to top   ⇑   ⇑
General   Journal   Sand Box   To Do List   Characters   Quest List   Crafting   Talk  



 


;--- Idle time teller ---
on *:TEXT:!Idle*:# {
  if (%quote.flood == $null) {
    if (($2 ison $chan) || (($2 == $chan) || ($2 == $chr(35)) || ($2 == $chr(36) $+ chan) || ($2 == chan) || ($2 == channel) || ($2 == room))) {
      if (($2 == $chan) || ($2 == $chr(35)) || ($2 == $chr(36) $+ chan) || ($2 == chan) || ($2 == channel) || ($2 == room)) {
        /set %Idle_Loop $nick($chan,0)
        /set %Idle_Nick $nick($chan,%Idle_Loop)
      }
      else { /set %Idle_Loop 1  | /set %Idle_Nick $2 }
      while (%Idle_Loop > 0) {
        /set %Idle_Days $int($calc($nick($chan, %Idle_Nick).idle / 86400))
        /set %Idle_Hours $int($calc(($nick($chan, %Idle_Nick).idle - (%Idle_Days * 86400)) / 3600))
        /set %Idle_Minutes $int($calc(($nick($chan, %Idle_Nick).idle - (%Idle_Days * 86400) - (%Idle_Hours * 3600)) / 60))
        /set %Idle_Seconds $int($calc($nick($chan, %Idle_Nick).idle - (%Idle_Days * 86400) - (%Idle_Hours * 3600) - (%Idle_Minutes * 60)))
        if (%Idle_Days != 0) {
          /set %Idle_Total %Idle_Days days
          if ((%Idle_Hours != 0) || (%Idle_Minutes != 0) || (%Idle_Seconds != 0)) {
            /set %Idle_Total %Idle_Total $+ ,
          }
          else {
            /set %Idle_Total %Idle_Total $+ .
          }
        }
        if (%Idle_Hours != 0) {
          /set %Idle_Total %Idle_Total %Idle_Hours hours
          if ((%Idle_Minutes != 0) || (%Idle_Seconds != 0)) {
            /set %Idle_Total %Idle_Total $+ ,
          }
          else {
            /set %Idle_Total %Idle_Total $+ .
          }
 
        }
        if (%Idle_Minutes != 0) {
          /set %Idle_Total %Idle_Total %Idle_Minutes minutes
          if (%Idle_Seconds != 0) {
            /set %Idle_Total %Idle_Total $+ ,
          }
          else {
            /set %Idle_Total %Idle_Total $+ .
          }
 
        }
        if (%Idle_Seconds != 0) {
          /set %Idle_Total %Idle_Total %Idle_Seconds seconds $+ .
        }
        if ((%Idle_Days != 0) || (%Idle_Hours != 0) || (%Idle_Minutes != 0) || (%Idle_Seconds != 0)) {
          /msg $chan Kobold knows %Idle_Nick has been idle for %Idle_Total
        }
        else {
          if ((%Idle_Nick === $nick) || (%Idle_Nick === $me)) { }
          else {
            /msg $chan Kobold knows %Idle_Nick is not idle!!
          }
        }
        /dec %Idle_Loop
        /set %Idle_Nick $nick($chan,%Idle_Loop)
        /unset %Idle_Total
      }
      /unset %Idle_*
    }
    else {
      /msg $chan Kobold not dum-dum, there no $2 here.
    }
  }
  set -u2 %quote.flood on
}