Author Topic: I dont' know what to call this...  (Read 4245 times)

Omni_Bowser

  • Newbie
  • *
  • Posts: 13
I dont' know what to call this...
« on: February 15, 2008, 01:16:53 AM »
This is a script a friend from mIRC sent to me... It's supposed to show how many channels you are in and how many you are op'd in... I just don't know how to fix it to work in icechat... Any ideas?





 power  {
   var %chanop = 0, %peon = 0, %a = 1, %y = 0
   while $scon(%a) {
     var %b = $ifmatch,%f = 1,%g = 1 | scid %b | var %x = 1
     while $chan(%x) {
       if $me isop $chan(%x) { var %peon = $calc( %peon + $nick($chan(%x),0) ) | inc%chanop } | inc %x | inc %y
     }
     inc %a
   }
   scid -r | me is currently on $scid(0) networks, with ops in %chanop of the %y chans. I own %peon people.
 }

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: I dont' know what to call this...
« Reply #1 on: February 15, 2008, 03:59:55 PM »
Give this a shot, it may just work. 
To use it, just use the command '/! OpStats'

Code: [Select]
Sub OpStats()
totalS = GetIdentifier("$totalservers")
SendCommand "/echo -a Connected to $totalservers total servers"
totalOp = 0
totalOwn = 0
if totalS > 0 then
    for x = 1 to totalS
        totalC = GetIdentifier("$chan(0)",x)   
        for y = 1 to totalC
         if GetIdentifier("$nick($chan(" & y & "),$me).op",x) = "$true" then
            totalOp = totalOp + 1
            totalOwn = totalOwn + GetIdentifier("$nick($chan(" & y & "),0)",x)
         end if
        next   
    next
end if
SendCommand "/me is currently on $totalservers total servers, with ops in " & totalOp & " of the $totalchannels chans. I own " & totalOwn & " people"
End Sub
The IceChat God

Omni_Bowser

  • Newbie
  • *
  • Posts: 13
Re: I dont' know what to call this...
« Reply #2 on: February 15, 2008, 05:14:27 PM »
I tried it and I get this error message...

-- Script Engine Error:13:Type mismatch: 'OpStats': Line #1 --

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: I dont' know what to call this...
« Reply #3 on: February 15, 2008, 08:07:24 PM »
Simply means, you did not save the script.
Paste those contents to the IceChat Editor, into the Scripts Section.
Then save the file, best to save As, and choose for a file type, IceChat 5 Script, and give it a file name.
The IceChat God

Omni_Bowser

  • Newbie
  • *
  • Posts: 13
Re: I dont' know what to call this...
« Reply #4 on: February 15, 2008, 08:55:29 PM »
Ohhhh... Thank you... Works perfectly now...