Jump to content

Graphical Monitor of whatever


taietel
 Share

Recommended Posts

This is really turning out very nicely for something done with no outside DLL calls. I mean, AutoIt uses GDI32 calls internally obviously to do the drawing, but who knew all this could be done with basic built-in AutoIt functions (I sure didn't). Great work andy and taietel ;)

Link to comment
Share on other sites

Ye i made kinda different UDF not the type of statistic his using i made a wave graph monitor.

#include <GDIPlus.au3>
Func _Stat_Newpoint($x, $y)
if $point[2][0] < $y Then $point[2][0] = $y
if $point[2][1] > $y Then $point[2][1] = $y
$y = ($stat[5]-$y)
$point[0][$point[0][0]+1] = $x
$point[1][$point[0][0]+1] = $y
$point[0][0] = $point[0][0] + 1
_GDIPlus_GraphicsDrawLine ($stat[2], $x, 0, $x, $stat[5], $stat[3])
_GDIPlus_GraphicsDrawLine ($stat[2], $x, 0, $x, $y, $stat[1])
EndFunc
Func _Stat_Init($gui, $x = 300, $y = 300, $size = 1)
Global $stat[9999]
Global $point[3][99999]
$point[2][1] = 9999999 
_GDIPlus_Startup ()
$stat[1] = _GDIPlus_PenCreate()
$stat[2] = _GDIPlus_GraphicsCreateFromHWND($gui)
$stat[3] = _GDIPlus_PenCreate(0xFF00FF00)
$stat[4] = $x/$size
$stat[5] = $y/$size
$stat[6] = $size
EndFunc
Func _Stat_Update($max = "", $min = "", $click = "")
if $max <> "" Then GUICtrlSetData($max, "Max: " & $point[2][0])
if $min <> "" Then GUICtrlSetData($min, "Min: " & $point[2][1])
if $click <> "" Then GUICtrlSetData($click, "Done: " & $point[0][0])
EndFunc

example:

#include <Stat.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
    $gui = GUICreate("Monitor", 300, 100)
    GUISetState(@SW_SHOW)
    GUISetBkColor(0x000000)
    _Stat_Init($gui, 300, 100, 1.0)
    $max = GUICtrlCreateLabel("Max: ", 0, 80, 50, 20)
    GUICtrlSetBkColor(-1, 0x00FF00)
    GUICtrlSetFont(-1, 7, 1000)
    $min = GUICtrlCreateLabel("Min: ", 50, 80, 50, 20)
    GUICtrlSetBkColor(-1, 0x00FF00)
    GUICtrlSetFont(-1, 7, 1000)
    $cl = GUICtrlCreateLabel("Click: ", 100, 80, 50, 20)
    GUICtrlSetBkColor(-1, 0x00FF00)
    GUICtrlSetFont(-1, 7, 1000)
    $i = 0
    While 1
        $i = $i + 1
        $msg = GUIGetMsg()
        $ping = Ping("178.162.148.142", 100)
        ;$ping = Random(15, 100)
        _Stat_Newpoint($i, $ping)
        _Stat_Update($max, $min, $cl)
        if $i = 300 Then $i = 0
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
    GUIDelete()
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...