Due to an upgrade on the node side of things, this version of Node Usage is discontinued.
Please proceed through the magic door to Node Usage 3!
Better with more options – Node Usage 3.
The node usage script for mIRC that does not require MUM to operate
Requirements
Installation
You have two options
Troubleshooting
I guess what I’m trying to say is, while everything says ssl works in 6.17, if you have any problems try 6.2 – others have reported success.
;****************************************************
;* NodeUsage Version2 0.03 **************************
;****************************************************
;* Writen by Freman aka Fremean *
;****************************************************
;* Pay a vist to http://fremnet.net/contact if you *
;* Feel the burning desire to leave comments, *
;* compliments, or complaints *
;****************************************************
;* To catch me look for Freman/Fremean on Gamesurge *
;* If I'm online and around, I'll get back to you *
;* Home Chan(s): #ign *
;****************************************************
;* Commands: *
;* /NodeUsage2 - Spams your usage into the chan *
;* /NodeUsage - Alias for /NodeUsage2 *
;* /NodeUsage2.Setup - The setup dialog *
;****************************************************
;****************************************************
; Aliases
;****************************************************
; For the lazy people, I map /NodeUsage to /NodeUsage2
alias NodeUsage {
NodeUsage2
}
; Spam your usage to the current window
alias NodeUsage2 {
set %NodeUsage2.ToChannel $active
NodeUsage2.Sanity
if ($NodeUsage2.GetUsage) {
var %updated = %NodeUsage2.LastUpdate
var %used = %NodeUsage2.Used
var %limit = %NodeUsage2.Limit
var %reset = $asctime(%NodeUsage2.Rollover,dd/mm/yyyy)
var %rduation = $duration($calc(%NodeUsage2.Rollover - $ctime))
var %dration = $gettok(%rduation, $+(1-,$calc($numtok(%rduation,32)-1)),32)
var %daysinmonth = 31.x.31.30.31.30.31.31.30.31.30.31
if (%limit == 0) {
var %text = thanks god for flatrate as [ %NodeUsage2.Gender1 ] has abused [ %NodeUsage2.Gender ] connection and downloaded [ %used ] megs.
}
else {
if (%used > %limit) {
var %text = is over [ %NodeUsage2.Gender ] %limit meg node usage limit by $calc(%used - %limit) megs, [ %dration ] till reset [Last Updated: $asctime(%updated,h:nn tt zz) $+ ]]
}
else {
var %remain = $calc(%limit - %used)
var %text = has [ %dration ] to use the remaining [ %remain megs ] of [ %NodeUsage2.Gender ] %limit meg node usage limit [Last Updated: $asctime(%updated,h:nn tt zz) $+ ]]
if (%NodeUsage2.Averages == 1) {
var %avgpast = $round($calc(($ctime(01:01 %reset) - $ctime)/24/60/60),0)
%avgpast = $round($calc(%remain / %avgpast),2)
%text = %text Average daily to end of month: %avgpast mb
}
}
}
; If the SSL dialog pops up it breaks shit, this fixes the broken shit
describe %NodeUsage2.ToChannel %text
}
}
; Display the setup dialog
alias NodeUsage2.Setup {
dialog -m NodeUsage2.Setup NodeUsage2.Dialog1
}
; Something to get around the most common problems from the first script
alias -l NodeUsage2.Sanity {
if (%NodeUsage2.Setup != $true) {
NodeUsage2.RaiseError I have not been setup, please /reload the script - When prompted to run the initialization commands, choose yes
}
if (%NodeUsage2.Username == $null) {
NodeUsage2.RaiseError No username set, please run /NodeUsage2.Setup
}
if (%NodeUsage2.Password == $null) {
NodeUsage2.RaiseError No username set, please run /NodeUsage2.Setup
}
}
; Go off and fetch the usage from node's servers
alias -l NodeUsage2.GetUsage {
; Make sure someone hasn't done something stupid
NodeUsage2.SSLnVersion
; Prevent the script from fetching data more then once per hour
if ($calc($ctime - %NodeUsage2.LastUpdate) > 3600) {
sockopen -e NodeUsage2 accounts.internode.on.net 443
return $false
}
return $true
}
; Make an error message!
alias -l NodeUsage2.RaiseError {
if ($sock(NodeUsage2).status == active) {
sockclose NodeUsage2
}
if (!$line($active,0)) { linesep -a }
echo $color(info) -a * [NodeUsage2] $1-
linesep -a
halt
}
; Check mIRC version and make sure SSL is installed
alias -l NodeUsage2.SSLnVersion {
; Check version
if ($version < 6.17) {
NodeUsage2.RaiseError I am sorry, I need mIRC 6.14 or better
halt
}
; Check for SSL support
if ($sslready != $true) {
NodeUsage2.RaiseError I need a SSL enabled mIRC see http://www.mirc.co.uk/ssl.html
halt
}
}
; The initialization command
alias -l NodeUsage2.Init {
NodeUsage2.SSLnVersion
echo 3 -as .................................
echo 3 -as . Node Usage2 V0.01 .............
echo 3 -as ..................... by Freman .
echo 3 -as .................................
echo 3 -as .. Spam the current channel .....
echo 3 -as .............. with your usage ..
echo 3 -as .................................
echo 3 -as ..... Setting default vars. .....
echo 3 -as .................................
set %NodeUsage2.Username
set %NodeUsage2.Password
set %NodeUsage2.Gender his
set %NodeUsage2.Gender1 he
set %NodeUsage2.Averages 1
set %NodeUsage2.Setup $true
NodeUsage2.Setup
}
;****************************************************
; Events
;****************************************************
; Executed as the script is loaded
on *:LOAD: {
NodeUsage2.Init
}
; Executed as the script is unloaded
on *:UNLOAD: {
unset %NodeUsage2.*
}
; Once the socket is open, we must perform a HTTP POST
on *:SOCKOPEN:NodeUsage2: {
if ($sockerr) { NodeUsage2.RaiseError Socket Error ( $+ $sockerr $+ ) }
sockwrite -tn $sockname POST /cgi-bin/padsl-usage HTTP/1.0
sockwrite -tn $sockname Host: accounts.internode.on.net
sockwrite -tn $sockname User-Agent: Fremnet-NodeUsage2/1.0
sockwrite -tn $sockname Connection: close
var %Content username= $+ %NodeUsage2.Username $+ @internode.on.net&password= $+ %NodeUsage2.Password
sockwrite -tn $sockname Content-length: $len(%Content)
sockwrite -tn $sockname
sockwrite -tn $sockname %Content
sockwrite -tn $sockname
}
; The sever is speaking back to us
on *:SOCKREAD:NodeUsage2: {
if ($sockerr) { NodeUsage2.RaiseError Socket Error ( $+ $sockerr $+ ) }
var %data
sockread %data
tokenize 32 %data
; Check and see if the first character is a number, if it is then
; it's probably our usage.
if ($left($1,1) == $int(0 $+ $left($1,1))) {
set %NodeUsage2.LastUpdate $ctime
set %NodeUsage2.Used $round($1,2)
set %NodeUsage2.Limit $2
set %NodeUsage2.Rollover $ctime($3 01:01)
set %NodeUsage2.ExcessRate $4
sockclose $sockname
; Execute the output command again
NodeUsage2
}
; On the other hand...
if (%data == Authentication failed) {
NodeUsage2.RaiseError Authentication Failure - Check your username/password. Type /NodeUsage2.Setup
}
}
; The server is beign rude
on *:SOCKCLOSE:NodeUsage2: {
if ($sockerr) { NodeUsage2.RaiseError Socket Error ( $+ $sockerr $+ ) }
NodeUsage2.RaiseError Remote host closed socket
}
; Executed as the dialog is opened
on *:DIALOG:NodeUsage2.Setup:init:0: {
didtok $dname 8 46 Male.Female
if (%NodeUsage2.Gender == his) {
did -c $dname 8 1
}
else {
did -c $dname 8 2
}
if (%NodeUsage2.Averages == 1) {
did -c $dname 11
}
}
; Executed when Ok is clicked
on *:DIALOG:NodeUsage2.Setup:sclick:15: {
%NodeUsage2.Username = $did($dname,9)
%NodeUsage2.Password = $did($dname,10)
if ($did($dname,8).sel == 1) {
%NodeUsage2.Gender = his
%NodeUsage2.Gender1 = he
}
else {
%NodeUsage2.Gender1 = she
%NodeUsage2.Gender = her
}
%NodeUsage2.Averages = $did($dname,11).state
}
;***************************************************
; Dialogs
;***************************************************
dialog NodeUsage2.Dialog1 {
title "NodeUsage2 Setup"
size -1 -1 160 62
option dbu
text "Gender:",3,1 2 40 10
text "Username:",4,1 12 40 10
text "Password:",5,1 22 40 10
text "@internode.on.net",6,84 12 50 10
combo 8,42 1 50 10,drop
edit %NodeUsage2.Username,9,42 12 40 10,autohs
edit %NodeUsage2.Password ,10,42 22 40 10,autohs pass
check "Display Averages",11,42 32 150 10
button "OK", 15, 120 41 40 10, ok
button "Cancel", 16, 120 51 40 10, cancel
}
Commenting is closed for this article.