'is
'1.5
'&Idle System:Alendar And Draco (Improvements by PyroManiac)
'&idles <on/off>:project <String>:currently <String>:istime <Number>:sayidle:idlesys status
'&
'&All commands must be issued internally using '/' as a trigger.
'*********************************************************************
'* *
'* Idle System V1.3 *
'* Plugin for StealthBot 2.6 Rev3 and up *
'* *
'* Written by: Alendar *
'* Helped By: Draco *
'* Improved By: PyroManiac
'* Latest Update: 12-28-07 *
'* *
'* A basic idle system *
'* *
'* Commands: *
'* /idles <on/off> - Turns the idle on and off *
'* /project <String> - Sets the project to be shown in idle *
'* /currently <String> - Sets currently doing in the idle. *
'* /istime <number> - Sets the idle time in minutes. *
'* /sayidle - Says the idle and resets the timer *
'* /idlesys status - Reports the status of idlesys. *
'* *
'*********************************************************************
'*********************************************************************
'* *
'*Change Log: *
'*1.01 Added SetSetting calls. (Draco) *
'*1.02 Added SetSetting commands. (Alendar) *
'*1.1 Milestone release. (Draco) *
'* -Help system fixed. *
'* -Coding fixed and formatted. *
'* -Idlesys command added. *
'* -Strings cleaned. *
'* -Added GetTimeLeft("idlesys", "idle") To status command (Alendar) *
'*1.2 (Alendar) *
'* -Fix on/off bug in status commmand. *
'* -idlesys to is *
'*1.3 *
'* -Changed how version is access by greet. *
'*1.4 *
'* -Added IdleMessage so you only have to edit it in 1 spot not 2 *
'*1.5 (PyroManiac's fixes) *
'* -Cleaned up indenting. *
'* -Changed AddQ's and AddChat's to dsp. *
'* -Added variables for the rest of the settings. *
'* *
'* *
'*********************************************************************
Public IdleMessage
Private isCurrently
Private isProject
Private isIdleTime
Private isStatus
Sub is_Event_Load()
isCurrently = GetSetting("is", "currently")
isProject = GetSetting("is", "project")
isIdleTime = GetSetting("is", "idletime")
isStatus = GetSetting("is", "on/off")
'*********************
'* Script Settings *
'*********************
SetSetting "is", "currently", "(Current task not set)", "What you are currently doing.", False
SetSetting "is", "project", "(Project not set)", "Your current project", False
SetSetting "is", "idletime", 30, "Time (In minutes) between idle messages.", False
SetSetting "is", "on/off", "off", "Idle message on/off.", False
'*********************
'* DO NOT EDIT BELOW *
'*********************
TimerInterval "is", "idle", (isIdleTime * 60)
If LCase(isIdleStatus) = "on" Then
TimerEnabled "is", "idle", True
dsp 1, IdleMessage, 0, 0
Else
TimerEnabled "is", "idle", False
End If
dsp 4, "Idle System " & psVersions.Item("is") & " by Alendar with assistance from Draco (and fixed up by PyroManiac) loaded.", 0, vbCyan
End Sub
Sub is_Event_Close()
Call SetSetting("is", "currently", isCurrently, "What you are currently doing.", True)
Call SetSetting("is", "project", isProject, "Your current project", True)
Call SetSetting("is", "idletime", isIdleTime, "Time (In minutes) between idle messages.", True)
Call SetSetting("is", "on/off", isStatus, "Idle message on/off.", True)
End Sub
Sub is_idle_Timer()
TimerInterval "is", "idle", (isIdleTime * 60)
If IsOnline Then
dsp 1, "/me is currently: " & isCurrently & ". Current Project: " & isProject & ". My website: http://alendar.net :-", 0, 0
End If
End Sub
Sub is_Event_PressedEnter(Text)
If Left(LCase(Text), 6) = "/idles" Then
VetoThisMessage
If Mid(LCase(Text), 8) = "on" Then
isStatus = "on"
TimerEnabled "is", "idle", True
dsp 4, "Idle on.", 0, vbGreen
Call is_idle_timer()
ElseIf Mid(LCase(Text), 8) = "off" Then
isStatus = "off"
TimerEnabled "is", "idle", False
dsp 4, "Idle off.", 0, vbRed
End If
End If
If Left(LCase(Text), 8) = "/sayidle" Then
VetoThisMessage
Call is_idle_timer()
End If
If Left(LCase(Text), 10) = "/currently" Then
VetoThisMessage
isCurrently = Mid(Text, 12)
dsp 4, "Current set to " & isCurrently & ".", 0 , vbGreen
End If
If Left(LCase(Text), 11) = "//currently" Then
VetoThisMessage
isCurrently = Mid(Text, 13)
dsp 1, "Current set to " & isCurrently & ".", 0, 0
End If
If Left(LCase(Text), 8) = "/project" Then
VetoThisMessage
isProject = Mid(Text, 10)
dsp 4, "Project set to " & isProject & "."
End If
If Left(LCase(Text), 9) = "//project" Then
VetoThisMessage
isProject = Mid(Text, 11)
dsp 1, "Project set to " & isProject & "."
End If
If Left(LCase(Text), 7) = "/istime" Then
VetoThisMessage
If IsNumeric(Mid(Text, 9)) Then
isIdleTime = Mid(Text, 9)
dsp 4, "Idle time set to " & isIdleTime & ".", 0, vbGreen
Else
dsp 4, "You must provide a numeric time!"
End If
End If
If LCase(Text) = "/idlesys status" Then
VetoThisMessage
dsp 4, "Idle system status:", 0, vbYellow
dsp 4, "Idle system is currently: " & isStatus, 0, vbCyan
dsp 4, "Idle time is set to: " & isIdleTime, 0, vbCyan
dsp 4, "Current project is set to: " & isProject, 0, vbCyan
dsp 4, "Currently doing is set to: " & isCurrently, 0, vbCyan
dsp 4, "Time until next idle message is displayed: " & GetTimeLeft("is", "idle"), 0, vbCyan
End If
End Sub