Jump to content
Sign in to follow this  

BONIC server status script

Recommended Posts


I was browsing through the help file and I came across a function that I don't think I have ever used, StringRegExp. I decided I wanted to use it just once so I came up with this. I have only tested it with the new freerainbowtables.com server but I think it will work with any server.


#include <Inet.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiStatusBar.au3>
#Include <GuiListBox.au3>

Local $Server = "http://boinc.freerainbowtables.com/distrrtgen/server_status.php"

$StatusGui = GUICreate("BOINC server status", 300, 300, -1, -1, -1, $WS_EX_TOOLWINDOW)
$ModuleList = _GUICtrlListBox_Create($StatusGui, "", 0, 0, 200, 300, $LBS_NOSEL)
$StatusList = _GUICtrlListBox_Create($StatusGui, "", 200, 0, 100, 300, $LBS_NOSEL )
$StatusBar = _GUICtrlStatusBar_Create($StatusGui, 100, "")

_GUICtrlStatusBar_SetText($StatusBar, "Downloading status...", 0)
$StatusPage = _InetGetSource($Server)
_GUICtrlStatusBar_SetText($StatusBar, "Processing...", 0)
$StatusPageLines = StringSplit($StatusPage,@CRLF)
For $i = 1 to $StatusPageLines[0]
    $Module = StringRegExp($StatusPageLines[$i], '<td>(.*?)</td>',1)
    $Status = StringRegExp($StatusPageLines[$i], '<td class=.*?>(.*?)</td>', 1)
    If @error == 0 Then
        _GUICtrlListBox_InsertString($ModuleList, $Module[0], -1)
        _GUICtrlListBox_InsertString($StatusList, $Status[0], -1)
_GUICtrlStatusBar_SetText($StatusBar, "Finished.", 0)
While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
Edited by Deltaforce229

[size="1"]Please stop confusing "how to" with "how do"[/size]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this