Author Topic: Stats >.>  (Read 2615 times)

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Stats >.>
« on: July 08, 2008, 10:04:59 PM »
This is a script that counts all outgoing messages, words, and characters, and it tallies them.  When you open the statistics window, the number of messages sent, words typed, and characters used are displayed.

Code: [Select]
Dim Stats

Function OUTTEXT(OutgoingText)
temp = split(outgoingtext," ")
count = ubound(temp) + 1
lettercount = len(OutgoingText)
totalmessages = getinifile("Wordcounter.ini","Outgoing Text","Total Messages",0)
totalwords = getinifile("Wordcounter.ini","Outgoing Text","Total Words",0)
totalletters = getinifile("Wordcounter.ini","Outgoing Text","Total Letters",0)
writeinifile "Wordcounter.ini","Outgoing Text","Total Messages",totalmessages + 1
writeinifile "Wordcounter.ini","Outgoing Text","Total Words",totalwords + count
writeinifile "Wordcounter.ini","Outgoing Text","Total Letters",totalletters + lettercount
OUTTEXT = OutgoingText
End Function

Sub Statistics()
totalmessages = getinifile("Wordcounter.ini","Outgoing Text","Total Messages",0)
totalwords = getinifile("Wordcounter.ini","Outgoing Text","Total Words",0)
totalcharacters = getinifile("Wordcounter.ini","Outgoing Text","Total Letters",0)
online = getidentifier("$online")
uptime = getidentifier("$uptime")
ticks = getidentifier("$ticks")
Stats = CreateDialog("Statistics.",193,297,426,130)
AddLabel Stats,"Messages:",0,0,100,20,1,0,"Label1"
AddLabel Stats,totalmessages,80,0,300,20,2,0,"Label2"
Addlabel Stats,"Words:",0,20,100,20,3,0,"Label3"
Addlabel Stats,totalwords,80,20,300,20,4,0,"Label4"
AddLabel Stats,"Characters:",0,40,100,20,5,0,"Label5"
Addlabel Stats,totalcharacters,80,40,300,20,6,0,"Label6"
AddLabel Stats,"Ticks:",0,60,100,20,13,0,"Label11"
AddLabel Stats,ticks,80,60,300,20,14,0,"Label12"
Addbutton Stats,"Close",0,119,105,20,8,0,"Close4"
AddButton Stats,"Update",104,119,105,20,13,0,"Update"
AddLabel Stats,"Connected:",0,80,100,20,9,0,"Label7"
Addlabel Stats,online,80,80,300,20,10,0,"Label8"
Addlabel Stats,"Uptime:",0,100,100,20,11,0,"Label9"
Addlabel Stats,uptime,80,100,300,20,12,0,"Label10"
ShowDialog Stats
End Sub

Sub Update_Clicked()
totalmessages = getinifile("Wordcounter.ini","Outgoing Text","Total Messages",0)
totalwords = getinifile("Wordcounter.ini","Outgoing Text","Total Words",0)
totalcharacters = getinifile("Wordcounter.ini","Outgoing Text","Total Letters",0)
online = getidentifier("$online")
uptime = getidentifier("$uptime")
ticks = getidentifier("$ticks")
AddItem 2,3,totalmessages
AddItem 4,3,totalwords
AddItem 6,3,totalcharacters
AddItem 10,3,online
AddItem 12,3,uptime
AddItem 14,3,ticks
End Sub

Sub Close4_Clicked()
CloseDialog Stats
End Sub

To make the Statistics window pop up, just type /stats.
Code: [Select]
/stats /! Statistics
The buttons on the Statistics window are self-explanatory.

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Stats >.>
« Reply #1 on: July 13, 2008, 01:42:59 PM »
Nice HackBenjamin
~ Sam
~ Visit my website at http://www.TheCellist42.com