Author Topic: "joincalculator"  (Read 3643 times)

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
"joincalculator"
« on: February 26, 2006, 09:13:57 AM »
I can't figure out how to make this script, so I'll ask you here on the forums

I'm on a channel for a site that has a JavaIRC client, and everyone that joins from that client has a similar nickname (like nick1, nick2...), and what I would like the script to do is to count these joins and store the number of joins in a file, and then I'd like to be able to print out this number to the channel. Hope you get what I mean
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: "joincalculator"
« Reply #1 on: February 26, 2006, 08:20:08 PM »
Ok, this script checks for nicknames that start with "nick" , and saves the results to an INI file.
The command /joincounter displays the results for you.
This script also works for all channels you are in.

Code: [Select]

Sub ONJOIN(Nickname,Host,Channel,ServerNumber)   
'check if the beginning of the nickname starts with "nick"   
Dim count   
If Left(NickName,4) = "nick" then   
   count = GetIniFile("joincounter.ini","Counter","Total", "0")   
   WriteIniFile "joincounter.ini","Counter","Total",count + 1   
End if   

End Sub   

Function ALIASES(Command,Parameters,ServerNumber)       
Dim count 
Select Case Command       
   Case "/joincounter"       
      ALIASES=True 'we have a match       
      count = GetIniFile("joincounter.ini","Counter","Total", "0")   
      SendCommand "/echo -a ->> Total nicknames joined with 'nick' prefix= " & count, ServerNumber   
End Select       
       
End Function       

The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: "joincalculator"
« Reply #2 on: February 27, 2006, 01:01:56 AM »
thanks alot
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein